Skip to the content
Forge

Organizations

Organizations, their deletion and restore, support access, data residency and retention.

Every path is under /api/v1; see the API for authenticating, errors and rate limits, and the schemas for the bodies.

An organization and the caller's permissions in it (any member)

GET /api/v1/orgs/{org}

Parameter In Description
org path ID

Answers:

Errors: 401, 404 (how errors look).

Rename an organization (org:manage); the slug stays

PATCH /api/v1/orgs/{org}

Parameter In Description
org path ID

Body (application/json): RenameOrganization.

Answers:

Errors: 400, 401, 403, 404, 409, 422 (how errors look).

Delete a team organization (org:delete; signed-in users only)

DELETE /api/v1/orgs/{org}

confirm must repeat the slug (else 422 confirm_mismatch); personal spaces answer 422 personal_org. Runs are cancelled, runners, tokens and webhooks stop working, and the owners get an email. They can restore it until purge_after; then its keys are shredded and its data deleted.

Parameter In Description
org path ID

Body (application/json): DeleteOrganization.

Answers:

  • 204: Deleted

Errors: 400, 401, 403, 404, 409, 422 (how errors look).

Undo an organization's deletion during the grace period (its owners)

POST /api/v1/orgs/{org}/restore

Parameter In Description
org path ID

Answers:

Errors: 401, 403, 404, 409 (how errors look).

Support access requests and grants, newest first, the last 50 (support:manage)

GET /api/v1/orgs/{org}/support

Parameter In Description
org path ID

Answers:

  • 200: OK, object with the fields below
Field Type Description
grants array of SupportGrant, required

Errors: 403, 404 (how errors look).

Give the requesting platform admin read access for 1, 24 or 72 hours (support:manage)

POST /api/v1/orgs/{org}/support/{grant}/grant

Parameter In Description
org path ID
grant path ID

Body (application/json): object.

Field Type Description
hours one of 1, 24, 72, required

Answers:

  • 204: Granted

Errors: 400, 403, 404, 409, 422 (how errors look).

Turn a support access request down (support:manage)

POST /api/v1/orgs/{org}/support/{grant}/decline

Parameter In Description
org path ID
grant path ID

Answers:

  • 204: Declined

Errors: 403, 404, 409 (how errors look).

End active support access now (support:manage)

POST /api/v1/orgs/{org}/support/{grant}/revoke

Parameter In Description
org path ID
grant path ID

Answers:

  • 204: Revoked

Errors: 403, 404, 409 (how errors look).

Deleted projects that can still be restored (empty without project:delete on the organization)

GET /api/v1/orgs/{org}/deleted-projects

Parameter In Description
org path ID

Answers:

  • 200: OK, object with the fields below
Field Type Description
projects array of DeletedProject, required

Errors: 401, 404 (how errors look).

Deleted organizations the caller owns and can still restore

GET /api/v1/deleted-orgs

Answers:

  • 200: OK, object with the fields below
Field Type Description
organizations array of DeletedOrganization, required

Errors: 401 (how errors look).

Where the organization's runs and run data may be (org:read)

GET /api/v1/orgs/{org}/residency

Parameter In Description
org path ID

Answers:

Errors: 403, 404 (how errors look).

Replace the organization's residency policy (org:manage)

PUT /api/v1/orgs/{org}/residency

No regions and no countries: anywhere. Applies to new runs; queued runs that no runner the project may use could take anymore fail with reason residency. 409 residency_locked when platform admins locked the policy.

Parameter In Description
org path ID

Body (application/json): ResidencyPolicy.

Answers:

Errors: 400, 403, 404, 409, 422 (how errors look).

How long the organization's runs keep their logs and artifacts (org:read)

GET /api/v1/orgs/{org}/retention

Logs and artifacts of a run are deleted this many days after it finished; the run record itself stays (with data_expired_at set) until the platform's record retention ends.

Parameter In Description
org path ID

Answers:

Errors: 403, 404 (how errors look).

Change the organization's retention of logs and artifacts (org:manage)

PUT /api/v1/orgs/{org}/retention

Parameter In Description
org path ID

Body (application/json): object.

Field Type Description
days integer, required Between min_days and max_days; null for the platform default.

Answers:

Errors: 400, 403, 404, 422 (how errors look).