# Create a playback token 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. Endpoint: POST /playback_tokens Version: v2.0 ## Request fields (application/json): - `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. Example: "51cd5c07-1583-4f5e-bd81-f1aa11510ea9" - `exp` (integer, required) The expiration time of the token which is the unix timestamp in seconds. If the current time is greater than the expiration time, the request will be considered invalid. Example: 1679816499 - `nbf` (integer) The time before which the token must not be accepted for processing which is the unix timestamp in seconds. Example: 1679816499 - `iat` (integer) The issue date of the token which is the unix timestamp in seconds. Example: 1679816499 - `iss` (string) The issuer of the token. Example: "my-issuer" - `sub` (string) The subject of the token. Example: "subscriber1234" - `aud` (string) The audience of the token. Example: "my-audience" - `cti` (string) Uniquely identifies a token to help prevent reuse or replay attacks. Example: "unique-token-id" - `catnip` (array) 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. - `catnip.tag` (integer) The tag must be 52 (IPV4 address) or 54 (IPV6 address). Example: 52 - `catnip.value` (array) 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. Example: [24,{"0":188,"1":4,"2":23}] - `catnip.value.[0]` (integer) The IP-prefix length. Example: 24 - `catnip.value.[1]` (object) Byte-map of the IP-prefix. Example: {"0":188,"1":4,"2":23} - `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` (array) 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. Example: [["US","CA-ON"]] - `catv` (integer) The version of the token. The integer must be 1. Example: 1 ## Response 200 fields (application/json): - `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. ## Response 401 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 403 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 404 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 410 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array) ## Response 422 fields (application/json): - `meta` (object, required) - `meta.status` (integer) - `meta.code` (string) - `meta.title` (string) - `meta.message` (string) - `meta.description` (string) - `meta.links` (array)