Skip to main content
POST
/
white-label
/
token
Create user token
curl --request POST \
  --url https://app.autocalls.ai/api/white-label/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": 123,
  "email": "<string>",
  "token_name": "<string>"
}
'
{
  "message": "Token created successfully.",
  "user": {
    "id": 123,
    "name": "John Doe",
    "email": "john@example.com"
  },
  "token": "2|abc123xyz789...",
  "token_name": "api-token"
}
This endpoint allows white label admins to generate an API token for any of their platform users without needing the user’s password. Use this to programmatically access user data for building dashboards, email sequences, or automated workflows.
This endpoint requires authentication as a white label admin. Only users belonging to your platform can have tokens generated.

Request Body

user_id
integer
The platform user’s ID. Required if email is not provided.
email
string
The platform user’s email address. Required if user_id is not provided.
token_name
string
Optional name/label for the API token (e.g., “kpi-dashboard”, “email-automation”). Defaults to “api-token”.

Response

message
string
Success message
user
object
The user’s information
token
string
The API token for the platform user
token_name
string
The name/label of the token
{
  "message": "Token created successfully.",
  "user": {
    "id": 123,
    "name": "John Doe",
    "email": "john@example.com"
  },
  "token": "2|abc123xyz789...",
  "token_name": "api-token"
}

Example Request

curl -X POST https://app.autocalls.ai/api/white-label/token \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": 123
  }'
Or by email:
curl -X POST https://app.autocalls.ai/api/white-label/token \
  -H "Authorization: Bearer YOUR_ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "platformuser@example.com",
    "token_name": "kpi-dashboard"
  }'

Using the User Token

The returned token belongs to the platform user and can be used for their authenticated requests:
curl -X GET https://app.autocalls.ai/api/user/calls?date_from=2026-03-01&per_page=100 \
  -H "Authorization: Bearer 2|abc123xyz789..."

Building a KPI Dashboard

To build a dashboard with all your users’ data:
  1. List your usersGET /api/white-label/users with your admin key
  2. Generate a token for each userPOST /api/white-label/token with their user_id
  3. Fetch each user’s data using their token:
    • GET /api/user/calls — call history with duration, status, cost
    • GET /api/user/campaigns — campaign statuses
    • GET /api/user/leads — leads with statuses
    • GET /api/user/me — profile and balance info
Tokens never expire, so you only need to generate them once per user. Store the tokens and reuse them for subsequent API calls.