Skip to content

Register a push token

POST
/notifications/mobile
curl --request POST \
--url https://work.optidata.cloud/api/notifications/mobile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "push_notification_token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]" }'

Binds a push-notification token to the calling user. Any token previously registered by that user is deactivated first, so one user has at most one active device token. Send either push_notification_token or the legacy expo_token.

Media typeapplication/json
object
push_notification_token

Required unless expo_token is sent.

string | null
expo_token

Legacy alias of push_notification_token.

string | null

The token is registered.

Media typeapplication/json

Minimal acknowledgement returned by several write operations.

object
success
required
boolean
Example
{
"success": true
}

Missing, malformed or expired authentication key.

Media typeapplication/json

Authentication failures use an error key rather than message.

object
error
required
string
Examples
Examplemissing

No bearer token sent

{
"error": "JWT passport exception: Missing bearer token in request"
}

The request body or query string failed validation.

Media typeapplication/json
object
message
required

The first validation message.

string
errors
required

Validation messages keyed by field name.

object
key
additional properties
Array<string>
Examples
Exampleinvalid
{
"message": "The name field is required.",
"errors": {
"name": [
"The name field is required."
]
}
}

Rate limit exceeded. Retry after the window resets.

Media typeapplication/json

Generic error envelope used by policy, binding and framework failures.

object
message
required

Human-readable description of the failure.

string
Examples
Examplethrottled
{
"message": "Too Many Attempts."
}