---
title: "Get deployment variable"
method: GET
path: "/v1/workspaces/{workspaceId}/deployment-variables/{variableId}"
---

# Get deployment variable

`GET /v1/workspaces/{workspaceId}/deployment-variables/{variableId}`

Returns a specific deployment variable by ID.

## Path parameters

- `workspaceId` string, required
- `variableId` string, required

## Response `200`

The requested deployment variable

- DeploymentVariableWithValues
  - `values` DeploymentVariableValue[], required
    - `deploymentVariableId` string, required
    - `id` string, required
    - `priority` integer, required
    - `resourceSelector` string — A CEL expression to select which resources this value applies to
    - `value` union, required
      - union
        - boolean
        - number
        - integer
        - string
        - ObjectValue
          - `object` object, required
        - true
      - ReferenceValue
        - `path` string[], required
        - `reference` string, required
      - SensitiveValue
        - `valueHash` string, required
  - `variable` DeploymentVariable, required
    - `deploymentId` string, required
    - `description` string
    - `id` string, required
    - `key` string, required

## Other responses

- `400` — Invalid request
- `404` — Resource not found

## Changes

- **2026-04-23** `4d1982997771` — 1 warning
  - removed the optional property `variable/defaultValue` from the response with the `200` status
- **2026-03-11** `71783130f04a` — 1 breaking, 1 info
  - the `values/items/resourceSelector` response's property type/format changed from ``/`` to `string`/`` for status `200`
  - removed `#/components/schemas/JsonSelector, #/components/schemas/CelSelector` from the `values/items/resourceSelector` response property `oneOf` list for the response status `200`
- **2026-02-19** `4107c747f3f1` — 1 info
  - endpoint added
- **2026-02-19** `e61389fc98ac` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/changes/v1/workspaces/:workspaceId/deployment-variables/:variableId/get.md)

---

[API](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api.md) · [All operations](https://skmtc.dev/ctrlplanedev/apis/ctrlplane-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ctrlplanedev/ctrlplane-api/revisions/156e0d264995/schema)
