Secrets

This contains APIs related to Secrets as defined in Harness

Checks whether the identifier is unique or not

Request
Security:
ApiKey (readwrite)
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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/v2/secrets/validateUniqueIdentifier/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Creates a secret via YAML

Request
Security:
ApiKey (readwrite)
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 (SecretDTOV2)
Responses
400

Bad Request

500

Internal server error

default

Returns the created Secret details

post/ng/api/v2/secrets/yaml
Request samples
curl -i -X POST \
  'https://app.harness.io/gateway/ng/api/v2/secrets/yaml?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&privateSecret=false' \
  -H 'Content-Type: application/yaml' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '[object Object]'
Response samples
No sample

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

Request
Security:
ApiKey (readwrite)
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
searchTerm
string
secretTypes
Array of strings
Items Enum: "SecretFile" "SecretText" "SSHKey"
sourceCategory
string
Enum: "CLOUD_PROVIDER" "SECRET_MANAGER" "CLOUD_COST" "ARTIFACTORY" "CODE_REPO" "MONITORING" "TICKETING"
includeSecretsFromEverySubScope
boolean
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

Request
Security:
ApiKey (readwrite)
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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/v2/secrets/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Updates the Secret by ID and Scope

Request
Security:
ApiKey (readwrite)
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 (SecretDTOV2)
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": [
    ]
}

Deletes Secret by ID and Scope

Request
Security:
ApiKey (readwrite)
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
curl -i -X DELETE \
  'https://app.harness.io/gateway/ng/api/v2/secrets/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Updates the Secret by ID and Scope via YAML

Request
Security:
ApiKey (readwrite)
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 (SecretDTOV2)
Responses
400

Bad Request

500

Internal server error

default

Returns the updated Secret details

put/ng/api/v2/secrets/{identifier}/yaml
Request samples
curl -i -X PUT \
  'https://app.harness.io/gateway/ng/api/v2/secrets/:identifier/yaml?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'Content-Type: application/yaml' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -d '[object Object]'
Response samples
No sample

Updates the Secret file by ID and Scope

Request
Security:
ApiKey (readwrite)
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
spec
string
Responses
400

Bad Request

500

Internal server error

default

Returns the updated Secret file details

put/ng/api/v2/secrets/files/{identifier}
Request samples
curl -i -X PUT \
  'https://app.harness.io/gateway/ng/api/v2/secrets/files/:identifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'Content-Type: multipart/form-data' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -F 'file=[object Object]' \
  -F spec=string
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Creates a Secret File

Request
Security:
ApiKey (readwrite)
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
spec
string
Responses
400

Bad Request

500

Internal server error

default

Returns created Secret file

post/ng/api/v2/secrets/files
Request samples
curl -i -X POST \
  'https://app.harness.io/gateway/ng/api/v2/secrets/files?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&privateSecret=false' \
  -H 'Content-Type: multipart/form-data' \
  -H 'x-api-key: YOUR_API_KEY_HERE' \
  -F 'file=[object Object]' \
  -F spec=string
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Validates Secret with the provided ID and Scope

Request
Security:
ApiKey (readwrite)
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": [
    ]
}

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

Request
Security:
ApiKey (readwrite)
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"
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"
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
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/v2/secrets?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&identifiers=string&type=SecretFile&searchTerm=string&types=SecretFile&source_category=CLOUD_PROVIDER&includeSecretsFromEverySubScope=false&pageIndex=0&pageSize=100' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Creates a Secret at given Scope

Request
Security:
ApiKey (readwrite)
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 (SecretDTOV2)
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": [
    ]
}