> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Environment Variable

> Retrieves a specific environment variable by name. Returns full details including values (secret values are masked if not visible).

## Endpoint

```plaintext theme={null}
GET /apiops/projects/{projectName}/environmentVariables/{name}/
```

## Authentication

Requires a Personal API Access Token.

### Header

```plaintext theme={null}
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value          | Required |
| ------------- | -------------- | -------- |
| Authorization | Bearer {token} | Yes      |

### Path Parameters

| Parameter   | Type   | Required | Description                                     |
| ----------- | ------ | -------- | ----------------------------------------------- |
| projectName | string | Yes      | Project name (can be "admin" for admin project) |
| name        | string | Yes      | Environment variable name                       |

### Query Parameters

None.

## Response

### Success Response (200 OK)

```json theme={null}
{
   "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](/api-reference/environment-variables/crud/list-environment-variables) for field descriptions.

### Notes

* Secret values (`visible=false` or `globalVisible=false`) are masked (returned as `null`)
* Returns single environment variable matching the name

### Error Response (400 Bad Request)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "Environment variable (name: API_BASE_URL) was not found!"
}
```

## cURL Example

```bash theme={null}
curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/environmentVariables/API_BASE_URL/" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Permissions

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

## Related Documentation

* [List Environment Variables](/api-reference/environment-variables/crud/list-environment-variables) - List all environment variables
* [Create Environment Variable](/api-reference/environment-variables/crud/create-environment-variable) - Create a new environment variable
