Variables and secrets
Variables and secrets of organizations, projects, environments and variable groups.
Every path is under /api/v1; see the API for authenticating, errors and rate
limits, and the schemas for the bodies.
The organization's variables, in their saved order
GET /api/v1/orgs/{org}/variables
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 404 (how errors look).
Save the order of the organization's variables (variable:write)
PATCH /api/v1/orgs/{org}/variables
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 400, 403, 404, 422 (how errors look).
Create or replace an organization variable
PUT /api/v1/orgs/{org}/variables/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
name |
path | string |
Body (application/json): VariableInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete an organization variable
DELETE /api/v1/orgs/{org}/variables/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
The project's own variables, in their saved order
GET /api/v1/projects/{project}/variables
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 404 (how errors look).
Save the order of the project's variables (variable:write)
PATCH /api/v1/projects/{project}/variables
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 400, 403, 404, 422 (how errors look).
What a run of the project gets without env of its own (project:read)
GET /api/v1/projects/{project}/variables/effective
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
variables |
array of PlacedVariable, required |
Errors: 404, 422 (how errors look).
Create or replace a project variable
PUT /api/v1/projects/{project}/variables/{name}
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
name |
path | string |
Body (application/json): VariableInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete a project variable
DELETE /api/v1/projects/{project}/variables/{name}
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
The organization's secrets, without values, in their saved order (org:read)
GET /api/v1/orgs/{org}/secrets
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 404 (how errors look).
Save the order of the organization's secrets (secret:write)
PATCH /api/v1/orgs/{org}/secrets
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 400, 403, 404, 422 (how errors look).
Create an organization secret, add a version or change its settings (secret:write)
PUT /api/v1/orgs/{org}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
name |
path | string |
Body (application/json): SecretInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete an organization secret and all its versions (secret:write)
DELETE /api/v1/orgs/{org}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
An organization secret's kept versions (org:read)
GET /api/v1/orgs/{org}/secrets/{name}/versions
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
name |
path | string |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
versions |
array of SecretVersion, required | Kept versions, newest first. Never values. |
Errors: 404 (how errors look).
Make a kept older version current again (secret:write)
POST /api/v1/orgs/{org}/secrets/{name}/rollback
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
name |
path | string |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
version |
integer, required |
Answers:
200: OK, Secret
Errors: 400, 403, 404, 422 (how errors look).
The project's own secrets, without values, in their saved order (project:read)
GET /api/v1/projects/{project}/secrets
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 404 (how errors look).
Save the order of the project's secrets (secret:write)
PATCH /api/v1/projects/{project}/secrets
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 400, 403, 404, 422 (how errors look).
The secrets a run of the project could ask for, each from the level it would come from; never values (project:read)
GET /api/v1/projects/{project}/secrets/effective
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
secrets |
array of PlacedSecret, required |
Errors: 404 (how errors look).
Create a project secret, add a version or change its settings (secret:write)
PUT /api/v1/projects/{project}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
name |
path | string |
Body (application/json): SecretInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete a project secret and all its versions (secret:write)
DELETE /api/v1/projects/{project}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
A project secret's kept versions (project:read)
GET /api/v1/projects/{project}/secrets/{name}/versions
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
name |
path | string |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
versions |
array of SecretVersion, required | Kept versions, newest first. Never values. |
Errors: 404 (how errors look).
Make a kept older version current again (secret:write)
POST /api/v1/projects/{project}/secrets/{name}/rollback
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
name |
path | string |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
version |
integer, required |
Answers:
200: OK, Secret
Errors: 400, 403, 404, 422 (how errors look).
The environment's own variables (project:read): a level between the project's and a template's, for runs that deploy to it
GET /api/v1/environments/{environment}/variables
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 404 (how errors look).
Save the order of the environment's variables (variable:write)
PATCH /api/v1/environments/{environment}/variables
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 400, 403, 404, 422 (how errors look).
What a run of the project that deploys to the environment gets without env of its own (project:read)
GET /api/v1/environments/{environment}/variables/effective
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
variables |
array of PlacedVariable, required |
Errors: 404, 422 (how errors look).
Create or replace an environment variable (variable:write)
PUT /api/v1/environments/{environment}/variables/{name}
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
name |
path | string |
Body (application/json): VariableInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete an environment variable (variable:write)
DELETE /api/v1/environments/{environment}/variables/{name}
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
The environment's secrets, without values (project:read): only runs that deploy to it get them, before the project's of the same name
GET /api/v1/environments/{environment}/secrets
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 404 (how errors look).
Save the order of the environment's secrets (secret:write)
PATCH /api/v1/environments/{environment}/secrets
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 400, 403, 404, 422 (how errors look).
The secrets a run that deploys to the environment could ask for; never values (project:read)
GET /api/v1/environments/{environment}/secrets/effective
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
secrets |
array of PlacedSecret, required |
Errors: 404 (how errors look).
Create an environment secret, add a version or change its settings (secret:write)
PUT /api/v1/environments/{environment}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
name |
path | string |
Body (application/json): SecretInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete an environment secret and all its versions (secret:write)
DELETE /api/v1/environments/{environment}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
An environment secret's kept versions (project:read)
GET /api/v1/environments/{environment}/secrets/{name}/versions
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
name |
path | string |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
versions |
array of SecretVersion, required | Kept versions, newest first. Never values. |
Errors: 404 (how errors look).
Make a kept older version current again (secret:write)
POST /api/v1/environments/{environment}/secrets/{name}/rollback
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
name |
path | string |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
version |
integer, required |
Answers:
200: OK, Secret
Errors: 400, 403, 404, 422 (how errors look).
The organization's variable and secret groups, by name (org:read)
GET /api/v1/orgs/{org}/variable-groups
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may create, change, delete and attach groups. |
groups |
array of VariableGroup, required |
Errors: 404 (how errors look).
Create a group (variable:write and secret:write on the organization)
POST /api/v1/orgs/{org}/variable-groups
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
default |
boolean | Include it in every project without attaching it (at most 10 groups); refused when a project's runs could no longer resolve their variables. |
description |
string | |
name |
string | |
parent |
string | The group this one builds on (its own values win); "" for none. A group and the groups it builds on are at most 5. |
Answers:
201: OK, VariableGroup
Errors: 400, 403, 404, 422 (how errors look).
A group (org:read)
GET /api/v1/orgs/{org}/variable-groups/{variableGroup}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Answers:
200: OK, VariableGroup
Errors: 404 (how errors look).
Rename a group or change its description or parent (variable:write and secret:write on the organization)
PATCH /api/v1/orgs/{org}/variable-groups/{variableGroup}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
default |
boolean | Include it in every project without attaching it (at most 10 groups); refused when a project's runs could no longer resolve their variables. |
description |
string | |
name |
string | |
parent |
string | The group this one builds on (its own values win); "" for none. A group and the groups it builds on are at most 5. |
Answers:
200: OK, VariableGroup
Errors: 400, 403, 404, 422 (how errors look).
Delete a group with its variables and secrets (variable:write and secret:write on the organization); refused while it is attached anywhere or another group builds on it
DELETE /api/v1/orgs/{org}/variable-groups/{variableGroup}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Answers:
204: Deleted
Errors: 403, 404, 422 (how errors look).
The group's own variables, in their saved order (org:read)
GET /api/v1/orgs/{org}/variable-groups/{variableGroup}/variables
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 404 (how errors look).
Save the order of the group's variables (variable:write on the organization)
PATCH /api/v1/orgs/{org}/variable-groups/{variableGroup}/variables
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set and delete these variables. |
variables |
array of Variable, required |
Errors: 400, 403, 404, 422 (how errors look).
The group's variables with the platform's, the organization's and its parents' (org:read)
GET /api/v1/orgs/{org}/variable-groups/{variableGroup}/variables/effective
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
variables |
array of PlacedVariable, required |
Errors: 404, 422 (how errors look).
Create or replace a group variable (variable:write on the organization)
PUT /api/v1/orgs/{org}/variable-groups/{variableGroup}/variables/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
name |
path | string |
Body (application/json): VariableInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete a group variable (variable:write on the organization)
DELETE /api/v1/orgs/{org}/variable-groups/{variableGroup}/variables/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
The group's secrets, without values, in their saved order (org:read)
GET /api/v1/orgs/{org}/variable-groups/{variableGroup}/secrets
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 404 (how errors look).
Save the order of the group's secrets (secret:write on the organization)
PATCH /api/v1/orgs/{org}/variable-groups/{variableGroup}/secrets
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Body (application/json): OrderInput.
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_write |
boolean, required | The caller may set, roll back and delete these secrets. |
secrets |
array of Secret, required |
Errors: 400, 403, 404, 422 (how errors look).
The group's secrets with the organization's and its parents'; never values (org:read)
GET /api/v1/orgs/{org}/variable-groups/{variableGroup}/secrets/effective
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
secrets |
array of PlacedSecret, required |
Errors: 404 (how errors look).
Create a group secret, add a version or change its settings (secret:write on the organization)
PUT /api/v1/orgs/{org}/variable-groups/{variableGroup}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
name |
path | string |
Body (application/json): SecretInput.
Answers:
Errors: 400, 403, 404, 422 (how errors look).
Delete a group secret and all its versions (secret:write on the organization)
DELETE /api/v1/orgs/{org}/variable-groups/{variableGroup}/secrets/{name}
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
name |
path | string |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).
A group secret's kept versions (org:read)
GET /api/v1/orgs/{org}/variable-groups/{variableGroup}/secrets/{name}/versions
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
name |
path | string |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
versions |
array of SecretVersion, required | Kept versions, newest first. Never values. |
Errors: 404 (how errors look).
Make a kept older version current again (secret:write on the organization)
POST /api/v1/orgs/{org}/variable-groups/{variableGroup}/secrets/{name}/rollback
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
variableGroup |
path | string: A variable and secret group's name. |
name |
path | string |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
version |
integer, required |
Answers:
200: OK, Secret
Errors: 400, 403, 404, 422 (how errors look).
The groups attached to the project, in order; a later one wins (project:read)
GET /api/v1/projects/{project}/variable-groups
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may change which groups are attached. |
groups |
array of VariableGroup, required | In order; a later group wins over an earlier one. |
Errors: 404 (how errors look).
Replace the groups attached to the project, in order (variable:write and secret:write on the organization); refused when its runs could no longer resolve their variables
PUT /api/v1/projects/{project}/variable-groups
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
groups |
array of string, required | Group names in order, a later one winning; empty detaches all. |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may change which groups are attached. |
groups |
array of VariableGroup, required | In order; a later group wins over an earlier one. |
Errors: 400, 403, 404, 422 (how errors look).
The groups attached to the environment, in order; a later one wins (project:read)
GET /api/v1/environments/{environment}/variable-groups
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may change which groups are attached. |
groups |
array of VariableGroup, required | In order; a later group wins over an earlier one. |
Errors: 404 (how errors look).
Replace the groups attached to the environment, in order (variable:write and secret:write on the organization); refused when its runs could no longer resolve their variables
PUT /api/v1/environments/{environment}/variable-groups
| Parameter | In | Description |
|---|---|---|
environment |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
groups |
array of string, required | Group names in order, a later one winning; empty detaches all. |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
can_manage |
boolean, required | The caller may change which groups are attached. |
groups |
array of VariableGroup, required | In order; a later group wins over an earlier one. |
Errors: 400, 403, 404, 422 (how errors look).