For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
GithubSign up
DocsCouriersShippersForwardersTrackersAppAPI ReferenceSDKsFAQ
DocsCouriersShippersForwardersTrackersAppAPI ReferenceSDKsFAQ
  • API Reference
        • GETGet private data
        • POSTCreate private data
        • PATCHUpdate private data
        • PUTUpsert FCM token
LogoLogo
GithubSign up
API ReferenceUsersPrivate Data

Upsert FCM token

PUT
/users/user_private_data/firebase_cloud_messaging_token/v1
PUT
/users/user_private_data/firebase_cloud_messaging_token/v1
1import { ChrtClient } from "@chrt-inc/typescript-sdk";
2
3async function main() {
4 const client = new ChrtClient({
5 token: "YOUR_TOKEN_HERE",
6 });
7 await client.users.privateData.upsertFirebaseCloudMessagingTokenV1({
8 firebase_cloud_messaging_token: "dGhpcy1pcy1hLWZpcmViYXNlLWNsb3VkLW1lc3NhZ2UtdG9rZW4=",
9 });
10}
11main();
1{
2 "schema_version": 1,
3 "created_at_timestamp": "2024-01-15T09:30:00Z",
4 "user_id": "user_1234567890",
5 "_id": "63c9f1a2e4b0f5a1d2c3e4f5",
6 "primary_email_address": "jane.doe@example.com",
7 "phone_number": "+14155552671",
8 "firebase_cloud_messaging_token_data": [
9 {
10 "firebase_cloud_messaging_token": "dGhpcy1pcy1hLWZpcmViYXNlLWNsb3VkLW1lc3NhZ2UtdG9rZW4=",
11 "last_used_timestamp": "2024-01-15T09:30:00Z",
12 "platform": "android"
13 }
14 ]
15}

Upserts a Firebase Cloud Messaging token for the caller. Dedupes on token; if token exists, updates last_used_timestamp. | (FirebaseCloudMessagingTokenClientCreate1) -> (UserPrivateData1)

Was this page helpful?
Previous

Get by ID

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
firebase_cloud_messaging_tokenstringRequired
platformenumOptional
Allowed values:

Response

Successful Response
schema_versioninteger
created_at_timestampdatetime
user_idstring

Must be a string starting with user_

_idstring
primary_email_addressstringformat: "email"
phone_numberstring
firebase_cloud_messaging_token_datalist of objects

Errors

422
Private Data Upsert Firebase Cloud Messaging Token V1request Unprocessable Entity Error