Create a client token
const url = 'https://api.siprtc.io/v1/Accounts/example/ClientToken';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"name":"web-softphone"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your Auth ID, or a direct sub-account’s.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The token’s name.
object
A name for the token, unique among the account’s unexpired tokens.
Example
web-softphoneResponses
Section titled “ Responses ”The new token, with its value.
object
Auth ID of the account the token belongs to.
When the token was created (RFC 3339).
Recorded expiry, 7 days after creation (RFC 3339).
Token id (UUID); pass it to deleteClientToken.
The name given when the token was created.
The bearer token (a signed JWT). Returned only when the token is created; lists leave it out.
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.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
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.
Example generated
example{auth_id} is neither the authenticated account nor its direct sub-account.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
Example
{ "error": "sql: connection is already closed", "message": "Account Details not found", "status": "failed"}Existing tokens or the account could not be read.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
Example
{ "error": "sql: connection is already closed", "message": "Account Details not found", "status": "failed"}