Skip to content
Skip to Content
Full reference

Push

GET
/v1/devices

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Response Body

Devices. The token is never returned.

application/json
  1. response
devices*array<>
Example Request
curl -X GET 'https://example.com/v1/devices'
Example Response
{  "devices": [    {      "id": "string",      "platform": "ios",      "last_seen_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/v1/devices

Call after sign-in and whenever Firebase gives the app a new token. A token already registered is refreshed; one that belonged to another account on the same phone moves to this user. A user can have at most 10 devices.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Request Body

application/json
  1. body
token*string
Lengthlength <= 1024
platform*string
Value in"ios""android"

Response Body

The device

application/json
  1. response
id*string
platform*string
Value in"ios""android"
last_seen_at*string
Formatdate-time
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/v1/devices' \  -H 'Content-Type: application/json' \  -d '{  "token": "string",  "platform": "ios"}'
Example Response
{  "id": "string",  "platform": "ios",  "last_seen_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
DELETE
/v1/devices/{id}

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Response Body

Removed

Example Request
curl -X DELETE 'https://example.com/v1/devices/string'
Example Response
Empty
GET
/v1/push/settings

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Response Body

Settings

application/json
  1. response
push_enriched*boolean

A quiet event when the AI finishes an item (phones and open web apps)

push_daily*boolean

The daily Serendipity reminder (phones)

daily_hour*integer
Range0 <= value <= 23
timezone*string

IANA name

Example Request
curl -X GET 'https://example.com/v1/push/settings'
Example Response
{  "push_enriched": true,  "push_daily": true,  "daily_hour": 0,  "timezone": "string"}

Change push settings

PATCH
/v1/push/settings

Turning push_enriched off also turns off the realtime web event. Fields you leave out are not changed.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Request Body

application/json
  1. body
push_enriched?boolean
push_daily?boolean
daily_hour?integer
Range0 <= value <= 23
timezone?string

Response Body

Settings

application/json
  1. response
push_enriched*boolean

A quiet event when the AI finishes an item (phones and open web apps)

push_daily*boolean

The daily Serendipity reminder (phones)

daily_hour*integer
Range0 <= value <= 23
timezone*string

IANA name

Example Request
curl -X PATCH 'https://example.com/v1/push/settings' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "push_enriched": true,  "push_daily": true,  "daily_hour": 0,  "timezone": "string"}
GET
/v1/realtime

enabled is false when no Pusher-protocol server is configured. Otherwise connect with pusher-js, using ws_host, ws_port and tls as its wsHost, wsPort and forceTLS, and key as the app key. Hosted Pusher Channels returns cluster instead of a host. Authorise through auth_endpoint, sending the session token as a bearer header, and subscribe to channel. See docs/PUSH.md.

events lists every event name the channel can carry. Payloads:

EventPayloadFires when
item.created{item_id, change_seq}an item is saved
item.updated{item_id, change_seq}any change to an item, whoever made it: an edit, a rule, enrichment, a thumbnail swap, a list add or remove, a shared item's state
item.enriched{item_id, change_seq}AI enrichment finished (not for imports)
item.deleted{item_id, change_seq}an item is deleted (item_id always set)
list.items_changed{list_id}an item is added to or removed from a list the user owns or is a member of
list.members_changed{list_id}a member is invited, joins, changes role or leaves
asset.attached{item_id, kind}a screenshot, archive or pdf copy finishes
import.progress{import_id, done, total}an import starts, advances or ends
notification.created{notification_id}a notification reached the inbox (includes list invitations, import and export results)
reminder{item_id, reminder_id}a reminder went off
export.ready{export_id}a data export finished

change_seq is a number: the item's change sequence when the event was sent, comparable with the change_seq of items from /v1/sync. Events for one item are merged when they come close together, so expect fewer events than writes. Delivery is best effort: poll GET /v1/sync/head as a fallback.

Send X-Socket-Id: <pusher.connection.socket_id> on a write and the events it causes skip that connection. Changes made later by rules or enrichment still reach it.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Response Body

Connection settings

application/json
  1. response
enabled*boolean
key?string

The public app key

ws_host?string
cluster?string

Hosted Pusher Channels only. Use it as pusher-js's cluster.

ws_port?integer
tls*boolean
channel?string
auth_endpoint?string
events?array<string>
Example Request
curl -X GET 'https://example.com/v1/realtime'
Example Response
{  "enabled": true,  "key": "string",  "ws_host": "string",  "cluster": "string",  "ws_port": 0,  "tls": true,  "channel": "string",  "auth_endpoint": "string",  "events": [    "string"  ]}
POST
/v1/realtime/auth

The endpoint pusher-js calls. Accepts a form body or JSON. Only private-user-<your id> is ever signed.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Request Body

  1. body
socket_id*string
channel_name*string

Response Body

The signature pusher-js expects

application/json
  1. response
auth*string
Example Request
curl -X POST 'https://example.com/v1/realtime/auth' \  -H 'Content-Type: application/json' \  -d '{  "socket_id": "1234.5678",  "channel_name": "private-user-01J..."}'
Example Response
{  "auth": "app-key:signature"}