ApiKey

This fetches API keys defined in Harness

Creates an API key

SecurityApiKey
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

Request Body schema:
identifier
required
string

Identifier of the API Key

name
required
string

Name of the API Key

description
string [ 0 .. 1024 ] characters

Description of the API Key

object

Tags for the API Key

apiKeyType
string

Type of the API Key

Enum: "USER" "SERVICE_ACCOUNT"
parentIdentifier
required
string

Parent Entity Identifier of the API Key

defaultTimeToExpireToken
integer <int64>

Default expiration time of the Token within API Key.

accountIdentifier
required
string

Account Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns the created API key

post/ng/api/apikey
Request samples
{
  • "identifier": "string",
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "apiKeyType": "USER",
  • "parentIdentifier": "string",
  • "defaultTimeToExpireToken": 0,
  • "accountIdentifier": "string",
  • "projectIdentifier": "string",
  • "orgIdentifier": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Deletes the API Key corresponding to the provided ID.

SecurityApiKey
Request
path Parameters
identifier
required
string

This is the API key ID

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

apiKeyType
required
string

This is the API Key type like Personal Access Key or Service Account Key.

Enum: "USER" "SERVICE_ACCOUNT"
parentIdentifier
required
string

Id of API key's Parent Service Account

Responses
400

Bad Request

500

Internal server error

default

Returns a boolean value. The value is True if the API Key is successfully deleted, else it is False.

delete/ng/api/apikey/{identifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Fetches the API Keys details corresponding to the provided ID and Scope.

SecurityApiKey
Request
path Parameters
identifier
required
string

This is the API key ID

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

apiKeyType
required
string

This is the API Key type like Personal Access Key or Service Account Key.

Enum: "USER" "SERVICE_ACCOUNT"
parentIdentifier
required
string

ID of API key's Parent Service Account

Responses
400

Bad Request

500

Internal server error

default

Returns the API key

get/ng/api/apikey/aggregate/{identifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Fetches the list of Aggregated API Keys corresponding to the request's filter criteria.

SecurityApiKey
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

apiKeyType
required
string

This is the API Key type like Personal Access Key or Service Account Key.

Enum: "USER" "SERVICE_ACCOUNT"
parentIdentifier
required
string

ID of API key's Parent Service Account

identifiers
Array of strings

This is the list of API Key IDs. Details specific to these IDs would be fetched.

pageIndex
integer <int32>
Default: 0

Page Index of the results to fetch.Default Value: 0

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

searchTerm
string

This would be used to filter API keys. Any API key having the specified string in its Name, ID and Tag would be filtered.

Responses
400

Bad Request

500

Internal server error

default

Returns the Paginated list of Aggregated API keys.

get/ng/api/apikey/aggregate
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Fetches the list of API Keys corresponding to the request's filter criteria.

SecurityApiKey
Request
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

apiKeyType
required
string

This is the API Key type like Personal Access Key or Service Account Key.

Enum: "USER" "SERVICE_ACCOUNT"
parentIdentifier
required
string

ID of API key's Parent Service Account

identifiers
Array of strings

This is the list of API Key IDs. Details specific to these IDs would be fetched.

Responses
400

Bad Request

500

Internal server error

default

Returns the list of API keys.

get/ng/api/apikey
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Updates API Key for the provided ID

SecurityApiKey
Request
path Parameters
identifier
required
string

This is the API key ID

Request Body schema:
identifier
required
string

Identifier of the API Key

name
required
string

Name of the API Key

description
string [ 0 .. 1024 ] characters

Description of the API Key

object

Tags for the API Key

apiKeyType
string

Type of the API Key

Enum: "USER" "SERVICE_ACCOUNT"
parentIdentifier
required
string

Parent Entity Identifier of the API Key

defaultTimeToExpireToken
integer <int64>

Default expiration time of the Token within API Key.

accountIdentifier
required
string

Account Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

Returns the updated API key

put/ng/api/apikey/{identifier}
Request samples
{
  • "identifier": "string",
  • "name": "string",
  • "description": "string",
  • "tags": {
    },
  • "apiKeyType": "USER",
  • "parentIdentifier": "string",
  • "defaultTimeToExpireToken": 0,
  • "accountIdentifier": "string",
  • "projectIdentifier": "string",
  • "orgIdentifier": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}