Skip to content

Register a push subscription

POST
/api/v1/notifications/subscriptions
curl --request POST \
--url https://example.com/api/v1/notifications/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "installation_id": "example", "subscription": { "endpoint": "example", "keys": { "auth": "example", "p256dh": "example" } } }'

Save a push subscription for one Installation. The server checks the endpoint and encryption keys before it stores them. It returns no response body. Route: /api/v1/notifications/subscriptions. Inputs: . Do not automatically replay this operation after an uncertain result.

Media typeapplication/json
object
installation_id
required

Stable random ID for one browser or app Installation.

string
subscription
required

Browser Push API subscription fields.

object
endpoint
required

HTTPS endpoint from the browser Push API.

string
keys
required

Encryption keys from the browser Push API.

object
auth
required

URL-safe, unpadded auth secret.

string
p256dh
required

URL-safe, unpadded P-256 public key.

string
Examplegenerated
{
"installation_id": "example",
"subscription": {
"endpoint": "example",
"keys": {
"auth": "example",
"p256dh": "example"
}
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}
Media typeapplication/json

The standard API error response: { "error": { ... } }.

object
error
required

Error details.

object
code
required

Stable machine-readable code.

string
Allowed values: bad_request unauthorized forbidden not_found conflict name_conflict_case name_too_long push_endpoint_rejected too_many_requests internal service_unavailable
details
One of:

Optional field or operation details.

object
key
additional properties
string
message
required

Safe text for logs or a user-facing error message.

string
Example
{
"error": {
"code": "bad_request"
}
}