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

Token

This contains APIs related to Token as defined in Harness

Create a Token

post

Creates a Token for the given API Key Type.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

This has the API Key Token details defined in Harness.

identifierstringRequired

Identifier of the Token

namestring · min: 1 · max: 2147483647Required

Name of the Token

validFrominteger · int64Optional

This is the time from which the Token is valid. The time is in milliseconds.

validTointeger · int64Optional

This is the time till which the Token is valid. The time is in milliseconds.

scheduledExpireTimeinteger · int64Optional

Scheduled expiry time in milliseconds.

validbooleanOptional

Boolean value to indicate if Token is valid or not.

accountIdentifierstringOptional

Account Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

apiKeyIdentifierstringOptional

This is the API Key Id within which the Token is created. Required for PAT/SAT tokens; auto-generated for scoped tokens.

parentIdentifierstringOptional

This is the ID of the Parent entity from which the Token inherits its role bindings. Required for PAT/SAT tokens; derived from caller principal for scoped tokens.

apiKeyTypestring · enumOptional

Type of the API Key

Possible values:
descriptionstring · max: 1024Optional

Description of the Token

sshKeyContentstringOptional

SSH key content from a public key, this is only present if API_KEY Type is SSH_KEY

contentstringOptional

PGP key content from a public key, this is only present if API_KEY Type is PGP_KEY

pgpKeyIdstringOptional

PGP key ID: Last 8 bytes of the fingerprint

pgpPrimaryUserIdstringOptional

Primary user ID associated with the PGP key

pgpKeyAlgorithmstringOptional

PGP key algorithm (RSA, DSA, ECDSA, EdDSA)

pgpParentKeyIdstringOptional

For subkeys: the keyId of the parent/master key. Null for primary keys.

pgpIsSubKeybooleanOptional

Indicates if this is a subkey (true) or a primary/master key (false)

revocationReasonstring · enumOptional

Revocation reason if the key has been revoked

Possible values:
tokenModestring · enumOptional

Token mode: EPHEMERAL (auto-deleted when execution completes) or PERSISTENT (long-lived, user-managed).

Possible values:
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/token
POST /gateway/ng/api/token?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 912

{
  "identifier": "text",
  "name": "text",
  "validFrom": 1,
  "validTo": 1,
  "scheduledExpireTime": 1,
  "valid": true,
  "accountIdentifier": "text",
  "projectIdentifier": "text",
  "orgIdentifier": "text",
  "apiKeyIdentifier": "text",
  "parentIdentifier": "text",
  "apiKeyType": "USER",
  "description": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "sshKeyContent": "text",
  "sshKeyUsage": [
    "AUTH"
  ],
  "content": "text",
  "pgpKeyUsage": [
    "SIGN"
  ],
  "pgpKeyId": "text",
  "pgpPrimaryUserId": "text",
  "pgpKeyAlgorithm": "text",
  "pgpIdentities": [
    {
      "name": "text",
      "email": "text"
    }
  ],
  "pgpPrimaryIdentity": {
    "name": "text",
    "email": "text"
  },
  "pgpParentKeyId": "text",
  "pgpIsSubKey": true,
  "revocationReason": "unknown",
  "scopedResourcePermissions": [
    {
      "orgIdentifier": "text",
      "projectIdentifier": "text",
      "resourceType": "text",
      "resourceIdentifiers": [
        "text"
      ],
      "permission": "text",
      "permissions": [
        "text"
      ]
    }
  ],
  "tokenMode": "EPHEMERAL",
  "scopedResourceMetadata": {
    "parentResourceId": "text",
    "createdBy": "text"
  }
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update a Token

put

Updates a Token for the given API Key Type.

Path parameters
identifierstringRequired

Token ID

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body

This has the API Key Token details defined in Harness.

identifierstringRequired

Identifier of the Token

namestring · min: 1 · max: 2147483647Required

Name of the Token

validFrominteger · int64Optional

This is the time from which the Token is valid. The time is in milliseconds.

validTointeger · int64Optional

This is the time till which the Token is valid. The time is in milliseconds.

scheduledExpireTimeinteger · int64Optional

Scheduled expiry time in milliseconds.

validbooleanOptional

Boolean value to indicate if Token is valid or not.

accountIdentifierstringOptional

Account Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

apiKeyIdentifierstringOptional

This is the API Key Id within which the Token is created. Required for PAT/SAT tokens; auto-generated for scoped tokens.

parentIdentifierstringOptional

This is the ID of the Parent entity from which the Token inherits its role bindings. Required for PAT/SAT tokens; derived from caller principal for scoped tokens.

apiKeyTypestring · enumOptional

Type of the API Key

Possible values:
descriptionstring · max: 1024Optional

Description of the Token

sshKeyContentstringOptional

SSH key content from a public key, this is only present if API_KEY Type is SSH_KEY

contentstringOptional

PGP key content from a public key, this is only present if API_KEY Type is PGP_KEY

pgpKeyIdstringOptional

PGP key ID: Last 8 bytes of the fingerprint

pgpPrimaryUserIdstringOptional

Primary user ID associated with the PGP key

pgpKeyAlgorithmstringOptional

PGP key algorithm (RSA, DSA, ECDSA, EdDSA)

pgpParentKeyIdstringOptional

For subkeys: the keyId of the parent/master key. Null for primary keys.

pgpIsSubKeybooleanOptional

Indicates if this is a subkey (true) or a primary/master key (false)

revocationReasonstring · enumOptional

Revocation reason if the key has been revoked

Possible values:
tokenModestring · enumOptional

Token mode: EPHEMERAL (auto-deleted when execution completes) or PERSISTENT (long-lived, user-managed).

Possible values:
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
put/token/{identifier}
PUT /gateway/ng/api/token/{identifier}?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 912

{
  "identifier": "text",
  "name": "text",
  "validFrom": 1,
  "validTo": 1,
  "scheduledExpireTime": 1,
  "valid": true,
  "accountIdentifier": "text",
  "projectIdentifier": "text",
  "orgIdentifier": "text",
  "apiKeyIdentifier": "text",
  "parentIdentifier": "text",
  "apiKeyType": "USER",
  "description": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "sshKeyContent": "text",
  "sshKeyUsage": [
    "AUTH"
  ],
  "content": "text",
  "pgpKeyUsage": [
    "SIGN"
  ],
  "pgpKeyId": "text",
  "pgpPrimaryUserId": "text",
  "pgpKeyAlgorithm": "text",
  "pgpIdentities": [
    {
      "name": "text",
      "email": "text"
    }
  ],
  "pgpPrimaryIdentity": {
    "name": "text",
    "email": "text"
  },
  "pgpParentKeyId": "text",
  "pgpIsSubKey": true,
  "revocationReason": "unknown",
  "scopedResourcePermissions": [
    {
      "orgIdentifier": "text",
      "projectIdentifier": "text",
      "resourceType": "text",
      "resourceIdentifiers": [
        "text"
      ],
      "permission": "text",
      "permissions": [
        "text"
      ]
    }
  ],
  "tokenMode": "EPHEMERAL",
  "scopedResourceMetadata": {
    "parentResourceId": "text",
    "createdBy": "text"
  }
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete a Token

delete

Deletes a Token for the given API Key Type.

Path parameters
identifierstringRequired

Token ID

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

apiKeyTypestring · enumRequired

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

Possible values:
parentIdentifierstringRequired

ID of API key's Parent Service Account

apiKeyIdentifierstringRequired

API key ID

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/token/{identifier}
DELETE /gateway/ng/api/token/{identifier}?accountIdentifier=text&apiKeyType=USER&parentIdentifier=text&apiKeyIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

List all Tokens

get

Lists all the Tokens matching the given search criteria.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

apiKeyTypestring · enumRequired

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

Possible values:
parentIdentifierstringOptional

ID of API key's Parent Service Account

apiKeyIdentifierstringOptional

API key ID

identifiersstring[]Optional

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

pageIndexinteger · int32Optional

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

Default: 0
pageSizeinteger · int32 · max: 100Optional

Results per page(max 100)Default Value: 50

Default: 50
pageTokenstringOptional

Page Token of the next results to fetch.Default Value: ''

searchTermstringOptional

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

includeOnlyActiveTokensbooleanOptional

Boolean value to indicate whether to list only active tokens or all tokens. By default, all tokens will be listed.

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/token/aggregate
GET /gateway/ng/api/token/aggregate?accountIdentifier=text&apiKeyType=USER HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Rotate a Token

post

Rotates a Token for the given API Key Type.

Path parameters
identifierstringRequired

Token Identifier

Query parameters
rotateTimestampinteger · int64Optional

Time stamp till when the old token will be valid post rotation.

accountIdentifierstringRequired

Account Identifier for the Entity.

orgIdentifierstringOptional

Organization Identifier for the Entity.

projectIdentifierstringOptional

Project Identifier for the Entity.

apiKeyTypestring · enumRequired

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

Possible values:
parentIdentifierstringRequired

ID of API key's Parent Service Account

apiKeyIdentifierstringRequired

API key ID

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/token/rotate/{identifier}
POST /gateway/ng/api/token/rotate/{identifier}?accountIdentifier=text&apiKeyType=USER&parentIdentifier=text&apiKeyIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Validate a Token

post

Validate a Token for the given account.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

Body
stringOptional
Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
post/token/validate
POST /gateway/ng/api/token/validate?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 6

"text"
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Last updated

Was this helpful?