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

# Create a widget token

`POST /v2/webrtc/tokens`

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, required — Time to live in seconds. Pass `null` for 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.

---

[API](https://skmtc.net/wavix/apis/wavix-apis.md) · [All operations](https://skmtc.net/wavix/apis/wavix-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wavix/wavix-apis/revisions/b22f170488b6/schema)
