Create an API key

Create and add an API key to your account.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
🚧

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, go to Before and After Guide: API for Split Admins. You can also contact us at [email protected] 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":[]
}
👍

How to get a workspace ID after migration to Harness

After migration to Harness, you can retrieve the workspace ID for a project by calling the Get Projects (Workspaces) endpoint and filtering results by organizationIdentifier and projectIdentifier.

Alternatively, filter by name using the Harness project name, not the Harness project ID. Your Split legacy API key will continue to work for this endpoint.

For detailed instructions, see the Retrieving a Workspace ID Using the Harness Project Name section in the Before and After: APIs for Split Admins Postman collection.

Form Data
json

Request payload

Headers
string
Defaults to Bearer ADMIN_API_KEY

The Admin API key authorizing the request

Responses

Language
LoadingLoading…
Response
Choose an example:
application/json