Ana içeriğe atla

Endpoint

GET /apiops/projects/{projectName}/environments/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name

Query Parameters

None.

Response

Success Response (200 OK)

{
  "success": true,
  "resultList": [
    {
      "environmentName": "production",
      "description": "Production environment"
    },
    {
      "environmentName": "staging",
      "description": "Staging environment"
    }
  ],
  "resultCount": 2
}

Response Fields

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

Environment Object

FieldTypeDescription
environmentNamestringEnvironment name
descriptionstringEnvironment description (optional)

Error Response (400 Bad Request)

{
  "error": "bad_request",
  "error_description": "Project not found"
}

Error Response (401 Unauthorized)

{
  "error": "unauthorized",
  "error_description": "Invalid or expired token"
}

Error Response (403 Forbidden)

{
  "error": "forbidden",
  "error_description": "User does not have access to this project"
}

cURL Example

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

Permissions

  • User must have any permission in the project (read access)

Notes and Warnings

  • Project Membership: User must be a member of the project to access environments
  • Returns only environments accessible through project membership
  • Project Access: If user doesn’t have access to the project, returns 403 Forbidden