v2secrets

Create a secret via yaml

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
privateSecret
boolean
Default: false
Request Body schema: application/yaml
required
object (SecretDTOV2)
Responses
200

successful operation

400

Bad Request

500

Internal server error

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

Validate Secret Identifier is unique

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
Responses
200

successful operation

400

Bad Request

500

Internal server error

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",
  • "data": true,
  • "metaData": { },
  • "correlationId": "string"
}

Create a secret file

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
privateSecret
boolean
Default: false
Request Body schema: multipart/form-data
file
required
string <binary>
spec
string
Responses
200

successful operation

400

Bad Request

500

Internal server error

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=string \
  -F spec=string
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Update a secret file

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
Request Body schema: multipart/form-data
file
string <binary>
spec
string
Responses
200

successful operation

400

Bad Request

500

Internal server error

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=string \
  -F spec=string
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

List secrets

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
pageIndex
integer <int32>
Default: 0
pageSize
integer <int32>
Default: 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
200

successful operation

400

Bad Request

500

Internal server error

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

Gets secret

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
Responses
200

successful operation

400

Bad Request

500

Internal server error

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",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Update a secret

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
Request Body schema: application/json
required
object (SecretDTOV2)
Responses
200

successful operation

400

Bad Request

500

Internal server error

put/ng/api/v2/secrets/{identifier}
Request samples
application/json
{
  • "secret": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Delete secret

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
Responses
200

successful operation

400

Bad Request

500

Internal server error

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",
  • "data": true,
  • "metaData": { },
  • "correlationId": "string"
}

Update a secret via yaml

Request
Security:
ApiKey (readwrite)
path Parameters
identifier
required
string
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
Request Body schema: application/yaml
required
object (SecretDTOV2)
Responses
200

successful operation

400

Bad Request

500

Internal server error

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

Validate a secret

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
identifier
string
Request Body schema:
type
required
string
host
required
string
Responses
200

successful operation

400

Bad Request

500

Internal server error

post/ng/api/v2/secrets/validate
Request samples
{
  • "type": "SSHKeyValidationMetadata",
  • "host": "string"
}
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Get secretsDeprecated

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
identifiers
Array of strings
type
string
Enum: "SecretFile" "SecretText" "SSHKey"
searchTerm
string
types
Array of strings
Items Enum: "SecretFile" "SecretText" "SSHKey"
source_category
string
Enum: "CLOUD_PROVIDER" "SECRET_MANAGER" "CLOUD_COST" "ARTIFACTORY" "CODE_REPO" "MONITORING" "TICKETING"
includeSecretsFromEverySubScope
boolean
Default: false
pageIndex
integer <int32>
Default: 0
pageSize
integer <int32>
Default: 100
Responses
200

successful operation

400

Bad Request

500

Internal server error

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",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Create a secret

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string
orgIdentifier
string
projectIdentifier
string
privateSecret
boolean
Default: false
Request Body schema: application/json
required
object (SecretDTOV2)
Responses
200

successful operation

400

Bad Request

500

Internal server error

post/ng/api/v2/secrets
Request samples
application/json
{
  • "secret": {
    }
}
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}