Ana içeriğe atla

Endpoint

GET /apiops/environments/

Authentication

Requires a Personal API Access Token with admin role.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes

Path Parameters

None.

Query Parameters

None.

Response

Success Response (200 OK)

{
  "success": true,
  "resultList": [
    {
      "name": "production",
      "description": "Production environment",
      "type": "KUBERNETES",
      "accessUrl": "https://gw.example.com",
      "status": "PUBLISHED"
    },
    {
      "name": "staging",
      "description": "Staging environment",
      "type": "KUBERNETES",
      "accessUrl": "https://gw-staging.example.com",
      "status": "PUBLISHED"
    },
    {
      "name": "development",
      "description": "Development environment",
      "type": "STANDALONE",
      "accessUrl": "https://gw-dev.example.com",
      "status": "PUBLISHED"
    }
  ],
  "resultCount": 3
}

Response Fields

FieldTypeDescription
successbooleanIndicates if the request was successful
resultListarray[object]List of environments
resultCountintegerTotal number of environments

Environment Object

FieldTypeDescription
namestringEnvironment name
descriptionstringEnvironment description (optional)
typestringEnvironment type (e.g., KUBERNETES, DOCKER, STANDALONE)
accessUrlstringGateway access URL for this environment
statusstringPublish status (e.g., PUBLISHED, NOT_PUBLISHED)

Error Response (401 Unauthorized)

{
  "error": "unauthorized",
  "error_description": "Admin role required"
}

Error Response (403 Forbidden)

{
  "error": "forbidden",
  "error_description": "Insufficient permissions"
}

cURL Example

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

Permissions

  • User must have system admin (sysAdmin) role

Notes and Warnings

  • Admin Only: This endpoint requires system admin role
  • Regular users should use “Get Environments by Project” endpoint instead