Ana içeriğe atla

Endpoint

GET /apiops/projects/{projectName}/environmentVariables/

Authentication

Requires a Personal API Access Token.
Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name (can be “admin” for admin project)

Query Parameters

None.

Response

Success Response (200 OK)

{
  "success": true,
  "resultList": [
    {
      "projectId": "project-id",
      "name": "API_BASE_URL",
      "description": "Base URL for API calls",
      "global": false,
      "globalValue": null,
      "globalVisible": true,
      "projectName": "MyProject",
      "environmentValueList": [
        {
          "environmentName": "production",
          "value": "https://api.production.example.com",
          "visible": true
        },
        {
          "environmentName": "staging",
          "value": "https://api.staging.example.com",
          "visible": true
        }
      ]
    },
    {
      "projectId": "project-id",
      "name": "API_KEY",
      "description": "API Key for external service",
      "global": true,
      "globalValue": "secret-api-key-12345",
      "globalVisible": false,
      "projectName": "MyProject",
      "environmentValueList": null
    }
  ],
  "resultCount": 2
}

Response Fields

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

Environment Variable Object

FieldTypeDescription
projectIdstringProject ID
namestringEnvironment variable name (unique identifier)
descriptionstringEnvironment variable description
globalbooleanWhether the variable is global (true) or environment-specific (false)
globalValuestring|nullGlobal value (if global=true). Null if globalVisible=false (secret)
globalVisiblebooleanWhether global value is visible (if global=true)
projectNamestringProject name
environmentValueListarray[object]|nullList of environment-specific values (if global=false). See Environment Value Object

Environment Value Object (environmentValueList)

FieldTypeDescription
environmentNamestringEnvironment name
valuestring|nullValue for this environment. Null if visible=false (secret)
visiblebooleanWhether the value is visible (not secret)

Notes

  • Secret values (visible=false or globalVisible=false) are masked (returned as null) in list responses
  • Global variables have global=true and use globalValue
  • Environment-specific variables have global=false and use environmentValueList
  • Empty list ([]) is returned if no variables exist
  • For admin project, all variables are returned (including from other projects)

Error Response (401 Unauthorized)

{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}

Error Response (404 Not Found)

{
  "error": "not_found",
  "error_description": "Project(MyProject) was not found or user does not have privilege to access it!"
}

cURL Example

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

Permissions

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

Notes and Warnings

  • Secret Values:
    • Secret values are masked (returned as null) in list responses
    • Use Get Environment Variable endpoint to retrieve values if you have permission
  • Global vs Environment-Specific:
    • Global variables (global=true) have a single value for all environments
    • Environment-specific variables (global=false) have different values per environment
  • Admin Project:
    • For admin project, all variables are returned
    • Includes variables from other projects

Permissions

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