orgs
Organizations and membership (CRUD-lite)
GET / v1/ orgs
List my organizations
Orgs the caller belongs to, with their role in each.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | Page size. |
cursor | query | string | Opaque cursor from the previous page's |
Responses
| Status | Description | Body |
|---|---|---|
200 | Page of org memberships. | OrgMembershipPage |
401 | Missing or invalid credentials. | Problem |
POST / v1/ orgs
Create an organization
Creates an org with the caller as owner member. Org slugs and usernames share one handle namespace.
Request body
| Field | Type | Description |
|---|---|---|
slug | Slug | |
display_name | string | null | |
description | string | null |
Responses
GET / v1/ orgs/ {org}
Get an organization
Public org profile.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org | path | Slug | Org slug. |
Responses
PATCH / v1/ orgs/ {org}
Update an organization
Only members with role owner may update.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org | path | Slug | Org slug. |
Request body
| Field | Type | Description |
|---|---|---|
display_name | string | null | |
description | string | null | |
avatar_url | string (uri) | null (uri) | |
require_second_approver | boolean | Require a second person to approve a deployment onto this organization's robots. |
Responses
GET / v1/ orgs/ {org}/ members
List organization members
Visible to org members only.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org | path | Slug | Org slug. |
limit | query | integer | Page size. |
cursor | query | string | Opaque cursor from the previous page's |
Responses
| Status | Description | Body |
|---|---|---|
200 | Page of members. | MemberPage |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
PUT / v1/ orgs/ {org}/ members/ {username}
Add or update a member
Upserts a membership with the given role. Only owner members may call, signed in: no API key can add a member or change a role. A member can approve the organization's deployments and spending, so a key must not be able to make one. An org must keep at least one owner.
Parameters
Request body
| Field | Type | Description |
|---|---|---|
role | OrgRole |
Responses
DELETE / v1/ orgs/ {org}/ members/ {username}
Remove a member
owner members may remove anyone; any member may remove themselves (leave). Removing the last owner is rejected.
Parameters
Responses
| Status | Description | Body |
|---|---|---|
204 | Membership removed. | |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
GET / v1/ orgs/ {org}/ invites
List an organization's invites
Owners only: each address invited, its role, who invited it, and whether the invite is pending, accepted, revoked or expired. Newest first.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org | path | Slug | Org slug. |
status | query | OrgInviteStatus | Only invites in this state. |
limit | query | integer | Page size. |
cursor | query | string | Opaque cursor from the previous page's |
Responses
| Status | Description | Body |
|---|---|---|
200 | A page of invites. | OrgInvitePage |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
POST / v1/ orgs/ {org}/ invites
Invite someone to an organization by e-mail
An owner invites a person by e-mail address and chooses the role they will have. The hub sends one e-mail that names who invited them and to which organization, with a link to accept. The address does not need an account yet: the person signs in or signs up from the link. The link works once and expires after seven days. Only a signed-in person may invite, so no API key can make the hub send e-mail. An organization holds at most 50 pending invites, and one pending invite per address (409 for a second).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org | path | Slug | Org slug. |
Request body
| Field | Type | Description |
|---|---|---|
email | string (email) | The address to invite. Stored lower-cased. |
role | OrgRole | The role the person will have once they accept. |
Responses
| Status | Description | Body |
|---|---|---|
201 | The invite, with its link. The link is in this response only: the hub keeps a hash of it. | OrgInviteCreated |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
422 | Request failed validation. | Problem |
DELETE / v1/ orgs/ {org}/ invites/ {invite_id}
Revoke an invite
An owner revokes a pending invite, and its link stops working. Revoking an invite that is already revoked or expired changes nothing. An accepted invite is 409: the person is a member, so remove the member instead.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
org | path | Slug | Org slug. |
invite_id | path | Id | Invite id ( |
Responses
| Status | Description | Body |
|---|---|---|
204 | The invite is revoked. | |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
GET / v1/ org-invites/ {token}
Read an invite through its link
Returns what the invite link shows before anyone accepts it: the organization, who invited, the role, the expiry and the state. The address is shown with its local part masked. The token from the link is the only way to name an invite here. So anyone holding the link may read it. A signed-in caller also learns whether they may accept it. An unknown token is 404.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token | path | string | The token from an invite link ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The invite, as its link shows it. | OrgInvitePreview |
404 | Resource not found (or hidden from the caller). | Problem |
POST / v1/ org-invites/ {token}/ accept
Accept an invite and join the organization
The signed-in person joins the organization with the invite's role, and the link stops working. When the invited address belongs to an account on this hub, only that account may accept (403 for any other). An unknown token is 404. A used, revoked or expired invite is 409, and so is a person who is already a member. Only a signed-in person may accept: joining is a person's decision.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
token | path | string | The token from an invite link ( |
Responses
| Status | Description | Body |
|---|---|---|
200 | The new membership. | OrgMembership |
401 | Missing or invalid credentials. | Problem |
403 | Authenticated but not allowed (visibility, membership or scope). | Problem |
404 | Resource not found (or hidden from the caller). | Problem |
409 | State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...). | Problem |
Schemas (16)
The schemas these operations reach before any other tag’s do. A type that links elsewhere is rendered on that tag’s page.
OrgMembershipPage
| Field | Type | Description |
|---|---|---|
items | array of OrgMembership | |
next_cursor | string | null |
OrgCreate
| Field | Type | Description |
|---|---|---|
slug | Slug | |
display_name | string | null | |
description | string | null |
Org
| Field | Type | Description |
|---|---|---|
id | Id | |
slug | Slug | |
display_name | string | null | |
description | string | null | |
avatar_url | string (uri) | null (uri) | |
require_second_approver | boolean | When true, a deployment onto one of this organization's robots needs a second person. Whoever asked for it cannot approve it, whether they asked by session or with one of their keys. Off by default. Only an owner changes it ( |
created_at | string (date-time) | |
updated_at | string (date-time) |
OrgUpdate
All fields optional; omitted fields are unchanged.
| Field | Type | Description |
|---|---|---|
display_name | string | null | |
description | string | null | |
avatar_url | string (uri) | null (uri) | |
require_second_approver | boolean | Require a second person to approve a deployment onto this organization's robots. |
MemberPage
| Field | Type | Description |
|---|---|---|
items | array of Member | |
next_cursor | string | null |
MemberPut
| Field | Type | Description |
|---|---|---|
role | OrgRole |
Member
| Field | Type | Description |
|---|---|---|
user | UserPublic | |
role | OrgRole | |
created_at | string (date-time) |
OrgInviteStatus
pending until someone accepts it, an owner revokes it, or seven days pass (expired).
OrgInvitePage
| Field | Type | Description |
|---|---|---|
items | array of OrgInvite | |
next_cursor | string | null |
OrgInviteCreate
| Field | Type | Description |
|---|---|---|
email | string (email) | The address to invite. Stored lower-cased. |
role | OrgRole | The role the person will have once they accept. |
OrgInviteCreated
| Field | Type | Description |
|---|---|---|
id | Id | |
email | string | |
role | OrgRole | |
status | OrgInviteStatus | |
invited_by | UserPublic | null | The owner who sent it; null once that account is gone. |
accepted_by | UserPublic | null | Who accepted it, once someone has. |
created_at | string (date-time) | |
expires_at | string (date-time) | |
accepted_at | string (date-time) | null (date-time) | |
revoked_at | string (date-time) | null (date-time) | |
accept_path | string | The link's path on the hub's web app, |
accept_url | string | null | The whole link, on the web origin this hub knows. Null when it knows none, and then the web app adds its own origin to |
mailed | boolean | True when the hub handed the e-mail to its mail provider. False where this hub sends no e-mail; share the link yourself then. |
OrgInvitePreview
| Field | Type | Description |
|---|---|---|
org | Org | |
role | OrgRole | |
status | OrgInviteStatus | |
invited_by | UserPublic | null | |
email_hint | string | The invited address with its local part masked: |
expires_at | string (date-time) | |
viewer | OrgInviteViewer | null | Whether the signed-in caller may accept it; null for an anonymous caller. |
OrgMembership
OrgRole
OrgInvite
| Field | Type | Description |
|---|---|---|
id | Id | |
email | string | |
role | OrgRole | |
status | OrgInviteStatus | |
invited_by | UserPublic | null | The owner who sent it; null once that account is gone. |
accepted_by | UserPublic | null | Who accepted it, once someone has. |
created_at | string (date-time) | |
expires_at | string (date-time) | |
accepted_at | string (date-time) | null (date-time) | |
revoked_at | string (date-time) | null (date-time) |
OrgInviteViewer
| Field | Type | Description |
|---|---|---|
username | Slug | |
may_accept | boolean | |
reason | string | null | Why not, when
|
message | string | null | The same reason as one sentence a page can show. |