Account Secrets [Beta]

This contains APIs for account-scoped secrets.

Create a secret

Creates a new secret

Securityx-api-key
Request
query Parameters
private_secret
boolean
Default: false

This would be used to define secret as private.

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema:
required
required
object (Secret)
Responses
201

Secret response

post/v1/secrets
Request samples
{
  • "secret": {
    }
}
Response samples
{
  • "secret": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "draft": false
}

List secrets

Retrieves the information of the secrets.

Securityx-api-key
Request
query Parameters
secret
Array of strings

Identifier field of secrets

type
Array of strings

Secret types on which the filter will be applied

Items Enum: "SSHKeyPath" "SSHKeyReference" "SSHPassword" "SSHKerberosTGTKeyTabFile" "SSHKerberosTGTPassword" "SecretFile" "SecretText" "WinRmTGTKeyTabFile" "WinRmTGTPassword" "WinRmNTLM"
recursive
boolean
Default: false

Expand current scope to include all child scopes

search_term
string

This would be used to filter resources having attributes matching with search term.

page
integer
Default: 0

Pagination page number strategy: Specify the page number within the paginated collection related to the number of items in each page

limit
integer <= 1000
Default: 20

Number of items to return per page.

sort
string

Parameter on the basis of which sorting is done.

Enum: "name" "identifier" "created" "updated"
order
string

Order on the basis of which sorting is done.

Enum: "ASC" "DESC"
header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Secret list response

get/v1/secrets
Request samples
Response samples
[
  • {
    }
]

Validate secret reference

Validates if the secret at the secretManager path can be referenced

Securityx-api-key
Request
header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema: application/json

Details of the secret reference

required
object (Secret)
Responses
200

Response of the secret reference validation

post/v1/secrets/validate-secret-ref
Request samples
application/json
{
  • "secret_manager_identifier": "prod_sm_one",
  • "secret_ref_path": "path1/path2#key"
}
Response samples
application/json
{
  • "success": true,
  • "message": "Validation is Successful, Secret can be referenced"
}

Retrieve a secret

Retrieves the information of the secret.

Securityx-api-key
Request
path Parameters
secret
required
string

Identifier field of the secret

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Secret response

get/v1/secrets/{secret}
Request samples
Response samples
{
  • "secret": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "draft": false
}

Deletes a secret

Deletes the information of the secret with the matching secret identifier.

Securityx-api-key
Request
path Parameters
secret
required
string

Identifier field of the secret

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Responses
200

Secret response

delete/v1/secrets/{secret}
Request samples
Response samples
{
  • "secret": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "draft": false
}

Update a secret

Updates the information of the secret with the matching secret identifier.

Securityx-api-key
Request
path Parameters
secret
required
string

Identifier field of the secret

header Parameters
Harness-Account
string

Identifier field of the account the resource is scoped to. This is required for Authorization methods other than the x-api-key header. If you are using the x-api-key header, this can be skipped.

Request Body schema:
required
required
object (Secret)
Responses
200

Secret response

put/v1/secrets/{secret}
Request samples
{
  • "secret": {
    }
}
Response samples
{
  • "secret": {
    },
  • "created": 1234567890,
  • "updated": 1234567890,
  • "draft": false
}