For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Keys

APIs to create and manage Feature Flag SDK API Keys

Returns API Keys for an Environment

get

Returns all the API Keys for an Environment

Authorizations
x-api-keystringRequired
Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

pageNumberintegerOptional

PageNumber

pageSizeintegerOptional

PageSize

Responses
200

OK

application/json
itemCountintegerRequired

The total number of items

Example: 1
pageCountintegerRequired

The total number of pages

Example: 100
pageIndexintegerRequired

The current page

Example: 0
pageSizeintegerRequired

The number of items per page

Example: 1
versionintegerOptional

The version of this object. The version will be incremented each time the object is modified

Example: 5
get/admin/apikey
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

post

Creates an API key for the given Environment

Authorizations
x-api-keystringRequired
Query parameters
accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
environmentIdentifierstringRequired

Environment Identifier

projectIdentifierstringRequired

The Project identifier

Body
descriptionstringOptionalExample: This key is for server side production environment
expiredAtintegerOptional
identifierstringRequiredExample: production-environment
namestringRequiredExample: production-env-key
typestring · enumRequired

The type of key depending on the SDK that is being used.

Example: ServerPossible values:
Responses
201

Created

application/json

The API key is used by SDKs to connect to Harness Feature Flags

apiKeystringRequired

The Key will be shown only on create. On subsequent GET calls, only the masked APIKeys will be returned

Example: b03af1cd-bd3f-472b-a4b0-c9c9c09c642e
identifierstringRequired

The environment that this key was created in

Example: production
keystringOptional

A hash of API key

Example: 3c940273c34e8a9b21
lastUsedinteger · int64Optional

Timestamp of the last time the API key was used

Example: 1726744149
namestringRequired

The user friendly identifier for the API Key

Example: Production Server Key
typestring · enumRequired

The type of key depending on the SDK that is being used.

Example: serverPossible values:
post/admin/apikey
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 API keys

get

Returns all the API Keys for the given identifier

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
Responses
200

Created

application/json

The API key is used by SDKs to connect to Harness Feature Flags

apiKeystringRequired

The Key will be shown only on create. On subsequent GET calls, only the masked APIKeys will be returned

Example: b03af1cd-bd3f-472b-a4b0-c9c9c09c642e
identifierstringRequired

The environment that this key was created in

Example: production
keystringOptional

A hash of API key

Example: 3c940273c34e8a9b21
lastUsedinteger · int64Optional

Timestamp of the last time the API key was used

Example: 1726744149
namestringRequired

The user friendly identifier for the API Key

Example: Production Server Key
typestring · enumRequired

The type of key depending on the SDK that is being used.

Example: serverPossible values:
get/admin/apikey/{identifier}
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

put

Updates an API key for the given identifier

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
Body
descriptionstringOptionalExample: This key is for server side production environment
expiredAtintegerOptional
namestringOptionalExample: production-env-key
Responses
200

Updated

No content

put/admin/apikey/{identifier}
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

delete

Deletes an API key for the given identifier

Authorizations
x-api-keystringRequired
Path parameters
identifierstringRequired

Unique identifier for the object in the API.

Query parameters
projectIdentifierstringRequired

The Project identifier

environmentIdentifierstringRequired

Environment Identifier

accountIdentifierstringRequired

Account Identifier

Example: {"value":"default"}
orgIdentifierstringRequired

Organization Identifier

Example: {"value":"default_org"}
Responses
204

No content

No content

delete/admin/apikey/{identifier}
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?