Skip to main content
GET
/
users
/
{user_id}
/
tokens
/
{token}
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: 'My API Key',
});

const token = await client.users.tokens.retrieve('token', { user_id: 'user_id' });

console.log(token);
{
  "token": "<string>",
  "provider_key": "firebase-fcm",
  "expiry_date": "<string>",
  "properties": "<any>",
  "device": {
    "app_id": "<string>",
    "ad_id": "<string>",
    "device_id": "<string>",
    "platform": "<string>",
    "manufacturer": "<string>",
    "model": "<string>"
  },
  "tracking": {
    "os_version": "<string>",
    "ip": "<string>",
    "lat": "<string>",
    "long": "<string>"
  },
  "status": "active",
  "status_reason": "<string>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

user_id
string
required

The user's ID. This can be any uniquely identifiable string.

token
string
required

The full token string.

Response

token
string
required

Full body of the token. Must match token in URL path parameter.

provider_key
enum<string>
required
Available options:
firebase-fcm,
apn,
expo,
onesignal
status
enum<string>
Available options:
active,
unknown,
failed,
revoked
status_reason
string | null

The reason for the token status.

expiry_date

ISO 8601 formatted date the token expires. Defaults to 2 months. Set to false to disable expiration.

properties
any

Properties about the token.

device
object

Information about the device the token came from.

tracking
object

Tracking information about the device the token came from.