# Signing Keys

> System API reference, generated from the OpenAPI spec.

Signing keys are used to sign JSON Web Tokens (JWTs) for securing certain requests, such as secure playback URLs and access to real-time viewer counts in Mux Data. **One signing key can be used to sign multiple requests - you probably only need one active at a time.** However, you can create multiple signing keys to enable key rotation, creating a new key and deleting the old only after any existing signed requests have expired.

HTML version: https://www.mux.com/docs/api-reference/system/signing-keys. Full OpenAPI spec: https://www.mux.com/api-spec.json

Operations on this page:

- Create a signing key: `POST /system/v1/signing-keys`
- List signing keys: `GET /system/v1/signing-keys`
- Retrieve a signing key: `GET /system/v1/signing-keys/{SIGNING_KEY_ID}`
- Delete a signing key: `DELETE /system/v1/signing-keys/{SIGNING_KEY_ID}`

## Create a signing key

`POST https://api.mux.com/system/v1/signing-keys`

Creates a new signing key pair. When creating a new signing key, the API will generate a 2048-bit RSA key-pair and return the private key and a generated key-id; the public key will be stored at Mux to validate signed tokens.

Operation ID: `create-signing-key`. HTML version: https://www.mux.com/docs/api-reference/system/signing-keys/create-signing-key

### Response `201`

Created

- `data` (object, required)
  - `id` (string, required): Unique identifier for the Signing Key.
  - `created_at` (string, required, format: int64): Time at which the object was created. Measured in seconds since the Unix epoch.
  - `private_key` (string, format: byte): A Base64 encoded private key that can be used with the RS256 algorithm when creating a [JWT](https://jwt.io/). **Note that this value is only returned once when creating a URL signing key.**

## List signing keys

`GET https://api.mux.com/system/v1/signing-keys`

Returns a list of signing keys.

Operation ID: `list-signing-keys`. HTML version: https://www.mux.com/docs/api-reference/system/signing-keys/list-signing-keys

### Query parameters

- `limit` (integer, format: int32, default: 25): Number of items to include in the response
- `page` (integer, format: int32, default: 1): Offset by this many pages, of the size of `limit`

### Response `200`

OK

- `data` (array of object, required)
  - `id` (string, required): Unique identifier for the Signing Key.
  - `created_at` (string, required, format: int64): Time at which the object was created. Measured in seconds since the Unix epoch.
  - `private_key` (string, format: byte): A Base64 encoded private key that can be used with the RS256 algorithm when creating a [JWT](https://jwt.io/). **Note that this value is only returned once when creating a URL signing key.**

## Retrieve a signing key

`GET https://api.mux.com/system/v1/signing-keys/{SIGNING_KEY_ID}`

Retrieves the details of a signing key that has previously
been created. Supply the unique signing key ID that was returned from your
previous request, and Mux will return the corresponding signing key information.
**The private key is not returned in this response.**

Operation ID: `get-signing-key`. HTML version: https://www.mux.com/docs/api-reference/system/signing-keys/get-signing-key

### Path parameters

- `SIGNING_KEY_ID` (string, required): The ID of the signing key.

### Response `200`

OK

- `data` (object, required)
  - `id` (string, required): Unique identifier for the Signing Key.
  - `created_at` (string, required, format: int64): Time at which the object was created. Measured in seconds since the Unix epoch.
  - `private_key` (string, format: byte): A Base64 encoded private key that can be used with the RS256 algorithm when creating a [JWT](https://jwt.io/). **Note that this value is only returned once when creating a URL signing key.**

## Delete a signing key

`DELETE https://api.mux.com/system/v1/signing-keys/{SIGNING_KEY_ID}`

Deletes an existing signing key. Use with caution, as this will invalidate any existing signatures and no JWTs can be signed using the key again.

Operation ID: `delete-signing-key`. HTML version: https://www.mux.com/docs/api-reference/system/signing-keys/delete-signing-key

### Path parameters

- `SIGNING_KEY_ID` (string, required): The ID of the signing key.

### Response `204`

No Content
