Organization API: Organization deployments: Variables
The 3 Organization API operations for variables.
Part of Organization deployments.
Operations
Section titled Operations| Method | Path | Summary |
|---|---|---|
| PUT | /api/v1/orgs/{org_slug}/env-groups/{group_uuid}/variables |
Set or replace a group's variables |
| PUT | /api/v1/orgs/{org_slug}/env-groups/{group_uuid}/variables/{key} |
Set a group variable |
| DELETE | /api/v1/orgs/{org_slug}/env-groups/{group_uuid}/variables/{key} |
Delete one variable of one environment of a group; 404 when it has none |
Set or replace a group's variables
Section titled Set or replace a group's variablesPUT /api/v1/orgs/{org_slug}/env-groups/{group_uuid}/variables
Set many variables in one environment of a group, as on a deployment.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
group_uuid |
path | string (uuid) | yes |
org_slug |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required | Description |
|---|---|---|---|
environment |
string | no | |
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 not in vars |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Set a group variable
Section titled Set a group variablePUT /api/v1/orgs/{org_slug}/env-groups/{group_uuid}/variables/{key}
Set one variable in one environment of a group.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
group_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. |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
value |
string or null | no |
secret |
boolean or null | no |
target |
string or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Delete one variable of one environment of a group; 404 when it has none
Section titled Delete one variable of one environment of a group; 404 when it has noneDELETE /api/v1/orgs/{org_slug}/env-groups/{group_uuid}/variables/{key}
Delete one variable of one environment of a group; 404 when it has none.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
group_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. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |