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

Keys

This contains APIs related to Keys as defined in Harness

List Keys

get

Lists SSH, PGP, or all Keys based on keyScheme parameter. Supports filtering by fingerprint, subKeyId, usages, and schemes.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

parentIdentifierstringOptional

Identifier of the key's Parent Account

keySchemestringOptional

Key scheme: ssh (default), pgp, or all

fingerprintstringOptional

Key fingerprint filter (exact match)

subKeyIdstringOptional

Subkey ID filter (PGP only)

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: ''

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
get/keys
GET /gateway/ng/api/keys?accountIdentifier=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"
    }
  ]
}

Create Key

post

Creates a SSH or PGP Key. Use query param keyScheme=ssh (default) or keyScheme=pgp. Defaults to SSH when keyScheme is not passed.

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

keySchemestringOptional

Key scheme: ssh (default) or pgp

Body

This has the Key details defined in Harness.

identifierstringRequired

Identifier of the Key

namestring · min: 1 · max: 2147483647Required

Name of the key

validFrominteger · int64Optional

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

validTointeger · int64Optional

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

accountIdentifierstringOptional

Account Identifier for the Entity.

parentIdentifierstringOptional

This is the ID of the Parent entity from which the Token inherits its role bindings.

descriptionstring · max: 1024Optional

Description of the key

keystringOptional

Public key value

keyIdstringOptional

Key ID: Last 8 bytes of the fingerprint

primaryUserIdstringOptional

Primary user ID associated with the key

keyAlgorithmstringOptional

Key algorithm (RSA, DSA, ECDSA, EdDSA)

keySchemestring · enumOptional

Key scheme: ssh (default) or pgp

Possible values:
parentKeyIdstringOptional

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

isSubKeybooleanOptional

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:
Responses
400

Bad Request

This is Failure entity as defied in Harness

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

{
  "identifier": "text",
  "name": "text",
  "validFrom": 1,
  "validTo": 1,
  "accountIdentifier": "text",
  "parentIdentifier": "text",
  "description": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "key": "text",
  "keyUsage": [
    "SIGN"
  ],
  "keyId": "text",
  "primaryUserId": "text",
  "keyAlgorithm": "text",
  "keyScheme": "SSH",
  "identities": [
    {
      "name": "text",
      "email": "text"
    }
  ],
  "primaryIdentity": {
    "name": "text",
    "email": "text"
  },
  "parentKeyId": "text",
  "isSubKey": true,
  "revocationReason": "unknown"
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Update a Key

put

Updates a Key's validity period or revocation status. For COMPROMISED revocation of PGP keys, the code-api service is notified first.

Path parameters
identifierstringRequired

Key identifier

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

parentIdentifierstringRequired

Identifier of the key's Parent Account

Body

Request to update public key (SSH/PGP) validity or revocation status

revocationReasonstring · enumOptional

Revocation reason. Cannot be combined with validFrom/validTo.

Possible values:
validFrominteger · int64Optional

Start of validity period (epoch millis). Cannot be combined with revocationReason.

validTointeger · int64Optional

End of validity period (epoch millis). Cannot be combined with revocationReason.

Responses
400

Bad Request

This is Failure entity as defied in Harness

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

{
  "revocationReason": "unknown",
  "validFrom": 1,
  "validTo": 1
}
{
  "status": "SUCCESS",
  "code": "DEFAULT_ERROR_CODE",
  "message": "text",
  "correlationId": "text",
  "errors": [
    {
      "fieldId": "text",
      "error": "text"
    }
  ]
}

Delete a Key

delete

Deletes a Key (SSH or PGP) by its identifier. For PGP primary keys, all subkeys are also deleted.

Path parameters
identifierstringRequired

Key identifier

Query parameters
accountIdentifierstringRequired

Account Identifier for the Entity.

parentIdentifierstringRequired

Identifier of the key's Parent Account

Responses
400

Bad Request

This is Failure entity as defied in Harness

statusstring · enumOptionalPossible values:
codestring · enumOptionalPossible values:
messagestringOptional
correlationIdstringOptional
delete/keys/{identifier}
DELETE /gateway/ng/api/keys/{identifier}?accountIdentifier=text&parentIdentifier=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"
    }
  ]
}

Last updated

Was this helpful?