These endpoints let you browse environments and manage their environment variables programmatically. Use them to bulk-import config from another secrets manager, keep credentials in sync with CI, or build dashboards on top of Autosana. All requests require an API key in theDocumentation Index
Fetch the complete documentation index at: https://docs.autosana.ai/llms.txt
Use this file to discover all available pages before exploring further.
X-API-Key header. See API Reference for authentication and the standard 401 / 403 / 429 / 500 error shapes shared by every endpoint on this page.
Environments themselves (create / rename / delete) are managed from the dashboard. The API surface here covers env vars and read access to the environments that contain them.
List Environments
Returns every environment in your organization with its env vars nested. Plaintext values come back in full; secret values are masked as"***".
GET
/api/v1/environments — Returns 200 OKExample Request
Response Fields
List of environments.
Total number of environments returned.
Example Response
Create Env Var
POST
/api/v1/env-vars — Returns 201 Created. Returns 409 Conflict if an env var with the same key already exists on this environment.Request Body
UUID of the environment this variable belongs to.
Variable name (1–255 characters). Referenced from flows and curl hooks as
${env:KEY}.Variable value — must be a non-empty string. Empty values are rejected with
422 because they’re indistinguishable from “unset” at consumption time. For secrets, this is written to vault and never returned by any read endpoint.Optional human-readable note.
Defaults to
false. When true, the value is stored encrypted in vault and is never readable back through the API.Example Request (plaintext)
Example Request (secret)
Example Response
Get Env Var
GET
/api/v1/env-vars/{env_var_id} — Returns 200 OK with the same shape as items in List Environments’ env_vars, or 404 if the var does not exist. Secret values are returned as "***".UUID of the env var.
Update Env Var
Update an env var. Only provided fields change; omitted fields are unchanged.PATCH
/api/v1/env-vars/{env_var_id} — Returns 200 OK. 400 if no recognized fields are provided. 404 if the var does not exist. 409 if renaming key collides with another env var in the same environment. 422 for invalid transitions (see below).UUID of the env var.
New variable name (1–255 characters). Note: any flows or curl hooks that reference the old name as
${env:OLD_KEY} must be updated in lockstep — there is no automatic rewrite. Collisions with another env var in the same environment return 409.New value. Omit to keep the existing value unchanged. Required when changing
is_secret in either direction (the API never re-uses the existing value across a secret/plaintext transition). null is treated as “no change”, not “clear” — there is no way to clear a value without deleting the row.New description. Pass
"" or null to explicitly clear (this is the only field where null clears rather than meaning “no change”).Move the var between plaintext and vault-encrypted storage. Switching the flag in either direction requires
value.Secret transition rules
| Existing state | Request | Result |
|---|---|---|
| Plaintext | value: "new" | Plaintext value rewritten in place. |
| Plaintext | is_secret: true, no value | 422 — promoting to secret requires a value. |
| Plaintext | is_secret: true, value: "secret-x" | New vault row written; row repointed to it. |
| Secret | value: "rotated" | New vault row written, old one cleaned up after the row is repointed. |
| Secret | is_secret: false, no value | 422 — demoting to plaintext requires a value. |
| Secret | is_secret: false, value: "plain" | Old vault row cleaned up, plaintext value written. |
Example Request
Delete Env Var
Deletes the env var. If the var is a secret, its vault entry is cleaned up too.DELETE
/api/v1/env-vars/{env_var_id} — Returns 204 No Content, or 404 if the var does not exist.UUID of the env var.