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

# List Agent Variables

> List an environment's variables for an agent.

### Overview

Returns the variables stored for one of the agent's environments, sorted by key. Agent configuration refers to a variable as `{{env.KEY}}`, and the environment a call runs as decides which set is substituted: `production` for normal calls, `staging` when calling the staging pin, and `dev` for dev, branch, or specific-version calls. Set values with [Set Agent Variable](https://docs.bland.ai/api-v2/put/agents-id-environments-env-variables-key.md).

### Headers

**authorization** `string` *required*

Your API key for authentication.

### Path Parameters

**agent\_id** `string` *required*

The agent's unique identifier.

**env** `string` *required*

One of `dev`, `staging`, `production`. Any other value returns `400 INVALID_ENV`.

### Response

**data** `array`

Array of variable objects ordered by `variable_key` ascending. Empty when the environment has no variables.

**variable object**

**variable\_key** `string`

The variable's key, as referenced by `{{env.KEY}}`.

**value** `any`

The stored value: any JSON value. For a variable saved with `is_secret`, this is the `{{SECRET.NAME}}` reference the server stored in place of the raw value; the secret itself is never returned.

**updated\_at** `string`

ISO 8601 timestamp of the last write.

**errors** `null | array`

`null` on success, or a list of error objects if the request failed.

```json Response theme={null}
{
  "data": [
    {
      "variable_key": "CRM_API_KEY",
      "value": "{{SECRET.AGENT_8ffa3e15_b4fc_485d_b6cf_bded7a6ee070_PRODUCTION_43524d5f4150495f4b4559}}",
      "updated_at": "2026-09-09T20:14:33.602Z"
    },
    {
      "variable_key": "CRM_BASE_URL",
      "value": "https://crm.example.com/api",
      "updated_at": "2026-09-09T20:13:58.117Z"
    },
    {
      "variable_key": "OFFICE_HOURS",
      "value": {
        "open": "08:00",
        "close": "17:30",
        "timezone": "America/Chicago"
      },
      "updated_at": "2026-09-10T11:47:05.940Z"
    }
  ],
  "errors": null
}
```

```json Invalid Env theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "INVALID_ENV",
      "message": "env must be one of: dev, staging, production"
    }
  ]
}
```

```json Not Found theme={null}
{
  "data": null,
  "errors": [
    {
      "error": "NOT_FOUND",
      "message": "Agent not found"
    }
  ]
}
```

***

Docs for agents: [llms.txt](https://docs.bland.ai/llms.txt)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.