Skip to content

Create a client token

POST
/v1/Accounts/{auth_id}/ClientToken
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/example/ClientToken \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "name": "web-softphone" }'

Issues a client token for an SDK or WebRTC client of account {auth_id} and returns it with its value; this is the only reply that carries the value. The token is recorded with an expiry 7 days after creation. The value is a signed JWT from the platform’s identity provider, valid until its own exp claim, which can come before expires_at.

name must be unique among the account’s unexpired tokens (400); an expired token with the same name is replaced. name is not otherwise validated. Errors: 400 for a body that is not JSON, a name in use, the identity provider not issuing a token, or a failed save; 500 when existing tokens or the account cannot be read.

{auth_id} must be the authenticated account or one of its direct sub-accounts; any other account gets 403.

auth_id
required
string

Your Auth ID, or a direct sub-account’s.

The token’s name.

Media type application/json
object
name

A name for the token, unique among the account’s unexpired tokens.

string

Example

web-softphone

The new token, with its value.

Media type application/json
object
auth_id

Auth ID of the account the token belongs to.

string
created_at

When the token was created (RFC 3339).

string
expires_at

Recorded expiry, 7 days after creation (RFC 3339).

string
id

Token id (UUID); pass it to deleteClientToken.

string
name

The name given when the token was created.

string
token

The bearer token (a signed JWT). Returned only when the token is created; lists leave it out.

string

Example

{
"auth_id": "AC000000000000000001",
"created_at": "2026-11-26T09:30:00Z",
"expires_at": "2026-12-03T09:30:00Z",
"id": "5b1f0c2a-3d4e-4f60-8a9b-0c1d2e3f4a5b",
"name": "web-softphone",
"token": "eyJhbGciOiJSUzI1NiJ9.EXAMPLE.SIGNATURE"
}

The body is not JSON, the name is in use, or the token could not be issued or saved.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}

Authentication failed: wrong or missing credentials, a disabled account, or an {auth_id} that is neither you nor your direct sub-account.

Media type application/json
string

Example generated

example

{auth_id} is neither the authenticated account nor its direct sub-account.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}

Existing tokens or the account could not be read.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}