Skip to content

Mint SDK Token

POST /api/sdk/token

Create a single-use token for one of your call-center agents. Call this from your backend (see the embed guide). The browser talks only to your site; your server talks to us.

Requires a Bearer API token (from Authentication / dashboard API Tokens) and the call-center permission.

Return this JSON to the browser unchanged. The widget uses it to connect. Do not store or reuse the token.

Parameter Type Required Description
agent_id integer Yes Numeric id of a call-center agent that belongs to your account. The agent must be active and approved. Get ids from List Agents.
Terminal window
curl -X POST https://api.awajdigital.com/api/sdk/token \
-H "Authorization: Bearer your_api_token_here" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"agent_id": 42
}'
{
"token": "avt_…",
"expires_in": 300,
"expires_at": "2026-09-06T12:05:00.000+06:00",
"session_url": "https://api.awajdigital.com/api/sdk/session"
}
Field Type Description
token string Single-use token. Your page should not request this itself — proxy this endpoint and let the SDK call your proxy via tokenUrl.
expires_in integer Lifetime in seconds.
expires_at string ISO 8601 expiry.
session_url string URL the widget uses to start the call session. Forward this JSON as-is.
Status Code Description
401 — Missing or invalid access token
403 — Account does not have the call-center permission
403 agent_inactive Agent exists but is not active
403 agent_not_approved Agent exists but is not approved
404 agent_not_found Agent does not exist or belongs to another account
422 — Validation failed (agent_id missing or not a positive integer)
429 — Too many requests
{
"error": "agent not found",
"code": "agent_not_found"
}