Skip to content
Search Documentation
Search across all documentation pages
Playback Signing Keys

The Playback Signing Key object

A playback signing key is the secret that signs playback tokens: short-lived tokens that let one viewer watch one video in the hosted player, including a private video. With a key, your server signs tokens itself, with no network call. Without one, Create a playback token signs them for you.

Keys belong to one app, and a token plays only that app’s videos. An app can have at most 5 keys that have not expired.

Important: The secret is returned only when a key is created or rotated. It cannot be retrieved again. Store it on your server, never in a browser, a mobile app or a public repository: anyone holding it can make tokens for every video of the app.

Base path: transcodely.v1.PlaybackSigningKeyService Requires: an app-scoped API key (ak_), or the X-Organization-ID header for dashboard sessions. In the dashboard, creating, rotating and deleting keys needs the owner or admin role; every member can list them.


Attributes

AttributeTypeDescription
idstringUnique identifier. Prefixed with psk_. Goes in the token header’s kid.
objectstringAlways playback_signing_key.
app_idstringThe app the key belongs to. Tokens it signs play only this app’s videos.
namestringHuman-readable name. May be empty.
secret_hintstringThe last four characters of the secret, to tell keys apart.
statusstringactive (no expiry), expiring (after a rotation, until expires_at) or expired (tokens it signed no longer open the player).
created_atstringISO 8601 timestamp.
expires_atstringISO 8601 timestamp of when the key stops verifying tokens. Omitted from the object while the key is active.
last_rotated_atstringISO 8601 timestamp of when the key was rotated. Omitted if it never was.
rotated_fromstringThe id of the key this one replaced, when it was created by a rotation. Omitted otherwise.
{
  "id": "psk_a1b2c3d4e5f6g7",
  "object": "playback_signing_key",
  "app_id": "app_k1l2m3n4o5",
  "name": "Course site",
  "secret_hint": "x7Qk",
  "status": "active",
  "created_at": "2026-12-01T09:00:00Z"
}

Create a playback signing key

Creates a key for an app. The secret (pss_ followed by 43 characters) is returned only in this response.

POST /transcodely.v1.PlaybackSigningKeyService/Create

Parameters

ParameterTypeRequiredDescription
namestringNoA name for the key, up to 100 characters.
app_idstringNoThe app to create the key for. API-key callers may omit it: their key’s app is used.

Returns

The new key in key, with status active, and its secret.

A sixth key that has not expired is refused with failed_precondition and error code playback_signing_key_limit_reached. Keys that are active or expiring both count. Delete a key you no longer need to free a slot, or wait for an expiring one to expire; rotating does not free one, because it replaces a key with a new key.

curl -X POST https://api.transcodely.com/transcodely.v1.PlaybackSigningKeyService/Create 
  -H "Authorization: Bearer {{API_KEY}}" 
  -H "Content-Type: application/json" 
  -d '{"name": "Course site"}'
const created = await client.playbackSigningKeys.create({ name: "Course site" });
// created.secret is returned only here. Store it now.
console.log(created.key?.id, created.secret);
created = client.playback_signing_keys.create(name="Course site")
# created.secret is returned only here. Store it now.
print(created.key.id, created.secret)
created, err := client.PlaybackSigningKeys.Create(ctx, &transcodely.PlaybackSigningKeyCreateParams{
	Name: proto.String("Course site"),
})
// created.GetSecret() is returned only here. Store it now.
fmt.Println(created.GetKey().GetId(), created.GetSecret())
{
  "key": {
    "id": "psk_a1b2c3d4e5f6g7",
    "object": "playback_signing_key",
    "app_id": "app_k1l2m3n4o5",
    "name": "Course site",
    "secret_hint": "x7Qk",
    "status": "active",
    "created_at": "2026-12-01T09:00:00Z"
  },
  "secret": "pss_…"
}

List playback signing keys

Lists an app’s keys, newest first, expired ones included: at most 100, on one page. Secrets are never returned.

POST /transcodely.v1.PlaybackSigningKeyService/List

Parameters

ParameterTypeRequiredDescription
app_idstringNoThe app whose keys to list. API-key callers may omit it: their key’s app is used.

Returns

The keys in keys.

curl -X POST https://api.transcodely.com/transcodely.v1.PlaybackSigningKeyService/List 
  -H "Authorization: Bearer {{API_KEY}}" 
  -H "Content-Type: application/json" 
  -d '{}'
for await (const key of client.playbackSigningKeys.list().autoPage()) {
  console.log(key.id, key.status, key.secretHint);
}
for key in client.playback_signing_keys.list().auto_paging_iter():
    print(key.id, key.status, key.secret_hint)
iter := client.PlaybackSigningKeys.List(ctx, nil)
for iter.Next() {
	key := iter.Current()
	fmt.Println(key.GetId(), key.GetStatus(), key.GetSecretHint())
}
if err := iter.Err(); err != nil {
	log.Fatal(err)
}
{
  "keys": [
    {
      "id": "psk_a1b2c3d4e5f6g7",
      "object": "playback_signing_key",
      "app_id": "app_k1l2m3n4o5",
      "name": "Course site",
      "secret_hint": "x7Qk",
      "status": "active",
      "created_at": "2026-12-01T09:00:00Z"
    }
  ]
}

Rotate a playback signing key

Creates a new key, with a new id and a new secret, and makes the old key expire after an overlap you choose. During the overlap, tokens signed with either key open the player, so your servers can switch over without interrupting viewers. Store both the new id and the new secret: the id goes in every token’s header.

Rotating with expire_previous_in: 0 is how issued tokens are revoked: from that moment no token the old key signed opens the player. There is no per-token revocation. Revocation is checked when a player page loads; a page that is already open keeps playing until its stream URLs expire, at the token’s expiry or 6 hours after that page loaded, whichever comes first.

POST /transcodely.v1.PlaybackSigningKeyService/Rotate

Parameters

ParameterTypeRequiredDescription
idstringYesThe key to rotate (psk_ prefix).
expire_previous_inintegerNoSeconds the old key keeps verifying tokens, 0 to 604800 (7 days). Default 86400 (24 hours). 0 stops it immediately.
namestringNoName for the new key, up to 100 characters. Defaults to the old key’s name.

Returns

The new key in key, its secret (returned only here), and the old key in previous, now expiring (or expired with expire_previous_in: 0).

The key being rotated does not count against the 5-key limit for its own replacement. A key that was already rotated is refused with failed_precondition and error code playback_signing_key_already_rotated: rotate its replacement. A key that has expired is refused with failed_precondition and error code playback_signing_key_expired: create a new key instead.

curl -X POST https://api.transcodely.com/transcodely.v1.PlaybackSigningKeyService/Rotate 
  -H "Authorization: Bearer {{API_KEY}}" 
  -H "Content-Type: application/json" 
  -d '{"id": "psk_a1b2c3d4e5f6g7", "expire_previous_in": 86400}'
const rotated = await client.playbackSigningKeys.rotate({
  id: "psk_a1b2c3d4e5f6g7",
  expirePreviousIn: 86400,
});
// rotated.key is the new key, rotated.secret its secret, rotated.previous the old key.
rotated = client.playback_signing_keys.rotate(
    "psk_a1b2c3d4e5f6g7",
    expire_previous_in=86400,
)
# rotated.key is the new key, rotated.secret its secret, rotated.previous the old key.
rotated, err := client.PlaybackSigningKeys.Rotate(ctx, &transcodely.PlaybackSigningKeyRotateParams{
	Id:               "psk_a1b2c3d4e5f6g7",
	ExpirePreviousIn: proto.Int32(86400),
})
// rotated.GetKey() is the new key, rotated.GetSecret() its secret, rotated.GetPrevious() the old key.
{
  "key": {
    "id": "psk_h8i9j0k1l2m3n4",
    "object": "playback_signing_key",
    "app_id": "app_k1l2m3n4o5",
    "name": "Course site",
    "secret_hint": "m2Zp",
    "status": "active",
    "created_at": "2026-12-08T09:00:00Z",
    "rotated_from": "psk_a1b2c3d4e5f6g7"
  },
  "secret": "pss_…",
  "previous": {
    "id": "psk_a1b2c3d4e5f6g7",
    "object": "playback_signing_key",
    "app_id": "app_k1l2m3n4o5",
    "name": "Course site",
    "secret_hint": "x7Qk",
    "status": "expiring",
    "created_at": "2026-12-01T09:00:00Z",
    "expires_at": "2026-12-09T09:00:00Z",
    "last_rotated_at": "2026-12-08T09:00:00Z"
  }
}

Delete a playback signing key

Expires a key now: every token it signed stops opening the player. A page that is already open keeps playing until its stream URLs expire, at the token’s expiry or 6 hours after that page loaded, whichever comes first. The key stays listed with status expired.

POST /transcodely.v1.PlaybackSigningKeyService/Delete

Parameters

ParameterTypeRequiredDescription
idstringYesThe key to delete (psk_ prefix).

Returns

The key in key, now expired.

curl -X POST https://api.transcodely.com/transcodely.v1.PlaybackSigningKeyService/Delete 
  -H "Authorization: Bearer {{API_KEY}}" 
  -H "Content-Type: application/json" 
  -d '{"id": "psk_a1b2c3d4e5f6g7"}'
const key = await client.playbackSigningKeys.delete("psk_a1b2c3d4e5f6g7");
key = client.playback_signing_keys.delete("psk_a1b2c3d4e5f6g7")
key, err := client.PlaybackSigningKeys.Delete(ctx, "psk_a1b2c3d4e5f6g7")
{
  "key": {
    "id": "psk_a1b2c3d4e5f6g7",
    "object": "playback_signing_key",
    "app_id": "app_k1l2m3n4o5",
    "name": "Course site",
    "secret_hint": "x7Qk",
    "status": "expired",
    "created_at": "2026-12-01T09:00:00Z",
    "expires_at": "2026-12-08T09:00:00Z"
  }
}

Errors

Connect codeError codeCause
not_foundplayback_signing_key_not_foundThe psk_ does not exist or belongs to another app.
failed_preconditionplayback_signing_key_limit_reachedThe app already has 5 keys that have not expired.
failed_preconditionplayback_signing_key_already_rotatedThe key was rotated before and has a replacement. Rotate the replacement.
failed_preconditionplayback_signing_key_expiredThe key has expired and can no longer be rotated. Create a new key.
permission_deniedA dashboard session without the owner or admin role tried to create, rotate or delete a key.

Run this against your own file

A free account runs standard-quality encodes up to 2 minutes, one at a time (a longer upload is shortened to its first 2 minutes), so the Quickstart runs with nothing set up but an API key.