Secrets

This contains APIs related to Secrets as defined in Harness

Checks whether the identifier is unique or not

SecurityApiKey
Request
path Parameters
identifier
required
string

Secret Identifier

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity.

orgIdentifier
string

Organization Identifier for the Entity.

projectIdentifier
string

Project Identifier for the Entity.

Responses
400

Bad Request

500

Internal server error

default

It returns true if the Identifier is unique and false if the Identifier is not unique.

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

Creates a Secret at given Scope

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.

privateSecret
boolean
Default: false

This is a boolean value to specify if the Secret is Private. The default value is False.

Request Body schema: application/json

Details required to create the Secret

required
object (Secret)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

500

Internal server error

default

Returns the created Secret details

post/ng/api/v2/secrets
Request samples
application/json
{
  • "secret": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Creates a Secret File

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.

privateSecret
boolean
Default: false

This is a boolean value to specify if the Secret is Private. The default value is False.

Request Body schema: multipart/form-data
file
required
object

This is the encrypted Secret File that needs to be uploaded.

spec
string

Specification of Secret file

Responses
400

Bad Request

500

Internal server error

default

Returns created Secret file

post/ng/api/v2/secrets/files
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Creates a secret via YAML

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.

privateSecret
boolean
Default: false

This is a boolean value to specify if the Secret is Private. The default value is False.

Request Body schema: application/yaml

Details required to create the Secret

required
object (Secret)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

500

Internal server error

default

Returns the created Secret details

post/ng/api/v2/secrets/yaml
Request samples
Response samples
No sample

Deletes Secret by ID and Scope

SecurityApiKey
Request
path Parameters
identifier
required
string

Secret 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.

Responses
400

Bad Request

500

Internal server error

default

It returns true if the secret is successfully deleted and false if it is not deleted

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

Fetches the list of Secrets corresponding to the request's filter criteria.Deprecated

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.

identifiers
Array of strings

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

type
string

Type of Secret whether it is SecretFile, SecretText or SSH key

Enum: "SecretFile" "SecretText" "SSHKey" "WinRmCredentials"
searchTerm
string

Filter Secrets based on name, Identifier and tags by this search term

types
Array of strings

Add multiple secret types like SecretFile, SecretText or SSH key to criteria

Items Enum: "SecretFile" "SecretText" "SSHKey" "WinRmCredentials"
source_category
string

Source Category like CLOUD_PROVIDER, SECRET_MANAGER, CLOUD_COST, ARTIFACTORY, CODE_REPO, MONITORING or TICKETING

Enum: "CLOUD_PROVIDER" "SECRET_MANAGER" "CLOUD_COST" "ARTIFACTORY" "CODE_REPO" "MONITORING" "TICKETING"
includeSecretsFromEverySubScope
boolean
Default: false

Specify whether or not to include secrets from all the sub-scopes of the given Scope

pageIndex
integer <int32>
Default: 0

Page number of navigation. The default value is 0

pageSize
integer <int32>
Default: 100

Number of entries per page. The default value is 100

Responses
400

Bad Request

500

Internal server error

default

Returns the list of Secrets

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

Fetches the list of Secrets 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.

pageIndex
integer <int32>
Default: 0

Page number of navigation. The default value of 0

pageSize
integer <int32>
Default: 100

Number of entries per page. The default value is 100

Request Body schema:
identifiers
Array of strings

This is the list of Entity Identifiers on which the filter will be applied.

searchTerm
string

Text to search/filter the Entity.

secretTypes
Array of strings

This is the list of the ENTITY types on which the filter will be applied.

Items Enum: "SecretFile" "SecretText" "SSHKey" "WinRmCredentials"
sourceCategory
string

Specifies the connector category.

Enum: "CLOUD_PROVIDER" "SECRET_MANAGER" "CLOUD_COST" "ARTIFACTORY" "CODE_REPO" "MONITORING" "TICKETING"
includeSecretsFromEverySubScope
boolean

This is true if secrets are filtered at each subsequent scope.

Responses
400

Bad Request

500

Internal server error

default

Returns the list of Secrets

post/ng/api/v2/secrets/list
Request samples
{
  • "identifiers": [
    ],
  • "searchTerm": "string",
  • "secretTypes": [
    ],
  • "sourceCategory": "CLOUD_PROVIDER",
  • "includeSecretsFromEverySubScope": true
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Get the Secret by ID and Scope

SecurityApiKey
Request
path Parameters
identifier
required
string

Secret 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.

Responses
400

Bad Request

500

Internal server error

default

Returns the Secret with the requested ID and Scope

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

Updates the Secret by ID and Scope

SecurityApiKey
Request
path Parameters
identifier
required
string

Secret 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.

Request Body schema: application/json
required
object (Secret)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

500

Internal server error

default

Returns the updated Secret

put/ng/api/v2/secrets/{identifier}
Request samples
application/json
{
  • "secret": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Updates the Secret by ID and Scope via YAML

SecurityApiKey
Request
path Parameters
identifier
required
string

Secret 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.

Request Body schema: application/yaml

Details of Secret to create

required
object (Secret)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

500

Internal server error

default

Returns the updated Secret details

put/ng/api/v2/secrets/{identifier}/yaml
Request samples
Response samples
No sample

Updates the Secret file by ID and Scope

SecurityApiKey
Request
path Parameters
identifier
required
string

Secret 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.

Request Body schema: multipart/form-data
file
object

This is the encrypted Secret File that needs to be uploaded.

spec
string

Specification of Secret file

Responses
400

Bad Request

500

Internal server error

default

Returns the updated Secret file details

put/ng/api/v2/secrets/files/{identifier}
Request samples
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Validates Secret with the provided ID and Scope

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.

identifier
string

Secret ID

Request Body schema:

Details of the Secret type

Responses
400

Bad Request

500

Internal server error

default

Returns validation response

post/ng/api/v2/secrets/validate
Request samples
No sample
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}