Secrets

This contains APIs related to Secrets as defined in Harness

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

Securityx-api-key
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" "DATABASE"
includeSecretsFromEverySubScope
boolean
Default: false

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

includeAllSecretsAccessibleAtScope
boolean
Default: false

Specify whether or not to include all the Secrets accessible at the scope. For eg if set as true, at the Project scope we will get org and account Secrets also in the response

pageIndex
integer <int32>
Default: 0

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

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

pageToken
string

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

secretManagerIdentifiers
Array of strings unique

Specify the secret managers whose secrets should be listed

Responses
400

Bad Request

404

Not Found

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": [
    ]
}

Creates a Secret at given Scope

Securityx-api-key
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:
required

Details required to create the Secret

required
object (Secret1)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns the created Secret details

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

Creates a Secret File

Securityx-api-key
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

404

Not Found

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 YAMLDeprecated

Securityx-api-key
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
required

Details required to create the Secret

required
object (Secret1)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns the created Secret details

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

Get the Secret by ID and Scope

Securityx-api-key
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

404

Not Found

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

Securityx-api-key
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 (Secret1)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

404

Not Found

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": [
    ]
}

Deletes Secret by ID and Scope

Securityx-api-key
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.

forceDelete
boolean
Default: false

If true, the Entity will be forced delete, without checking any references/usages

Responses
400

Bad Request

404

Not Found

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.

Securityx-api-key
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 Index of the results to fetch.Default Value: 0

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

pageToken
string

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

Request Body schema:
secretName
string

This is the secret name on which the filter will be applied.

secretIdentifier
string

This is the secret identifier on which the filter will be applied.

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"
secretManagerIdentifiers
Array of strings unique

secretManagerIdentifiers

description
string

Description of filter created.

searchTerm
string

Text to search/filter the Entity.

object

Filter tags as a key-value pair.

filterType
string
Value: "Secret"
Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns the list of Secrets

post/ng/api/v2/secrets/list/secrets
Request samples
{
  • "secretName": "string",
  • "secretIdentifier": "string",
  • "secretTypes": [
    ],
  • "secretManagerIdentifiers": [
    ],
  • "description": "string",
  • "searchTerm": "string",
  • "tags": {
    },
  • "filterType": "Secret"
}
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.

Securityx-api-key
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 Index of the results to fetch.Default Value: 0

pageSize
integer <int32> <= 100
Default: 50

Results per page(max 100)Default Value: 50

Array of objects (SortOrder)

Sort criteria for the elements.

pageToken
string

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

secretManagerIdentifiers
Array of strings unique
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" "DATABASE"
includeSecretsFromEverySubScope
boolean

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

includeAllSecretsAccessibleAtScope
boolean

This is true if secrets are filtered from all super scopes.

Responses
400

Bad Request

404

Not Found

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,
  • "includeAllSecretsAccessibleAtScope": true
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Updates the Secret file by ID and Scope

Securityx-api-key
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

404

Not Found

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": [
    ]
}

Updates the Secret by ID and Scope via YAML

Securityx-api-key
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
required

Details of Secret to create

required
object (Secret1)

This is details of the secret entity defined in Harness.

Responses
400

Bad Request

404

Not Found

500

Internal server error

default

Returns the updated Secret details

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

Validates Secret with the provided ID and Scope

Securityx-api-key
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:
required

Details of the Secret type

Responses
400

Bad Request

404

Not Found

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": [
    ]
}

Checks whether the identifier is unique or not

Securityx-api-key
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

404

Not Found

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": [
    ]
}