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

# Pull environment variables

> Read the decrypted variables and dotenv representation for one environment.

Read the decrypted variables and dotenv representation for one environment.

Use a developer access key. This endpoint is part of the [CLI API](/api-reference/cli/overview), with its own response format and rate limit.

Required scopes: `env:read`.

The key owner must still be a workspace owner or administrator. Missing scope or admin access returns `403`; an unavailable or differently pinned project returns `404`. An unknown environment returns `404`. The response contains plaintext secrets; keep it out of logs and browser clients. The example only contains a non-secret label.

## Parameters

<ParamField query="recordId" type="string" required>
  Nonempty project record ID. Must match the key’s project pin, if set.
</ParamField>

<ParamField query="env" type="string" required>
  1–40 characters; letters, numbers, hyphens, or underscores, starting with a letter or number. Names are trimmed.
</ParamField>

## Response

**200** — Top-level `environment`, snapshot `version`, `vars` string map, and serialized `dotenv` string.

<ResponseExample>
  ```json 200 theme={null}
  {
    "environment": "development",
    "version": 1,
    "vars": {
      "PUBLIC_LABEL": "Northlane"
    },
    "dotenv": "PUBLIC_LABEL=Northlane\n"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash Request theme={null}
  curl --fail-with-body --silent --show-error --get \
    "https://api.getkato.io/cli/v1/env/pull" \
    -H "Authorization: Bearer $KATO_API_KEY" \
    --data-urlencode "recordId=$KATO_RECORD_ID" \
    --data-urlencode "env=development"
  ```
</RequestExample>


## Related topics

- [All endpoints](/api-reference/endpoints.md)
- [CLI API](/api-reference/cli/overview.md)
- [Developer quickstart](/api-reference/quickstart.md)
- [Push environment variables](/api-reference/cli/push.md)
- [Kato CLI](/documentation/cli.md)
