---
title: "List an agent's environment variables"
method: GET
path: "/api/v1/agents/{agent}/agent_env_vars"
---

# List an agent's environment variables

`GET /api/v1/agents/{agent}/agent_env_vars`

Returns all environment variables defined for the specified agent. Variable
values are always masked in the response; only the last four characters are
visible. To inspect a specific variable, use the retrieve endpoint.

The authenticated user must have access to the agent's parent app. Pass the
app scope via the `app` parameter when calling with an API key that is scoped
to a specific app. Results are returned in an unordered flat list.

## Path parameters

- `agent` string, required

## Response `200`

Successful response

- AgentEnvVarMaskedList — Flat list of masked environment variables belonging to an agent.
  - `data` AgentEnvVarMasked[], required — Array of masked environment variable objects for the agent.
    - `agent` string, required — ID of the agent this environment variable belongs to (`agt_...`).
    - `created_at` string, date-time — When the environment variable was created (ISO 8601).
    - `description` string — Optional human-readable note describing the purpose of this variable. `null` if not set.
    - `id` string, required — Environment variable ID (`anv_...`).
    - `key` string, required — Name of the environment variable as it appears in the agent's runtime.
    - `masked_value` string, required — Redacted representation of the secret value. The last four characters are preserved; all preceding characters are replaced with `****`. Returns `****` when the value is absent or four characters or fewer.
    - `updated_at` string, date-time — When the environment variable was last updated (ISO 8601).

## Other responses

- `401` — Unauthorized
- `403` — App-scoped token required. Use a token scoped to the target app.; Forbidden
- `404` — Agent not found

---

[API](https://skmtc.net/archastro/apis/archastro-platform-api.md) · [All operations](https://skmtc.net/archastro/apis/archastro-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/archastro/archastro-platform-api/versions/a8772b442f86/schema)
