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>"
}
'import requests
url = "https://app.autocalls.ai/api/white-label/token"
payload = {
"user_id": 123,
"email": "<string>",
"token_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 123, email: '<string>', token_name: '<string>'})
};
fetch('https://app.autocalls.ai/api/white-label/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.autocalls.ai/api/white-label/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 123,
'email' => '<string>',
'token_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.autocalls.ai/api/white-label/token"
payload := strings.NewReader("{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.autocalls.ai/api/white-label/token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.autocalls.ai/api/white-label/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Token created successfully.",
"user": {
"id": 123,
"name": "John Doe",
"email": "[email protected]"
},
"token": "2|abc123xyz789...",
"token_name": "api-token"
}
{
"error": "User not found."
}
{
"error": "You are not an administrator."
}
{
"message": "The user id field is required when email is not present. (and 1 more error)",
"errors": {
"user_id": ["The user id field is required when email is not present."],
"email": ["The email field is required when user id is not present."]
}
}
White Label
Create user token
Generate an API token for a platform user without requiring their password
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>"
}
'import requests
url = "https://app.autocalls.ai/api/white-label/token"
payload = {
"user_id": 123,
"email": "<string>",
"token_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user_id: 123, email: '<string>', token_name: '<string>'})
};
fetch('https://app.autocalls.ai/api/white-label/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.autocalls.ai/api/white-label/token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => 123,
'email' => '<string>',
'token_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.autocalls.ai/api/white-label/token"
payload := strings.NewReader("{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_name\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.autocalls.ai/api/white-label/token")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.autocalls.ai/api/white-label/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_id\": 123,\n \"email\": \"<string>\",\n \"token_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Token created successfully.",
"user": {
"id": 123,
"name": "John Doe",
"email": "[email protected]"
},
"token": "2|abc123xyz789...",
"token_name": "api-token"
}
{
"error": "User not found."
}
{
"error": "You are not an administrator."
}
{
"message": "The user id field is required when email is not present. (and 1 more error)",
"errors": {
"user_id": ["The user id field is required when email is not present."],
"email": ["The email field is required when user id is not present."]
}
}
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.
Or by email:
This endpoint requires authentication as a white label admin. Only users belonging to your platform can have tokens generated.
Request Body
integer
The platform user’s ID. Required if
email is not provided.string
The platform user’s email address. Required if
user_id is not provided.string
Optional name/label for the API token (e.g., “kpi-dashboard”, “email-automation”). Defaults to “api-token”.
Response
string
Success message
object
string
The API token for the platform user
string
The name/label of the token
{
"message": "Token created successfully.",
"user": {
"id": 123,
"name": "John Doe",
"email": "[email protected]"
},
"token": "2|abc123xyz789...",
"token_name": "api-token"
}
{
"error": "User not found."
}
{
"error": "You are not an administrator."
}
{
"message": "The user id field is required when email is not present. (and 1 more error)",
"errors": {
"user_id": ["The user id field is required when email is not present."],
"email": ["The email field is required when user id is not present."]
}
}
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
}'
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": "[email protected]",
"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:- List your users —
GET /api/white-label/userswith your admin key - Generate a token for each user —
POST /api/white-label/tokenwith theiruser_id - Fetch each user’s data using their token:
GET /api/user/calls— call history with duration, status, costGET /api/user/campaigns— campaign statusesGET /api/user/leads— leads with statusesGET /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.

