Skip to content

User Push Clients

List of valid attributes:

AttributeDescriptionSpecifics
endpointThe push subscription endpoint URLRequired, must be a valid URL, unique, readable and writable
keysAuthentication keysRequired, must be a JSON object with string values for keys ‘auth’ and ‘p256dh’, writable only

Only the endpoint field is returned in responses. All other fields are writable but not readable.

Create

Example request:

{
"data": {
"type": "push_client",
"attributes": {
"endpoint": "https://fcm.googleapis.com/fcm/send/abc123...",
"keys": {
"auth": "string-value",
"p256dh": "string-value"
}
}
}
}

Example response:

{
"data": {
"id": "e1b2c3d4-5678-1234-9abc-def012345678",
"type": "push_client",
"attributes": {
"endpoint": "https://fcm.googleapis.com/fcm/send/abc123..."
}
}
}

How it works

When registering a push client, the server ensures that each endpoint is unique for a user. If a push client with the same endpoint already exists, data will be updated with the new values provided. If no such push client exists, a new one will be created.

HTTP Request

POST /api/v1/users/:user_id/push_clients

URL Parameters

ParameterDescription
user_idThe ID of the user to create the push client for