Ana içeriğe geç

List Environments

Endpoint

GET /apiops/environments/

Authentication

Requires a Personal API Access Token.

Note

The OpenAPI description mentions an admin role, but the current Java implementation authenticates the token and returns all environments without an additional role check.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

None.

Query Parameters

None.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"resultList": [
{
"id": "60a7b1c2d3e4f5g6h7i8j9k0",
"name": "production",
"description": "Production environment",
"type": "PRODUCTION",
"accessUrl": "https://gw.example.com",
"status": "PUBLISHED"
},
{
"id": "60a7b1c2d3e4f5g6h7i8j9k1",
"name": "staging",
"description": "Staging environment",
"type": "SANDBOX",
"accessUrl": "https://gw-staging.example.com",
"status": "PUBLISHED"
},
{
"id": "60a7b1c2d3e4f5g6h7i8j9k2",
"name": "development",
"description": "Development environment",
"type": "TEST",
"accessUrl": "https://gw-dev.example.com",
"status": "PUBLISHED"
}
],
"resultCount": 3
}

Response Fields

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
resultListarray[object]List of environments
resultCountintegerTotal number of environments

Environment Object

FieldTypeDescription
idstringEnvironment unique identifier
namestringEnvironment name
descriptionstringEnvironment description (optional)
typestringEnvironment type: PRODUCTION, SANDBOX, or TEST
accessUrlstringGateway access URL for this environment
statusstringPublish status: PUBLISHED, UNPUBLISHED, or REPUBLISH_REQUIRED

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Admin role required"
}

cURL Example

curl -X GET \
"https://demo.apinizer.com/apiops/environments/" \
-H "Authorization: Bearer YOUR_TOKEN"

Permissions

  • Requires a valid Personal API Access Token

Notes and Warnings

  • System-wide list: Returns every environment in the instance, not filtered by project membership
  • Project-scoped alternative: Non-admin workflows can use Get Environments by Project to list environments reachable from a project