curl --request POST \
--url https://www.tryunleashx.com/api/v1/global/users/gettokenbycustomerid \
--header 'Content-Type: application/json' \
--header 'token: <token>' \
--data '
{
"customer_id": "<string>",
"name": "<string>",
"expiration_days": 2
}
'{
"message": "<string>",
"customerid": "<string>",
"customer_api_key": "<string>",
"name": "<string>",
"expires": 123
}Generate an API token for an onboarded customer using their customer_salt (Customer ID).
curl --request POST \
--url https://www.tryunleashx.com/api/v1/global/users/gettokenbycustomerid \
--header 'Content-Type: application/json' \
--header 'token: <token>' \
--data '
{
"customer_id": "<string>",
"name": "<string>",
"expiration_days": 2
}
'{
"message": "<string>",
"customerid": "<string>",
"customer_api_key": "<string>",
"name": "<string>",
"expires": 123
}customer_salt (Customer ID).
/users/gettokenbycustomerid
Content-Type: application/json
Authentication: Required (API token)
{
"customer_id": "048372910564",
"name": "My API Token",
"expiration_days": 30
}
| 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. |
customer_id must belong to an active, non-blocked user.expiration_days is provided, it must be a positive integer.{
"message": "API token generated successfully",
"customerid": "048372910564",
"customer_api_key": "a1b2c3d4e5f6...generated_token_hex",
"name": "My API Token",
"expires": 1743033600
}
| 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 | 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. |
curl -X POST https://www.tryunleashx.com/api/v1/global/users/gettokenbycustomerid \
-H "Content-Type: application/json" \
-H "Authorization: <api_key>" \
-d '{
"customer_id": "048372910564",
"name": "My API Token",
"expiration_days": 30
}'
API token for authentication
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.
x >= 1Was this page helpful?