API Keys
APIs to create and manage Feature Flag SDK API Keys
Returns all the API Keys for an Environment
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}The Project identifier
Environment Identifier
PageNumber
PageSize
OK
The total number of items
1The total number of pages
100The current page
0The number of items per page
1The version of this object. The version will be incremented each time the object is modified
5Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/apikey?accountIdentifier=text&orgIdentifier=text&projectIdentifier=text&environmentIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"itemCount": 1,
"pageCount": 100,
"pageIndex": 0,
"pageSize": 1,
"version": 5,
"apiKeys": [
{
"apiKey": "b03af1cd-bd3f-472b-a4b0-c9c9c09c642e",
"applicationIds": [
{
"applicationId": "my-springboot-application",
"lastUsed": 1726744149
}
],
"identifier": "production",
"key": "3c940273c34e8a9b21",
"lastUsed": 1726744149,
"name": "Production Server Key",
"type": "server"
}
]
}Creates an API key for the given Environment
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}Environment Identifier
The Project identifier
This key is for server side production environmentproduction-environmentproduction-env-keyThe type of key depending on the SDK that is being used.
ServerPossible values: Created
The API key is used by SDKs to connect to Harness Feature Flags
The Key will be shown only on create. On subsequent GET calls, only the masked APIKeys will be returned
b03af1cd-bd3f-472b-a4b0-c9c9c09c642eThe environment that this key was created in
productionA hash of API key
3c940273c34e8a9b21Timestamp of the last time the API key was used
1726744149The user friendly identifier for the API Key
Production Server KeyThe type of key depending on the SDK that is being used.
serverPossible values: Bad request
Unauthenticated
Unauthorized
The specified resource already exists
Internal server error
POST /gateway/cf/admin/apikey?accountIdentifier=text&orgIdentifier=text&environmentIdentifier=text&projectIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 164
{
"description": "This key is for server side production environment",
"expiredAt": 1,
"identifier": "production-environment",
"name": "production-env-key",
"type": "Server"
}{
"apiKey": "b03af1cd-bd3f-472b-a4b0-c9c9c09c642e",
"applicationIds": [
{
"applicationId": "my-springboot-application",
"lastUsed": 1726744149
}
],
"identifier": "production",
"key": "3c940273c34e8a9b21",
"lastUsed": 1726744149,
"name": "Production Server Key",
"type": "server"
}Returns all the API Keys for the given identifier
Unique identifier for the object in the API.
The Project identifier
Environment Identifier
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}Created
The API key is used by SDKs to connect to Harness Feature Flags
The Key will be shown only on create. On subsequent GET calls, only the masked APIKeys will be returned
b03af1cd-bd3f-472b-a4b0-c9c9c09c642eThe environment that this key was created in
productionA hash of API key
3c940273c34e8a9b21Timestamp of the last time the API key was used
1726744149The user friendly identifier for the API Key
Production Server KeyThe type of key depending on the SDK that is being used.
serverPossible values: Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
GET /gateway/cf/admin/apikey/{identifier}?projectIdentifier=text&environmentIdentifier=text&accountIdentifier=text&orgIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"apiKey": "b03af1cd-bd3f-472b-a4b0-c9c9c09c642e",
"applicationIds": [
{
"applicationId": "my-springboot-application",
"lastUsed": 1726744149
}
],
"identifier": "production",
"key": "3c940273c34e8a9b21",
"lastUsed": 1726744149,
"name": "Production Server Key",
"type": "server"
}Updates an API key for the given identifier
Unique identifier for the object in the API.
The Project identifier
Environment Identifier
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}This key is for server side production environmentproduction-env-keyUpdated
No content
Bad request
Unauthenticated
Unauthorized
The specified resource already exists
Internal server error
PUT /gateway/cf/admin/apikey/{identifier}?projectIdentifier=text&environmentIdentifier=text&accountIdentifier=text&orgIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 110
{
"description": "This key is for server side production environment",
"expiredAt": 1,
"name": "production-env-key"
}No content
Deletes an API key for the given identifier
Unique identifier for the object in the API.
The Project identifier
Environment Identifier
Account Identifier
{"value":"default"}Organization Identifier
{"value":"default_org"}No content
No content
Unauthenticated
Unauthorized
The specified resource was not found
Internal server error
DELETE /gateway/cf/admin/apikey/{identifier}?projectIdentifier=text&environmentIdentifier=text&accountIdentifier=text&orgIdentifier=text HTTP/1.1
Host: app.harness.io
x-api-key: YOUR_API_KEY
Accept: */*
No content
Last updated
Was this helpful?