Subscribers

Register a device token

Idempotently register ONE deviceToken on the subscriber's providerId channel (e.g. fcm, apns). Re-registering the same token is a no-op (no duplicate). Pass previousToken to atomically swap a rotated token. On overflow the OLDEST tokens are dropped. Never wipes the channel — unlike a whole-array credentials update. The token travels in the body because it may contain URL-hostile characters.

post/v1/subscribers/{subscriberId}/credentials/{providerId}/token

Request

  • Base URL: https://api.notifly.io
  • URL: https://api.notifly.io/v1/subscribers/{subscriberId}/credentials/{providerId}/token
  • Auth: API key in header Authorization

Path parameters

subscriberIdstring required
providerIdstring required

Request body

tokenstring required

The device/push token to register. Sent in the body (not the path) because tokens can contain URL-hostile characters (e.g. a JSON-stringified web-push subscription).

previousTokenstring

The token the device previously held. When supplied, it is atomically removed as the new token is added (device token rotation), leaving no stale token behind.

integrationIdentifierstring

Disambiguate when the environment has multiple active integrations for this provider.

maxDeviceTokensnumber

Maximum device tokens to retain for this subscriber/provider. On overflow the OLDEST tokens are dropped. Defaults to the environment/system limit when omitted.

Response

OK

Example response

{
  "data": {
    "channels": [
      {
        "credentials": {
          "webhookUrl": "https://example.com/webhook",
          "channel": "general",
          "deviceTokens": [
            "token1",
            "token2",
            "token3"
          ],
          "alertUid": "12345-abcde",
          "title": "Critical Alert",
          "imageUrl": "https://example.com/image.png",
          "state": "resolved",
          "externalUrl": "https://example.com/details"
        }
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.