<SYSTEM>This is the OpenAPI specification for the Mux System API.</SYSTEM>

```json
{
  "openapi": "3.1.0",
  "x-group-parameters": true,
  "info": {
    "title": "Mux API",
    "description": "Mux is how developers build online video. This API encompasses functionality to help you perform administrative tasks within Mux.",
    "version": "v1",
    "contact": {
      "name": "Mux DevEx",
      "url": "https://docs.mux.com",
      "email": "devex@mux.com"
    }
  },
  "servers": [
    {
      "url": "https://api.mux.com",
      "description": "Mux Production API"
    }
  ],
  "security": [
    {
      "accessToken": []
    },
    {
      "authorizationToken": []
    }
  ],
  "tags": [
    {
      "name": "Signing Keys",
      "description": "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."
    },
    {
      "name": "Utilities",
      "description": "Collection of utility methods for using Mux APIs. There's only one thing in here right now, maybe there will be more later."
    }
  ],
  "paths": {
    "/system/v1/whoami": {
      "get": {
        "summary": "Retrieve information about your current access token.",
        "description": "Retrieve information about your current access token, including organization, environment, and permissions. Note that this can only be access with an access token, and _all_ access tokens can access this route, regardless of what permissions they have assigned.",
        "operationId": "get-whoami",
        "servers": [
          {
            "url": "https://api.mux.com"
          }
        ],
        "tags": [
          "Utilities"
        ],
        "responses": {
          "200": {
            "description": "Information retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhoAmIResponse"
                },
                "example": {
                  "data": {
                    "permissions": [
                      "video:read",
                      "data:read"
                    ],
                    "organization_name": "Mux",
                    "organization_id": "orgid123",
                    "environment_type": "development",
                    "environment_name": "Development",
                    "environment_id": "envid123",
                    "access_token_name": "Development access token"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnauthorizedResponse"
                },
                "example": {
                  "error": {
                    "type": "unauthorized",
                    "messages": [
                      "Unauthorized request"
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitedResponse"
                },
                "example": {
                  "errors": [
                    "Too many requests, retry later."
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/system/v1/signing-keys": {
      "post": {
        "tags": [
          "Signing Keys"
        ],
        "summary": "Create a signing key",
        "description": "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.",
        "operationId": "create-signing-key",
        "servers": [
          {
            "url": "https://api.mux.com"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningKeyResponse"
                },
                "example": {
                  "data": {
                    "private_key": "abcd123=",
                    "id": "vI5KTQ78ohYriuvWKHY6COtZWXexHGLllxksOdZuya8",
                    "created_at": "1610108345"
                  }
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Signing Keys"
        ],
        "summary": "List signing keys",
        "description": "Returns a list of signing keys.",
        "operationId": "list-signing-keys",
        "servers": [
          {
            "url": "https://api.mux.com"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/limit"
          },
          {
            "$ref": "#/components/parameters/page"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSigningKeysResponse"
                },
                "example": {
                  "data": [
                    {
                      "id": "vI5KTQ78ohYriuvWKHY6COtZWXexHGLllxksOdZuya8",
                      "created_at": "1610108345"
                    },
                    {
                      "id": "jc6lJiCLMjyC202EXtRQ644sShzDv6x5tWJrbvUFpvmo",
                      "created_at": "1608632647"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/system/v1/signing-keys/{SIGNING_KEY_ID}": {
      "get": {
        "tags": [
          "Signing Keys"
        ],
        "summary": "Retrieve a signing key",
        "description": "Retrieves the details of a signing key that has previously\nbeen created. Supply the unique signing key ID that was returned from your\nprevious request, and Mux will return the corresponding signing key information.\n**The private key is not returned in this response.**\n",
        "operationId": "get-signing-key",
        "servers": [
          {
            "url": "https://api.mux.com"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/signing_key_id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SigningKeyResponse"
                },
                "example": {
                  "data": {
                    "id": "jc6lJiCLMjyC202EXtRQ644sShzDv6x5tWJrbvUFpvmo",
                    "created_at": "1608632647"
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Signing Keys"
        ],
        "summary": "Delete a signing key",
        "description": "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.",
        "operationId": "delete-signing-key",
        "servers": [
          {
            "url": "https://api.mux.com"
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/signing_key_id"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "WhoAmIResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "permissions",
              "organization_name",
              "organization_id",
              "environment_type",
              "environment_name",
              "environment_id",
              "access_token_name"
            ],
            "properties": {
              "permissions": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "organization_name": {
                "type": "string"
              },
              "organization_id": {
                "type": "string"
              },
              "environment_type": {
                "type": "string"
              },
              "environment_name": {
                "type": "string"
              },
              "environment_id": {
                "type": "string"
              },
              "access_token_name": {
                "type": "string"
              }
            }
          }
        }
      },
      "UnauthorizedResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "type",
              "messages"
            ],
            "properties": {
              "type": {
                "type": "string",
                "description": "The type of the error"
              },
              "messages": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Friendly messages of errors encountered"
              }
            }
          }
        }
      },
      "RateLimitedResponse": {
        "type": "object",
        "required": [
          "errors"
        ],
        "properties": {
          "errors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Description of the error"
          }
        }
      },
      "SigningKeyResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "$ref": "#/components/schemas/SigningKey"
          }
        }
      },
      "SigningKey": {
        "type": "object",
        "required": [
          "id",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the Signing Key."
          },
          "created_at": {
            "type": "string",
            "format": "int64",
            "description": "Time at which the object was created. Measured in seconds since the Unix epoch."
          },
          "private_key": {
            "type": "string",
            "format": "byte",
            "description": "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.**"
          }
        }
      },
      "ListSigningKeysResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SigningKey"
            }
          }
        }
      }
    },
    "parameters": {
      "limit": {
        "name": "limit",
        "in": "query",
        "description": "Number of items to include in the response",
        "required": false,
        "schema": {
          "type": "integer",
          "format": "int32",
          "default": 25
        }
      },
      "page": {
        "name": "page",
        "in": "query",
        "description": "Offset by this many pages, of the size of `limit`",
        "required": false,
        "schema": {
          "type": "integer",
          "format": "int32",
          "default": 1
        }
      },
      "signing_key_id": {
        "name": "SIGNING_KEY_ID",
        "in": "path",
        "description": "The ID of the signing key.",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    }
  }
}```

