Mobile Push API
Beta
REST

Devices & Topics

Manage the device token inventory that powers targeting. Register tokens from your backend, bind them to users, subscribe to topics, and remove stale tokens so FCM and APNs delivery rates stay healthy.

Token registry

Store iOS and Android tokens per business with optional user binding.

User binding

Attach a userId so one send fans out to every device the user owns.

Topics

Subscribe tokens to named topics for campaigns and product segments.

Clean lifecycle

Delete tokens on logout or invalidation to protect delivery quality.

Platforms

ios | android

per registration

Topics / device

50

maximum

Idempotent

Yes

re-register updates

Rate limit

200/s

per API key

POST
/v1/push/devices
Register
Beta

Create or update a device registration. If the same token already exists for your business, Sendexa updates platform, userId, and merges topics (union with existing subscriptions unless you manage topics separately).

Request parameters

FieldTypeRequiredDescription
tokenstring
required
Full FCM registration token or APNs device token (hex string). Max 4096 chars.
platform"ios" | "android"
required
Must match the service that issued the token.
userIdstringoptionalYour application user id (max 128). Pass null-equivalent by omitting to leave unbound; send a new value to rebind after login.
topicsstring[]optionalInitial topics to subscribe. Each name: 1–64 chars, [A-Za-z0-9_-]. Max 50 topics.
JSON
{
"token": "dG9rZW4tZXhhbXBsZS1mY20tYW5kcm9pZA...",
"platform": "android",
"userId": "user_abc123",
"topics": ["news", "orders", "promo-july"]
}

Success response (200)

JSON
{
"success": true,
"code": "DEVICE_REGISTERED",
"message": "Device token registered.",
"requestId": "REQ-1782000002001",
"timestamp": "2026-07-12T12:00:00.000Z",
"data": {
"deviceId": "DEV-4f2a9c1e-88b0-4d2a-9f11-0c1d2e3f4a5b",
"token": "dG9rZW4tZXhhbXBsZS1mY20tYW5kcm9pZA...",
"platform": "android",
"userId": "user_abc123",
"topics": ["news", "orders", "promo-july"],
"createdAt": "2026-07-12T12:00:00.000Z",
"updatedAt": "2026-07-12T12:00:00.000Z"
}
}
Bash
curl -X POST 'https://api.sendexa.co/v1/push/devices' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_DASHBOARD_BASE64_TOKEN' \
-d '{
"token": "dG9rZW4tZXhhbXBsZS1mY20...",
"platform": "android",
"userId": "user_abc123",
"topics": ["news", "orders"]
}'
DELETE
/v1/push/devices/:token
Unregister

Remove a device from your registry. After deletion, sends that target this token (or a user that only had this device) will fail resolution. Topic memberships for the token are removed.

FieldTypeRequiredDescription
tokenstring (path)
required
Exact device token previously registered. URL-encode if it contains special characters.
Bash
curl -X DELETE \
'https://api.sendexa.co/v1/push/devices/dG9rZW4tZXhhbXBsZS1mY20...' \
-H 'Authorization: Basic YOUR_DASHBOARD_BASE64_TOKEN'
HTTPCodeMeaning
200DEVICE_DELETEDToken removed (or already absent — still success for idempotent clients)
404DEVICE_NOT_FOUNDStrict mode: token never registered for this business
401UNAUTHORIZEDMissing or invalid Basic auth
POST
/v1/push/topics/subscribe
Topics

Subscribe one or more already-registered device tokens to a topic. Topics are created implicitly on first subscription. Sending with to.type = "topic" reaches all current subscribers.

FieldTypeRequiredDescription
topicstring
required
Topic name: 1–64 characters, letters, numbers, _ and - only.
tokensstring[]
required
One or more registered device tokens (max 1000 per request).
JSON
{
"topic": "promo-july",
"tokens": [
"dG9rZW4tZXhhbXBsZS1mY20tMQ...",
"dG9rZW4tZXhhbXBsZS1hcG5zLTI..."
]
}
Bash
curl -X POST 'https://api.sendexa.co/v1/push/topics/subscribe' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic YOUR_DASHBOARD_BASE64_TOKEN' \
-d '{
"topic": "promo-july",
"tokens": [
"dG9rZW4tZXhhbXBsZS1mY20tMQ...",
"dG9rZW4tZXhhbXBsZS1hcG5zLTI..."
]
}'

Topic naming rules

RuleDetail
Length1–64 characters
CharactersA–Z, a–z, 0–9, underscore (_), hyphen (-)
CaseCase-sensitive (News ≠ news)
ReservedAvoid names starting with sendexa_ or fcm_ (reserved for internal use)
Per deviceMaximum 50 topic memberships
Per subscribe callMaximum 1000 tokens
Device lifecycle
  1. Install / permission — App obtains FCM or APNs token.
  2. Register — Backend calls POST /v1/push/devices without userId if the user is anonymous.
  3. Login — Re-register with userId so account alerts reach this device.
  4. Segment — Subscribe to topics based on preferences or cohorts.
  5. Refresh — OS issues a new token → register again; old token may later fail and should be deleted when FCM/APNs reports invalid.
  6. Logout / uninstall — Delete token. Uninstall is often detected only via failed deliveries.
Error reference
HTTPCodeEndpointCause
400INVALID_TOKENregister / subscribeEmpty, too long, or malformed token
400INVALID_PLATFORMregisterplatform not ios or android
400INVALID_TOPICregister / subscribeTopic name fails naming rules
400TOO_MANY_TOPICSregister / subscribeDevice would exceed 50 topics
400TOO_MANY_TOKENSsubscribeMore than 1000 tokens in one request
401UNAUTHORIZEDallAuth missing or invalid
404DEVICE_NOT_FOUNDdelete / subscribeToken not in registry (subscribe may partial-fail)
429RATE_LIMIT_EXCEEDEDallOver 200 req/s