Skip to content
Coritan Docs

Organization API: Organization deployments: Variables

The 7 Organization API operations for variables.

View as Markdown

Part of Organization deployments.

GET /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/variables

List a deployment's variables without their values, by environment, branch and key, and the env groups linked to it. environment and branch narrow the list; hint is the last four characters of a value of eight or more.

Name In Type Required Description
deployment_uuid path string (uuid) yes
org_slug path string yes
environment query string or null no Only this environment's: all, production, preview or development
branch query string or null no Only the ones set for this preview branch
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

PUT /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/variables

Set many variables in one environment (and, for preview, one branch); a variable given without value keeps its saved one. With replace every variable of that environment and branch not listed is deleted. Changes reach the deployment with its next release.

Name In Type Required
deployment_uuid path string (uuid) yes
org_slug path string yes

application/json (required)

Field Type Required Description
environment string no
branch string or null no Preview only: the branch the values apply to
vars array of VariableIn yes
vars[].key string yes
vars[].value string or null no Left out: the saved value is kept
vars[].secret boolean or null no Withheld from exports and redacted from build logs; new variables default to true
vars[].target string or null no
replace boolean no Delete every variable of this environment and branch not in vars
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

GET /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/variables/export

The .env file a release of environment reads, as text/plain: development when left out, preview or production, and for preview a branch whose own values win. Env groups and bindings are included, and build and runtime values together unless target narrows them. A value marked secret is never written: a comment at the top names its key, as it does a value that could not be read. Only the account, an Admin or Technical member of its team or an API key with a write permission may export (for an organization, its owners and admins); anyone else answers 403. Each export is rate-limited per caller and audited, without values, before it is answered.

Name In Type Required Description
deployment_uuid path string (uuid) yes
org_slug path string yes
environment query string no The environment whose file it is: development, preview or production Default: development.
branch query string or null no With environment=preview, a branch whose own values win
target query string no build, runtime or both: what a build reads, what the instances read, or both Default: both.
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Import a .env file into one environment (and branch)

Section titled Import a .env file into one environment (and branch)

POST /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/variables/import

Import a .env file into one environment (and branch). Every value is secret and reaches target as the body says. A line that is not KEY=value, a key the platform sets, or a key given twice is refused with 422 and its line number, and nothing is saved.

Name In Type Required
deployment_uuid path string (uuid) yes
org_slug path string yes

application/json (required)

Field Type Required Description
environment string no
branch string or null no
content string yes
secret boolean no Whether the imported values are secret
target string no
replace boolean no Delete every variable of this environment and branch the file does not set
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

GET /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/variables/resolved

Each key a release of environment (and branch) would read for target, and where its value comes from: branch, environment, all, group, or binding with the binding's id, kind and label. Never a value.

Name In Type Required Description
deployment_uuid path string (uuid) yes
org_slug path string yes
environment query string no The release's environment: production, preview or development; all for only the values every environment shares Default: production.
branch query string or null no With environment=preview, a branch whose own values win
target query string no build, runtime or both: what a build reads, what the instances read, or both Default: both.
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

PUT /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/variables/{key}

Set one variable in one environment, creating it when it is new. A new variable needs a value and is secret unless secret is false. A key the platform sets itself, such as PORT or one starting CORITAN_, is refused with 422.

Name In Type Required Description
deployment_uuid path string (uuid) yes
key path string yes
org_slug path string yes
environment query string no The environment it is set in: all, production, preview or development Default: all.
branch query string or null no With environment=preview, the one branch the value is for

application/json (required)

Field Type Required
value string or null no
secret boolean or null no
target string or null no
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Delete one variable of one environment

Section titled Delete one variable of one environment

DELETE /api/v1/orgs/{org_slug}/deployments/{deployment_uuid}/variables/{key}

Delete one variable of one environment. Running instances keep it until the next release; a key the environment does not have answers 404.

Name In Type Required Description
deployment_uuid path string (uuid) yes
key path string yes
org_slug path string yes
environment query string no The environment it is deleted from: all, production, preview or development Default: all.
branch query string or null no With environment=preview, the branch whose value is deleted
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.