Skip to content

Get the VAPID public key

GET
/push-subscriptions/vapid-public-key
Code sample: Shell / cURL
curl --request GET \
--url https://example.com/api/v1/push-subscriptions/vapid-public-key \
--header 'Authorization: Bearer <token>'

Returns the public key browsers need to create a web push subscription.

The VAPID public key.

Media typeapplication/json
object
data
required

VAPID public key for web push.

object
key
required

VAPID public key used to create a web push subscription in the browser.

string

Example generated

{
"data": {
"key": "example"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Push notifications are not configured on the server.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}