environments

Upsert an environment by identifier

Request
Security:
ApiKey (readwrite)
query Parameters
accountId
string
header Parameters
If-Match
string
Request Body schema:
orgIdentifier
string
projectIdentifier
string
identifier
string
object
name
string
description
string
color
string
type
required
string
Enum: "PreProduction" "Production"
version
integer <int64>
Responses
200

successful operation

400

Bad Request

500

Internal server error

put/ng/api/environments/upsert
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "version": 0
}
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Gets environment list for a project

Request
Security:
ApiKey (readwrite)
query Parameters
page
integer <int32>
Default: 0
size
integer <int32>
Default: 100
accountId
string
orgIdentifier
string
projectIdentifier
string
envIdentifiers
Array of strings
sort
Array of strings
Responses
200

successful operation

400

Bad Request

500

Internal server error

get/ng/api/environments
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/environments?page=0&size=100&accountId=string&orgIdentifier=string&projectIdentifier=string&envIdentifiers=string&sort=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Update an environment by identifier

Request
Security:
ApiKey (readwrite)
query Parameters
accountId
string
header Parameters
If-Match
string
Request Body schema:
orgIdentifier
string
projectIdentifier
string
identifier
string
object
name
string
description
string
color
string
type
required
string
Enum: "PreProduction" "Production"
version
integer <int64>
Responses
200

successful operation

400

Bad Request

500

Internal server error

put/ng/api/environments
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "version": 0
}
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Create an Environment

Request
Security:
ApiKey (readwrite)
query Parameters
accountId
string
Request Body schema:
orgIdentifier
string
projectIdentifier
string
identifier
string
object
name
string
description
string
color
string
type
required
string
Enum: "PreProduction" "Production"
version
integer <int64>
Responses
200

successful operation

400

Bad Request

500

Internal server error

post/ng/api/environments
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "version": 0
}
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Gets a Environment by identifier

Request
Security:
ApiKey (readwrite)
path Parameters
environmentIdentifier
required
string
query Parameters
accountId
string
orgIdentifier
string
projectIdentifier
string
deleted
boolean
Default: false
Responses
200

successful operation

400

Bad Request

500

Internal server error

get/ng/api/environments/{environmentIdentifier}
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/environments/:environmentIdentifier?accountId=string&orgIdentifier=string&projectIdentifier=string&deleted=false' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "data": {
    },
  • "metaData": { },
  • "correlationId": "string"
}

Delete en environment by identifier

Request
Security:
ApiKey (readwrite)
path Parameters
environmentIdentifier
required
string
query Parameters
accountId
string
orgIdentifier
string
projectIdentifier
string
header Parameters
If-Match
string
Responses
200

successful operation

400

Bad Request

500

Internal server error

delete/ng/api/environments/{environmentIdentifier}
Request samples
curl -i -X DELETE \
  'https://app.harness.io/gateway/ng/api/environments/:environmentIdentifier?accountId=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'If-Match: string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "data": true,
  • "metaData": { },
  • "correlationId": "string"
}