Add a registration or device token

POST {{baseUrl}}/v3/users/:user_id/push/:token_type

Add a registration or device token

Note: A user can have up to 20 FCM registration tokens, 20 HMS device tokens, and 20 APNs device tokens each. The oldest token will be deleted before a new token is added for a user who already has 20 registration or device tokens. Only the 20 newest tokens will be maintained for users who already have more than 20 of each token type.

To send notification requests to push notification services on behalf of your server, adds a specific user's FCM registration token, HMS device token, or APNs device token to Sendbird server. Depending on which push service you are using, you can pass one of two values in token_type: gcm, huawei, or apns.

A FCM registration token and an APNs device token allow identification of each client app instance on each device, and are generated and registered by Android and iOS apps through the corresponding SDKs. Use this method if you need to register a token via your own server.

Note: For more information on the registration token and device token, visit the Google's FCM page, Huawei's Push kit and Apple's APNs page.

https://sendbird.com/docs/chat/v3/platform-api/guides/user#2-add-a-registration-or-device-token

Request Body

{"gcm_reg_token"=>"<string>", "huawei_device_token"=>"<string>", "apns_device_token"=>"<string>"}

HEADERS

KeyDatatypeRequiredDescription
Api-Tokenstring(Required)
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;tokens&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;token&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;type&quot;:&quot;\u003cstring\u003e&quot;,&quot;user&quot;:{&quot;require_auth_for_profile_image&quot;:&quot;\u003cboolean\u003e&quot;,&quot;is_online&quot;:&quot;\u003cboolean\u003e&quot;,&quot;user_id&quot;:&quot;\u003cstring\u003e&quot;,&quot;access_token&quot;:&quot;\u003cstring\u003e&quot;,&quot;has_ever_logged_in&quot;:&quot;\u003cboolean\u003e&quot;,&quot;is_active&quot;:&quot;\u003cboolean\u003e&quot;,&quot;last_seen_at&quot;:&quot;\u003cinteger\u003e&quot;,&quot;nickname&quot;:&quot;\u003cstring\u003e&quot;,&quot;discovery_keys&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;session_tokens&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;preferred_languages&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;profile_url&quot;:&quot;\u003cstring\u003e&quot;,&quot;created_at&quot;:&quot;\u003cinteger\u003e&quot;,&quot;phone_number&quot;:&quot;\u003cstring\u003e&quot;,&quot;local&quot;:&quot;\u003cstring\u003e&quot;,&quot;locale&quot;:&quot;\u003cstring\u003e&quot;,&quot;is_hide_me_from_friends&quot;:&quot;\u003cboolean\u003e&quot;,&quot;is_shadow_blocked&quot;:&quot;\u003cboolean\u003e&quot;,&quot;is_created&quot;:&quot;\u003cboolean\u003e&quot;,&quot;metadata&quot;:{&quot;constructor&quot;:{&quot;arguments&quot;:{},&quot;caller&quot;:{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/Function detected\u003e&quot;},&quot;length&quot;:&quot;\u003cnumber\u003e&quot;,&quot;prototype&quot;:{}}},&quot;description&quot;:&quot;\u003cstring\u003e&quot;,&quot;end_at&quot;:&quot;\u003cnumber\u003e&quot;,&quot;start_at&quot;:&quot;\u003cnumber\u003e&quot;}}