API reference

API reference · Account

Keep this browser's push subscription

POST/api/account/pushSigned in session

The body is PushSubscription.toJSON(). Only the browsers' own push services are accepted. At most 10 devices; the oldest make room. Same origin only, ten changes a minute. 503 push_unavailable while push is off.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
endpointrequiredstring
expirationTimenumber or null
keysrequiredobject
keys.p256dhrequiredstring
keys.authrequiredstring

Example

{
  "endpoint": "string",
  "expirationTime": 0,
  "keys": {
    "p256dh": "string",
    "auth": "string"
  }
}

Answer 200

Kept; the account's devices.

Fields of the 200 answer
FieldTypeWhat it is
devicesarray of object
devices[].keystringA digest of the endpoint; never the endpoint itself.
devices[].labelstring or nullBrowser and system, from the user agent.
devices[].servicestringThe push service's host.
devices[].createdAtinteger
devices[].lastSuccessAtinteger or null

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 403OpenAI shaped error.
  • 429OpenAI shaped error.
  • 503OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter