Skip to main content
POST
Get token by customer ID
Use this endpoint to generate an API token for an onboarded customer using their customer_salt (Customer ID).

Endpoint

POST /users/gettokenbycustomerid Content-Type: application/json Authentication: Required (API token)

Request Body

Parameters

Notes

  • The customer_id must belong to an active, non-blocked user.
  • The user must have at least one active workspace.
  • If expiration_days is provided, it must be a positive integer.
  • Each call generates a new token — previous tokens are not revoked.

Success Response

Response Fields

Error Responses

Example cURL

Headers

token
string
required

API token for authentication

Body

application/json
customer_id
string
required

The 12-digit customer identifier returned from the /users/onboard endpoint. Also accepts 'customerid' or 'customer_salt'.

name
string

A friendly name for the token

expiration_days
integer

Number of days until the token expires. If omitted, the token does not expire.

Required range: x >= 1

Response

API token generated successfully

message
string
customerid
string

The customer identifier used in the request

customer_api_key
string

The newly generated API token

name
string | null

The token name, if provided

expires
integer | null

Unix timestamp when the token expires, or null if no expiration