Create an API key

Create and add an API key to your organization.

Access requirements

The Authorization Bearer (Admin API Key authorizing the request) must have one of the following roles and scopes:

Admin API Key roles accepted

  • API_ALL_GRANTED
  • API_APIKEY

Admin API Key scopes accepted

  • GLOBAL
  • WORKSPACE*

To learn more about Admin API Key roles and scopes, see API keys overview.


JSON Payload

supported types

  • client_side or server_side for SDK usage
  • admin for Public API usage

scopes setup

  • workspace and single environment are required for client_side and server_side keys
  • null workspace and empty environments to setup an admin key with GLOBAL scope
  • valid workspace and empty environments to setup an admin key with WORKSPACE scope
  • valid workspace and 1..N environments to setup an admin key with ENVIRONMENT scope

roles

  • Supported only for admin keys. For the full list of allowed Admin API Key roles, see API keys overview.
{
  "name": "<api_key_name>",
  "apiKeyType": "<api_key_type>",
  "environments": [
    {
      "type": "environment",
      "id": "<environment_id>"
    }
  ],
  "workspace": {
    "type": "workspace",
    "id": "<workspace_id>"
  },
  "roles":[]
}
Language