Create and add an API key to your account.
Management of
adminAPI keys will be movingAs a part of integrating with Harness,
adminAPI keys will soon be created by general Harness systems. We recommend against creating any new integrations that manageadminAPI keys with this endpoint unless it is for a temporary purpose.The
server_sideandclient_sideSDK 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_sideorserver_sidefor SDK usageadminfor Public API usage
scopes setup
workspaceand singleenvironmentare required forclient_sideandserver_sidekeys- null
workspaceand emptyenvironmentsto setup anadminkey withGLOBALscope - valid
workspaceand emptyenvironmentsto setup anadminkey withWORKSPACEscope - valid
workspaceand 1..Nenvironmentsto setup anadminkey withENVIRONMENTscope
roles
- Supported only for
adminkeys. 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":[]
}
