apidata.one docs Get a key

POST /v1/client-tokens

Mint a short-lived token that lets a browser act for one consumer.

Access
Keys secret only
Plan every plan
Environment live and sandbox
Acts for the account
While the account is suspended works
During a data stop works

Body

Field Type Description
clientId string Your own opaque ID for the consumer: 1 to 64 characters of letters, digits, _ and -. Never an email address or a phone number.
expiresInMinutes integer (optional) How long the token lasts. 15 when left out; at most 60.
{
  "clientId": "u_8f2k",
  "expiresInMinutes": 15
}

Answers

201: The token, and when it stops working

The answer is { data, meta }; meta holds requestId and environment.

data:

Field Type Description
token string Send it as the X-Client-Token header, with your publishable key.
expiresAt string Mint a new one before this.
{
  "data": {
    "token": "eyJ…",
    "expiresAt": "2026-11-02T12:15:00.000Z"
  },
  "meta": {
    "requestId": "req_7Hk2mT1xKp7Zc2Nf5Rb9Wd",
    "environment": "test"
  }
}

Errors

Every error has the same body, and says how to fix it (responses and errors).

More

Call it from your server. It mints a short-lived token that lets your website act for one consumer with your pk_ key.

Request:

{ "clientId": "u_8f2k", "expiresInMinutes": 15 }

Works while the account is suspended, so your consumers can still read and delete what they saved.

Response 201:

{ "data": { "token": "eyJ…", "expiresAt": "2026-11-02T12:15:00.000Z" }, "meta": { "requestId": "req_…", "environment": "test" } }

The browser then sends Authorization: Bearer pk_… and X-Client-Token: eyJ…. The token is bound to your account and environment; it is 401 client_token_account_mismatch with another account's pk_ key and 401 client_token_invalid across environments. Mint a new one when it expires (401 client_token_expired).

This page is made from the route's own declaration by npm run openapi. To change it, change the declaration or its explanation, never this file.

This page as Markdown