Help · API reference
Teams
Teams (called accounts in paths): members, invitations, projects and the audit log.
Get an accountGET /api/v1/accounts/{account}
Returns one team the caller belongs to: its id, slug, name, type and plan, and the caller's role in it. Any member may read it.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)
200 Success.
What comes back
accountobject, requiredidstring, requiredslugstring, requirednamestring, requiredtypestring, requiredplanstring, required
rolestring, required: The caller’s role in the team.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - default Any other failure, as RFC 9457 problem details.
List account assignmentsGET /api/v1/accounts/{account}/assignments
Lists which members are assigned to which of the team's projects, as user and project ids with the role on each, for the whole team in one unpaged data list. Needs the draft-read permission.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)
200 Success.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - default Any other failure, as RFC 9457 problem details.
List account audit eventsGET /api/v1/accounts/{account}/audit-events
Returns the team's audit log, newest first, with the result of the last chain verification. Filter with project, actor, category and security=1; page with limit (up to 500) and before, passing the next value back. format=ndjson streams the whole log, oldest first. Needs the team-audit permission.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)actor(query, string, optional)before(query, string, optional)category(query, string, optional)format(query, string, optional)limit(query, integer, optional), at most 500, default 100project(query, string, optional)security(query, string, optional)
200 Success.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - 404 Not found. Also returned when the resource exists but the caller may not see it, so that the two cannot be told apart. (
codeisnot_found.) - 422 Validation failed. The body carries an
issuesarray describing each rejected field. (codeisvalidation_failed.) - default Any other failure, as RFC 9457 problem details.
Create an account invitationPOST /api/v1/accounts/{account}/invitations
Invites a person by email into the team, or as a guest on one project (project_id), and emails them a link that is valid for 14 days. Needs the team-members permission. project_id and projects cannot be combined, owners and admins take no projects, and an address that is already a member or blocked by the team's access list is refused.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)
Body (application/json)
emailstring (email), required, 3 to 320 characters, matches ^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$role"owner" | "admin" | "developer" | "editor" | "reviewer" | "viewer" | "tester", requiredproject_idstring (uuid), matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$: Invite them as a guest on this one project, rather than into the team.projectsarray of object, at most 500 items: The projects a team member will work on, each with an optional role. Not withproject_id.A list of:
idstring (uuid), required, matches ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$role"owner" | "admin" | "developer" | "editor" | "reviewer" | "viewer" | "tester"
201 Success.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - 404 Not found. Also returned when the resource exists but the caller may not see it, so that the two cannot be told apart. (
codeisnot_found.) - 409 Conflict. (
codeisconflict.) - 422 Validation failed. The body carries an
issuesarray describing each rejected field. (codeisvalidation_failed.) - default Any other failure, as RFC 9457 problem details.
Delete an account invitationDELETE /api/v1/accounts/{account}/invitations/{id}
Revokes a pending invitation, so its link no longer admits anyone. Needs the team-members permission. The revocation is recorded in the team's audit log.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)id(path, string)
200 Success.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - 404 Not found. Also returned when the resource exists but the caller may not see it, so that the two cannot be told apart. (
codeisnot_found.) - default Any other failure, as RFC 9457 problem details.
List account membersGET /api/v1/accounts/{account}/members
Lists the team's members with their role and join date. Owners and admins also get each member's email and the pending invitations; everyone else sees names and masked addresses. Unpaged.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)
200 Success.
What comes back
dataarray of object, requiredA list of:
user_idstring, requiredemailstring | null, required: In full for an owner or admin. Others see a masked address for a member with no name, and null otherwise.namestring | null, requiredrolestring, requiredjoined_atstring, required: ISO 8601 timestamp.
invitationsarray of object, required: Pending invitations; empty unless the caller is an owner or admin.A list of:
idstring, requiredemailstring, requiredrolestring, requiredproject_idstring | null, requiredprojectsarray of object, required: The projects they will work on, each with the role they will have there.A list of:
idstring, requiredrolestring, required
expires_atstring, required: ISO 8601 timestamp.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - default Any other failure, as RFC 9457 problem details.
Update an account memberPATCH /api/v1/accounts/{account}/members/{userId}
Changes a member's team role and reconnects their open editor sessions under the new role. Needs the team-members permission. Only an owner may grant ownership or change another owner, and the last owner cannot be demoted.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)userId(path, string)
Body (application/json)
role"owner" | "admin" | "developer" | "editor" | "reviewer" | "viewer" | "tester", required
200 Success.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - 404 Not found. Also returned when the resource exists but the caller may not see it, so that the two cannot be told apart. (
codeisnot_found.) - 409 Conflict. (
codeisconflict.) - 422 Validation failed. The body carries an
issuesarray describing each rejected field. (codeisvalidation_failed.) - default Any other failure, as RFC 9457 problem details.
Delete an account memberDELETE /api/v1/accounts/{account}/members/{userId}
Removes a member from the team and closes their open editor connections. Needs the team-members permission. Only an owner may remove another owner, and the team's last owner cannot be removed.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)userId(path, string)
200 Success.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - 404 Not found. Also returned when the resource exists but the caller may not see it, so that the two cannot be told apart. (
codeisnot_found.) - 409 Conflict. (
codeisconflict.) - default Any other failure, as RFC 9457 problem details.
Replace a member assignmentPUT /api/v1/accounts/{account}/members/{userId}/assignments
Replaces the full list of projects a member works on, each with an optional role that defaults to their team role; projects left out are taken away. Needs the team-members permission. Owners and admins are refused, since they already reach every project; ids of projects not in the team are skipped.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)userId(path, string)
Body (application/json)
projectsarray of object, at most 500 items, default []: Every project the member works on, replacing the list they had.A list of:
idstring, required: A project of this team. An id that is not (a project deleted since) is skipped.role"owner" | "admin" | "developer" | "editor" | "reviewer" | "viewer" | "tester": Their role on that project; defaults to their team role.
200 Success.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - 404 Not found. Also returned when the resource exists but the caller may not see it, so that the two cannot be told apart. (
codeisnot_found.) - 422 Validation failed. The body carries an
issuesarray describing each rejected field. (codeisvalidation_failed.) - default Any other failure, as RFC 9457 problem details.
List account projectsGET /api/v1/accounts/{account}/projects
Lists the team's projects the caller can see: all of them for owners and admins, otherwise the assigned ones. Projects scheduled for deletion are included with deleted_at and purge_after. Unpaged data list.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)
200 Success.
What comes back
dataarray of object, requiredA list of:
idstring, requiredslugstring, requirednamestring, requiredstatusstring, requiredstatestring, requiredlive_branchstring, requiredpublish_policystring, requiredhas_publishedboolean, required: Has this project ever served anything?status: activeonly means the repository is ready, minutes before the first build lands.created_atstring, required: ISO 8601 timestamp.my_sessionobject: The caller’s own newest editing session here; absent when they have none.idstring, requiredtitlestring, requiredupdated_atstring, required: ISO 8601 timestamp.
deleted_atstring: Present only while a deletion is pending.purge_afterstring: Present only while a deletion is pending.clone_urlstring: Where to push; sent only while the project waits for its first push.
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - default Any other failure, as RFC 9457 problem details.
Create an account projectPOST /api/v1/accounts/{account}/projects
Creates a project from a template (template, starter by default: an id from GET /api/v1/templates, or team:<id> for one of the team's own from GET /api/v1/accounts/{account}/templates) and queues its setup; the answer is 201 with the project's id, slug and status, and setup continues in the background. Needs the project-create permission. A slug already used in the team, or a reserved one, is refused, and so is a team already at its project limit.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)Idempotency-Key(header, string, optional): Optional. A key the caller chooses, at most 160 characters, kept per team. A repeat of the same request (method, path and body) under the same key is answered with the first result and the headerIdempotent-Replay: true, and the work is not done twice. The same key with a different request answers 409; so does a repeat sent while the first is still running, withRetry-After: 5.
Body (application/json)
namestring, required, 1 to 80 charactersslugstring, at most 60 characterstemplatestring, 1 to 60 characters, default "starter"
201 Success. Headers: Idempotent-Replay.
What comes back
idstring, requiredslugstring, requiredstatusstring, requiredmessagestring, required
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - 409 Conflict. (
codeisconflict.) - 422 Validation failed. The body carries an
issuesarray describing each rejected field. (codeisvalidation_failed.) - default Any other failure, as RFC 9457 problem details.
List account templatesGET /api/v1/accounts/{account}/templates
Lists the templates the team saved from its own projects, newest first, with each one's template (pass it as template when creating a project in this team), status (only ready can start a project; failed carries its error), the project it came from, its size and its pages, plus the team's limits. Needs the project-create permission (owner and admin). Another team's templates are never listed and cannot be used.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)
200 Success.
What comes back
dataarray of object, requiredA list of:
idstring, requiredtemplatestring, required: What to pass astemplatewhen creating a project:team:<id>.namestring, requireddescriptionstring, requiredstatus"saving" | "ready" | "failed", required: Only areadyone can start a project.errorstring: Why afailedone was not saved.source_projectstring, required: The name of the project it was saved from, when it was saved.source_project_idstring | null, required: Null once that project is deleted.source_commitstring, requiredstack_versionstring | null, requiredbytesnumber | null, requiredfilesnumber | null, requiredpagesarray of string, requiredcreated_bystring | null, requiredcreated_atstring, required: ISO 8601 timestamp.
limitsobject, requiredcountnumber, required: How many templates a team may keep (MAX_TEMPLATES_PER_ACCOUNT).bytesnumber, required: How large one may be as stored (MAX_TEMPLATE_BYTES).
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 403 Not allowed. (
codeisforbidden.) - default Any other failure, as RFC 9457 problem details.
Get account usageGET /api/v1/accounts/{account}/usage
Returns the team's usage against the platform caps: projects, builds in the last 24 hours and queued jobs, each with used and limit, plus the upload and per-project media size limits. Any member may read it.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
account(path, string)
200 Success.
What comes back
projectsobject, requiredusednumber, requiredlimitnumber, required
builds_24hobject, requiredusednumber, requiredlimitnumber, required
queued_jobsobject, requiredusednumber, requiredlimitnumber, required
upload_bytesobject, requiredlimitnumber, required
media_bytes_per_projectobject, requiredlimitnumber, required
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - default Any other failure, as RFC 9457 problem details.
List teamsGET /api/v1/teams
Lists the teams the caller belongs to, with their role and the counts of members, live projects and projects being deleted, unpaged. scope=all and scope=others are the deployment operator's view, paged with cursor and next and searchable with search.
Who may call it: A signed-in session, or an access token (write to change anything)
Parameters
cursor(query, string, optional)limit(query, integer, optional), at most 200, default 50scope(query, string, optional)search(query, string, optional)
200 Success.
What comes back
scope"mine" | "all" | "others", requiredtotalnumber: Withscope=allorothersonly.nextstring | null: Withscope=allorothersonly: thecursorfor the next page.dataarray of object, requiredA list of:
idstring, requiredslugstring, requirednamestring, requiredtypestring, requiredplanstring, requiredrolestring | null, required: The caller’s role; null for a team they are not in.created_atstring, required: ISO 8601 timestamp.deleted_atstring: Present only while a deletion is pending.membersnumber, requiredprojectsnumber, requiredprojects_deletingnumber, required
Errors it can answer
- 401 Authentication required. (
codeisunauthenticated.) - 404 Not found. Also returned when the resource exists but the caller may not see it, so that the two cannot be told apart. (
codeisnot_found.) - default Any other failure, as RFC 9457 problem details.