Ana içeriğe geç

Get Environment Variable

Endpoint

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

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name (can be "admin" for admin project)
namestringYesEnvironment variable name

Query Parameters

None.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"resultList": [
{
"projectId": "project-id",
"name": "API_BASE_URL",
"description": "Base URL for API calls",
"global": false,
"globalVisible": true
}
],
"resultCount": 1
}

Response Fields

Same as List Environment Variables. See List Environment Variables for field descriptions.

Notes

  • All values are stored encrypted at rest. Values that are not Secret (visible=true / globalVisible=true) are returned decrypted, so a CI/CD pipeline can read the real configuration
  • Secret values (visible=false or globalVisible=false) are always returned as null and can never be read back through any endpoint
  • Returns single environment variable matching the name

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Environment variable (API_BASE_URL) is not found!"
}

cURL Example

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

Permissions

User must have GLOBAL_SETTINGS + VIEW permission in the project (or at least one project permission if the asset category is not configured). See Environment Variables API.