Create and add an API key to your account.
Management ofadminAPI 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":[]
}
How to get a<workspace_id>after migration to HarnessAfter migration to Harness, you can get the
<workspace_id>for a project by using the Get Projects (Workspaces) endpoint with thenamequery parameter.You use the Harness project name (not the Harness project Id value) to retrieve the (Split) workspace ID.
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.
