Get token by customer ID
Users
Get Token by Customer ID
Generate an API token for an onboarded customer using their customer_salt (Customer ID).
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
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | string | Yes | The 12-digit customer identifier returned from the Onboard User endpoint. Also accepts customerid or customer_salt. |
name | string | No | A friendly name for the token. |
expiration_days | number | No | Number of days until the token expires. If omitted, the token does not expire. |
Notes
- The
customer_idmust belong to an active, non-blocked user. - The user must have at least one active workspace.
- If
expiration_daysis provided, it must be a positive integer. - Each call generates a new token — previous tokens are not revoked.
Success Response
Response Fields
| Field | Type | Description |
|---|---|---|
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 | number/null | Unix timestamp when the token expires, or null if no expiration. |
Error Responses
| Error | Description |
|---|---|
CUSTOMER_ID_NOT_FOUND | No active user found with the given customer ID. |
WORKSPACE_NOT_FOUND | The user does not have an active workspace. |
INVALID_EXPIRATION_DAYS | The expiration_days value is not a valid positive number. |
Example cURL
Headers
API token for authentication
Body
application/json
The 12-digit customer identifier returned from the /users/onboard endpoint. Also accepts 'customerid' or 'customer_salt'.
A friendly name for the token
Number of days until the token expires. If omitted, the token does not expire.
Required range:
x >= 1
