Environments

This contains APIs related to Environments

Upsert an Environment by identifier

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity

header Parameters
If-Match
string
Request Body schema:

Details of the Environment to be updated

orgIdentifier
string
projectIdentifier
string
identifier
string
object
name
string
description
string
color
string
type
string
Enum: "PreProduction" "Production"
version
integer <int64>
Responses
400

Bad Request

500

Internal Server Error

default

Returns the updated Environment

put/ng/api/environmentsV2/upsert
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "version": 0
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets Environment list for a project

Request
Security:
ApiKey (readwrite)
query Parameters
page
integer <int32>
Default: 0

Indicates the number of pages. Results for these pages will be retrieved.

size
integer <int32>
Default: 100

The number of the elements to fetch

accountIdentifier
required
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

searchTerm
string

The word to be searched and included in the list response

envIdentifiers
Array of strings

List of EnvironmentIds

sort
Array of strings

Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order

Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of Environments for a Project

get/ng/api/environmentsV2
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/environmentsV2?page=0&size=100&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&searchTerm=string&envIdentifiers=string&sort=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Update an Environment by identifier

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity

header Parameters
If-Match
string
Request Body schema:

Details of the Environment to be updated

orgIdentifier
string
projectIdentifier
string
identifier
string
object
name
string
description
string
color
string
type
string
Enum: "PreProduction" "Production"
version
integer <int64>
Responses
400

Bad Request

500

Internal Server Error

default

Returns the updated Environment

put/ng/api/environmentsV2
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "version": 0
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Create an Environment

Request
Security:
ApiKey (readwrite)
query Parameters
accountIdentifier
required
string

Account Identifier for the Entity

Request Body schema:

Details of the Environment to be created

orgIdentifier
string
projectIdentifier
string
identifier
string
object
name
string
description
string
color
string
type
string
Enum: "PreProduction" "Production"
version
integer <int64>
Responses
400

Bad Request

500

Internal Server Error

default

Returns the created Environment

post/ng/api/environmentsV2
Request samples
{
  • "orgIdentifier": "string",
  • "projectIdentifier": "string",
  • "identifier": "string",
  • "tags": {
    },
  • "name": "string",
  • "description": "string",
  • "color": "string",
  • "type": "PreProduction",
  • "version": 0
}
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets Environment Access list

Request
Security:
ApiKey (readwrite)
query Parameters
page
integer <int32>
Default: 0

page

size
integer <int32>
Default: 100

size

accountIdentifier
required
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

searchTerm
string

The word to be searched and included in the list response

envIdentifiers
Array of strings

List of EnvironmentIds

sort
Array of strings

Specifies sorting criteria of the list. Like sorting based on the last updated entity, alphabetical sorting in an ascending or descending order

Responses
400

Bad Request

500

Internal Server Error

default

Returns the list of Environments for a Project that are accessible

get/ng/api/environmentsV2/list/access
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/environmentsV2/list/access?page=0&size=100&accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&searchTerm=string&envIdentifiers=string&sort=string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Gets an Environment by identifier

Request
Security:
ApiKey (readwrite)
path Parameters
environmentIdentifier
required
string

Environment Identifier for the entity

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

deleted
boolean
Default: false

Specify whether Environment is deleted or not

Responses
400

Bad Request

500

Internal Server Error

default

The saved Environment

get/ng/api/environmentsV2/{environmentIdentifier}
Request samples
curl -i -X GET \
  'https://app.harness.io/gateway/ng/api/environmentsV2/:environmentIdentifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string&deleted=false' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}

Delete an Environment by identifier

Request
Security:
ApiKey (readwrite)
path Parameters
environmentIdentifier
required
string

Environment Identifier for the entity

query Parameters
accountIdentifier
required
string

Account Identifier for the Entity

orgIdentifier
string

Organization Identifier for the Entity

projectIdentifier
string

Project Identifier for the Entity

header Parameters
If-Match
string
Responses
400

Bad Request

500

Internal Server Error

default

Returns true if the Environment is deleted

delete/ng/api/environmentsV2/{environmentIdentifier}
Request samples
curl -i -X DELETE \
  'https://app.harness.io/gateway/ng/api/environmentsV2/:environmentIdentifier?accountIdentifier=string&orgIdentifier=string&projectIdentifier=string' \
  -H 'If-Match: string' \
  -H 'x-api-key: YOUR_API_KEY_HERE'
Response samples
{
  • "status": "SUCCESS",
  • "code": "DEFAULT_ERROR_CODE",
  • "message": "string",
  • "correlationId": "string",
  • "errors": [
    ]
}