Projects
An organization's projects, their deletion and restore, residency and status badges.
Every path is under /api/v1; see the API for authenticating, errors and rate
limits, and the schemas for the bodies.
The organization's projects the caller may read
GET /api/v1/orgs/{org}/projects
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
projects |
array of Project, required |
Errors: 401, 404 (how errors look).
Create a project (project:create)
POST /api/v1/orgs/{org}/projects
| Parameter | In | Description |
|---|---|---|
org |
path | ID |
Body (application/json): CreateProject.
Answers:
201: Created, Project
Errors: 400, 401, 403, 404, 409, 422 (how errors look).
A project and the caller's permissions in it (project:read)
GET /api/v1/projects/{project}
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, Project
Errors: 401, 404 (how errors look).
Change name, description or runner setting (project:manage); the slug stays
PATCH /api/v1/projects/{project}
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): UpdateProject.
Answers:
200: OK, Project
Errors: 400, 401, 403, 404, 422 (how errors look).
Delete a project (project:delete)
DELETE /api/v1/projects/{project}
Its runs are cancelled and it disappears at once. Holders of project:delete on the
organization can restore it until purge_after; then it is purged and its slug is free.
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
204: Deleted
Errors: 401, 403, 404 (how errors look).
Undo a project's deletion during the grace period (project:delete on the organization)
POST /api/v1/projects/{project}/restore
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: Restored, Project
Errors: 401, 404, 409 (how errors look).
Where the project's runs and run data may be (project:read)
GET /api/v1/projects/{project}/residency
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, Residency
Errors: 403, 404 (how errors look).
Replace the project's own residency rules (project:manage)
PUT /api/v1/projects/{project}/residency
They narrow the organization's policy, never widen it; 422 no_countries when they would
leave none of its countries. No regions and no countries: the organization's policy.
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): ResidencyPolicy.
Answers:
200: OK, Residency
Errors: 400, 403, 404, 422 (how errors look).
The project's status badges (project:read)
GET /api/v1/projects/{project}/badges
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Answers:
200: OK, object with the fields below
| Field | Type | Description |
|---|---|---|
badges |
array of Badge, required |
Errors: 403, 404 (how errors look).
Make a status badge of a template, trigger or stored flow (project:manage); at most 50 per project
POST /api/v1/projects/{project}/badges
| Parameter | In | Description |
|---|---|---|
project |
path | ID |
Body (application/json): object.
| Field | Type | Description |
|---|---|---|
branch |
string | Only this branch's runs count; empty or left out for every run. |
kind |
one of template, trigger, flow, required |
|
label |
string, required | What the badge says on its left. |
target_id |
ID, required |
Answers:
201: Created, Badge
Errors: 400, 403, 404, 409, 422 (how errors look).
Delete a status badge (project:manage); its URL stops working within a minute
DELETE /api/v1/badges/{badge}
| Parameter | In | Description |
|---|---|---|
badge |
path | ID |
Answers:
204: Deleted
Errors: 403, 404 (how errors look).