---
title: "Create a playback token"
method: POST
path: "/playback_tokens"
tags: ["advanced_token_authentication"]
---

# Create a playback token

`POST /playback_tokens`

This operation creates a playback token for use with advanced token authentication.

You'll use the PATCH /videos/{id} endpoint to select **ADVANCED_TOKEN** authentication for your video after you have the  playback token. Then, you'll add the token into your player site along with the JS-embed for the video.

Before using the **ADVANCED_TOKEN** option as your token authentication for a video, you must do the following: 

  - Generate a playback token key that has a key id using the POST /playback_tokens/key in the Wowza Video API, then customize and generate a token via this endpoint in the Wowza Video 2.0 API to add to your site. You'll need the key id to create and sign the token.

## Request body

- GenerateTokenRequest
  - `key_id` string, required — The unique identifier for the id key returned when you used the POST /playback_tokens/keys endpoint to create a playback token key. This key will sign the token you create.
  - `exp` integer, required — The expiration time of the token which is the <a href="https://www.unixtimestamp.com/" target="_blank">unix timestamp</a> in seconds. If the current time is greater than the expiration time, the request will be considered invalid.
  - `nbf` integer — The time before which the token must not be accepted for processing which is the <a href="https://www.unixtimestamp.com/" target="_blank">unix timestamp</a> in seconds.
  - `iat` integer — The issue date of the token which is the <a href="https://www.unixtimestamp.com/" target="_blank">unix timestamp</a> in seconds.
  - `iss` string — The issuer of the token.
  - `sub` string — The subject of the token.
  - `aud` string — The audience of the token.
  - `cti` string — Uniquely identifies a token to help prevent reuse or replay attacks.
  - `catnip` CatnipClaim[] — The IP address of the network for which the token was issued. The array contains objects with tag and value. Each object represents a catnip claim. The max number of items allowed is 5 and the minimum is zero.
    - `tag` integer — The tag must be 52 (IPV4 address) or 54 (IPV6 address).
    - `value` unknown[] — A two-element array: 1. two-element array: - For IPv4, must be < 24. - For IPv6, must be < 56. 2. An object whose keys are byte-indices ("0", "1", ...) and values are the byte values. You must have a minimum of two items and can have a maximum of two items.
      - unknown
  - `catu` object — A map of URIs to which the token applies. The maximum number of items allowed is five. The object contains an array of key and value.
  - `catgeoiso3166` string[] — The ISO3166 country codes from which the token was issued. Optionally, followed by a hyphen and a region code. the maximum number allowed is five.
  - `catv` integer — The version of the token. The integer must be 1.

## Response `200`

Success

- GenerateTokenResponse
  - `token` string — The unique identifier for the playback token. Add this token to your site along with the JS-embed for the video to use advanced token authentication. You must also use PATCH /videos/{id} to select **ADVANCED_TOKEN** as your authentication type for the video after you create the playback token.

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `410` — Gone
- `422` — Unprocessable Entity

---

[API](https://skmtc.net/wowza/apis/wowza-video-rest-api-reference-documentation.md) · [All operations](https://skmtc.net/wowza/apis/wowza-video-rest-api-reference-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wowza/wowza-video-rest-api-reference-documentation/versions/157b6f741f2a/schema)
