Token
This contains APIs related to Token as defined in Harness
Creates a Token for the given API Key Type.
Account Identifier for the Entity.
This has the API Key Token details defined in Harness.
Identifier of the Token
Name of the Token
This is the time from which the Token is valid. The time is in milliseconds.
This is the time till which the Token is valid. The time is in milliseconds.
Scheduled expiry time in milliseconds.
Boolean value to indicate if Token is valid or not.
Account Identifier for the Entity.
Project Identifier for the Entity.
Organization Identifier for the Entity.
This is the API Key Id within which the Token is created. Required for PAT/SAT tokens; auto-generated for scoped tokens.
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.
Type of the API Key
Description of the Token
SSH key content from a public key, this is only present if API_KEY Type is SSH_KEY
PGP key content from a public key, this is only present if API_KEY Type is PGP_KEY
PGP key ID: Last 8 bytes of the fingerprint
Primary user ID associated with the PGP key
PGP key algorithm (RSA, DSA, ECDSA, EdDSA)
For subkeys: the keyId of the parent/master key. Null for primary keys.
Indicates if this is a subkey (true) or a primary/master key (false)
Revocation reason if the key has been revoked
Token mode: EPHEMERAL (auto-deleted when execution completes) or PERSISTENT (long-lived, user-managed).
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns created Token details
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"
}
]
}Updates a Token for the given API Key Type.
Token ID
Account Identifier for the Entity.
This has the API Key Token details defined in Harness.
Identifier of the Token
Name of the Token
This is the time from which the Token is valid. The time is in milliseconds.
This is the time till which the Token is valid. The time is in milliseconds.
Scheduled expiry time in milliseconds.
Boolean value to indicate if Token is valid or not.
Account Identifier for the Entity.
Project Identifier for the Entity.
Organization Identifier for the Entity.
This is the API Key Id within which the Token is created. Required for PAT/SAT tokens; auto-generated for scoped tokens.
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.
Type of the API Key
Description of the Token
SSH key content from a public key, this is only present if API_KEY Type is SSH_KEY
PGP key content from a public key, this is only present if API_KEY Type is PGP_KEY
PGP key ID: Last 8 bytes of the fingerprint
Primary user ID associated with the PGP key
PGP key algorithm (RSA, DSA, ECDSA, EdDSA)
For subkeys: the keyId of the parent/master key. Null for primary keys.
Indicates if this is a subkey (true) or a primary/master key (false)
Revocation reason if the key has been revoked
Token mode: EPHEMERAL (auto-deleted when execution completes) or PERSISTENT (long-lived, user-managed).
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns updated Token details
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"
}
]
}Deletes a Token for the given API Key Type.
Token ID
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
This is the API Key type like Personal Access Key or Service Account Key.
ID of API key's Parent Service Account
API key ID
Bad Request
This is Failure entity as defied in Harness
Internal server error
It returns true if the Token is deleted successfully and false if the Token is not deleted.
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"
}
]
}Lists all the Tokens matching the given search criteria.
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
This is the API Key type like Personal Access Key or Service Account Key.
ID of API key's Parent Service Account
API key ID
This is the list of Token IDs. Details specific to these IDs would be fetched.
Page Index of the results to fetch.Default Value: 0
0Results per page(max 100)Default Value: 50
50Page Token of the next results to fetch.Default Value: ''
This would be used to filter Tokens. Any Token having the specified string in its Name, ID and Tag would be filtered.
Boolean value to indicate whether to list only active tokens or all tokens. By default, all tokens will be listed.
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns the list of Aggregated Tokens.
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"
}
]
}Rotates a Token for the given API Key Type.
Token Identifier
Time stamp till when the old token will be valid post rotation.
Account Identifier for the Entity.
Organization Identifier for the Entity.
Project Identifier for the Entity.
This is the API Key type like Personal Access Key or Service Account Key.
ID of API key's Parent Service Account
API key ID
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns the rotated Token
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 for the given account.
Account Identifier for the Entity.
Bad Request
This is Failure entity as defied in Harness
Internal server error
Validate a Token for the given account
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?