---
title: "Generate WebRTC Token"
method: POST
path: "/webrtc/1/token"
tags: ["channels", "webrtc-calls", "webrtc", "webrtc-token"]
---

# Generate WebRTC Token

`POST /webrtc/1/token`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/webrtc/1/token`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `Authorization`
  - HTTP basic
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.infobip.com/auth/1/oauth2/token`

This endpoint allows you to generate token for WebRTC channel.

## Request body

- A012797e45a148c14a09b350fd3670874eb3f365931c630a0c2efc32c7293ff3TokenRequestModel
  - `identity` string, required: The identity used to present user on Infobip WebRTC platform. Must be unique. Must contain at least 3 and at most 64 unicode characters including -, _, ..
  - `displayName` string: Optional. A human-readable name for a given identity. Does not have to be unique. If set, it will be presented to all other users communicating with the identified user, along with identity. Must contain at least 5 and at most 50 characters.
  - `timeToLive` integer: Optional. This field represents a number of seconds until the token expires. If not set, the token will last 8 hours. The maximum value is 24 hours.

## Response `200`

Success

- A012797e45a148c14a09b350fd3670874eb3f365931c630a0c2efc32c7293ff3TokenResponseModel
  - `token` string: The access token used to connect client SDKs to Infobip WebRTC platform.
  - `expirationTime` string: Time point until which token is valid. The default value is 8h. If it expires, the user must be provided with the new valid token in order to continue using Infobip WebRTC platform. There is no notification about token expiry, you must track that by yourself.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
