Docs

Get a deployment's variables

GET
/deployments/{deployment_id}/variables

Returns the variable values the deployment froze when it was made. Later changes to the project's variables do not affect them. A secret reads back as {"secret": true}.

Authorization

oauth2 deployment.read, variable.read
headerAuthorizationBearer <token>

Scope: deployment.read, variable.read

Path Parameters

deployment_id*string

The unique identifier of the deployment.

Match^dep_[a-zA-Z0-9_-]+$

Query Parameters

project_id*string

The unique identifier of the project

Match^[a-zA-Z0-9_-]+$

Response Body

The deployment's variables were retrieved successfully.

application/json
  1. response

The variables a deployment froze, keyed by name.

An empty object is an ordinary answer, not an error.

[key: string]?|||

One resolved variable. A non-secret variable is its value; a secret is an object saying so and withholding the value.

The two forms mirror the update body, so a value read here can be written back unchanged — with the one asymmetry that a secret read back has no value to write.

Example Request
import { createZitadelClient } from "@zitadel/api/client";const client = createZitadelClient({  baseUrl: process.env.ZITADEL_URL ?? "http://localhost:8080",  token: process.env.ZITADEL_PROJECT_SECRET!, // server-side only});const deploymentVariables = await client.getDeploymentVariables(  "dep_01KX4SB9C8E1F0N9WD3P2E4YM5",  { project_id: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" },);
Example Response
{  "property1": "string",  "property2": "string"}

Was this helpful?