Create an API key

Create and add an API key to your account.

🚧

Management of admin API keys will be moving

As a part of integrating with Harness,admin API keys will soon be created by general Harness systems. We recommend against creating any new integrations that manage admin API keys with this endpoint unless it is for a temporary purpose.

The server_side and client_side SDK API keys will continue to be managed using this endpoint.

For more information, please contact us at support@split.io and we will be happy to guide you to the best path forward.


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