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.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {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
| Field | Type | Description |
|---|---|---|
| status | string | Response status: SUCCESS or FAILURE |
| resultList | array[object] | List of environments |
| resultCount | integer | Total number of environments |
Environment Object
| Field | Type | Description |
|---|---|---|
| id | string | Environment unique identifier |
| name | string | Environment name |
| description | string | Environment description (optional) |
| type | string | Environment type: PRODUCTION, SANDBOX, or TEST |
| accessUrl | string | Gateway access URL for this environment |
| status | string | Publish 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
Related Documentation
- Get Environments by Project - Get environments for a specific project
- Authentication Guide - How to obtain and use API tokens