---
title: "Create a widget token"
method: POST
path: "/v2/webrtc/tokens"
tags: ["Wavix Embeddable"]
---

# Create a widget token

`POST /v2/webrtc/tokens`

## Request

- Base URL: `https://api.wavix.com`
- URL: `https://api.wavix.com/v2/webrtc/tokens`
- Auth: HTTP bearer

Creates a Wavix Embeddable widget token that authenticates a browser-based softphone session. The token expires after `ttl` seconds.

## Request body

- WebRTCTokenCreateRequest
  - `sip_trunk` string, required: Name of the SIP trunk the token authenticates against.
  - `payload` object, nullable: Arbitrary client-defined data to associate with the token.
  - `ttl` integer, nullable: Time to live in seconds. Default `3600`; `null` means no expiration.

## Response `201`

Returns the created widget token.

- WebRTCTokenResponse
  - `token` string, required: Signed JWT used by the Wavix embeddable widget to authenticate.
  - `uuid` string, required: Unique identifier of the WebRTC token.
  - `sip_trunk` string, required: Name of the SIP trunk the token authenticates against.
  - `payload` object, nullable: Arbitrary client-defined data associated with the token.
  - `ttl` integer, nullable: Lifetime of the token, in seconds. `null` means the token does not expire.

## Other responses

- `400`: Request failed. Missing or invalid parameter <param_name>
- `401`: Unauthorized
- `403`: Request failed. The feature is disabled for your account.
- `404`: Request failed. An object with the specified ID is not found.

## Changes

- **2026-09-08** `6a89c962481c`: 2 info
  - the request property `ttl` became optional
  - the `ttl` request property default value `3600` was added
- **2026-06-15** `76b9bb35619f`: 1 info
  - added the optional property `error` to the response with the `401` status
- **2026-05-25** `33be77905120`: 1 info
  - the endpoint scheme security `bearerAuth` was added to the API
- **2026-05-08** `ce71f60fb356`: 1 breaking, 1 warning
  - the request property `ttl` became required
  - the `ttl` request property's min was set to `1.00`
- **2026-04-20** `2e48fd9894e1`: 2 breaking, 1 info
  - the request property `payload` became not nullable
  - the request property `ttl` became not nullable
  - api operation id `GenerateWidgetToken` removed and replaced with `webrtc_tokens_create`

[Operation history](https://skmtc.dev/wavix/apis/wavix-apis/changes/v2/webrtc/tokens/post.md)

---

[API](https://skmtc.dev/wavix/apis/wavix-apis.md) - [All operations](https://skmtc.dev/wavix/apis/wavix-apis/llms.txt) - [OpenAPI document](https://skmtc.dev/wavix/apis/wavix-apis/revisions/f2dde79f05ab?raw)
