Skip to content
Docs menu

orgs

Organizations and membership (CRUD-lite)

12 operations · 16 schemas

GET /v1/orgs

List my organizations

listMyOrgs · scope key:read

Orgs the caller belongs to, with their role in each.

Parameters

listMyOrgs parameters
NameInTypeDescription
limitqueryinteger

default 20 · ≥ 1 · ≤ 100

Page size.

cursorquerystring

length ≤ 512

Opaque cursor from the previous page's next_cursor.

Responses

listMyOrgs responses
StatusDescriptionBody
200

Page of org memberships.

OrgMembershipPage
401

Missing or invalid credentials.

Problemapplication/problem+json

POST /v1/orgs

Create an organization

createOrg · scope key:write

Creates an org with the caller as owner member. Org slugs and usernames share one handle namespace.

Request body

application/json · required · OrgCreate

createOrg request body
FieldTypeDescription
slugrequiredSlug
display_namestring | null

length ≤ 128

descriptionstring | null

length ≤ 4096

Responses

createOrg responses
StatusDescriptionBody
201

Org created.

Org
401

Missing or invalid credentials.

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

GET /v1/orgs/{org}

Get an organization

getOrg · scope none

Public org profile.

Parameters

getOrg parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

Responses

getOrg responses
StatusDescriptionBody
200

The org.

Org
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json

PATCH /v1/orgs/{org}

Update an organization

updateOrg · scope key:write

Only members with role owner may update.

Parameters

updateOrg parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

Request body

application/json · required · OrgUpdate

updateOrg request body
FieldTypeDescription
display_namestring | null

length ≤ 128

descriptionstring | null

length ≤ 4096

avatar_urlstring (uri) | null (uri)
require_second_approverboolean

Require a second person to approve a deployment onto this organization's robots.

Responses

updateOrg responses
StatusDescriptionBody
200

Updated org.

Org
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

GET /v1/orgs/{org}/members

List organization members

listOrgMembers · scope key:read

Visible to org members only.

Parameters

listOrgMembers parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

limitqueryinteger

default 20 · ≥ 1 · ≤ 100

Page size.

cursorquerystring

length ≤ 512

Opaque cursor from the previous page's next_cursor.

Responses

listOrgMembers responses
StatusDescriptionBody
200

Page of members.

MemberPage
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json

PUT /v1/orgs/{org}/members/{username}

Add or update a member

putOrgMember · scope session

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

putOrgMember parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

usernamerequiredpathSlug

User handle.

Request body

application/json · required · MemberPut

putOrgMember request body
FieldTypeDescription
rolerequiredOrgRole

Responses

putOrgMember responses
StatusDescriptionBody
200

Membership created or updated.

Member
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

DELETE /v1/orgs/{org}/members/{username}

Remove a member

removeOrgMember · scope key:write

owner members may remove anyone; any member may remove themselves (leave). Removing the last owner is rejected.

Parameters

removeOrgMember parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

usernamerequiredpathSlug

User handle.

Responses

removeOrgMember responses
StatusDescriptionBody
204

Membership removed.

401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json

GET /v1/orgs/{org}/invites

List an organization's invites

listOrgInvites · scope key:read

Owners only: each address invited, its role, who invited it, and whether the invite is pending, accepted, revoked or expired. Newest first.

Parameters

listOrgInvites parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

statusqueryOrgInviteStatus

Only invites in this state.

limitqueryinteger

default 20 · ≥ 1 · ≤ 100

Page size.

cursorquerystring

length ≤ 512

Opaque cursor from the previous page's next_cursor.

Responses

listOrgInvites responses
StatusDescriptionBody
200

A page of invites.

OrgInvitePage
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json

POST /v1/orgs/{org}/invites

Invite someone to an organization by e-mail

createOrgInvite · scope session

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

createOrgInvite parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

Request body

application/json · required · OrgInviteCreate

createOrgInvite request body
FieldTypeDescription
emailrequiredstring (email)

length 3–254

The address to invite. Stored lower-cased.

roleOrgRole

default "member"

The role the person will have once they accept.

Responses

createOrgInvite responses
StatusDescriptionBody
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.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

DELETE /v1/orgs/{org}/invites/{invite_id}

Revoke an invite

revokeOrgInvite · scope key:write

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

revokeOrgInvite parameters
NameInTypeDescription
orgrequiredpathSlug

Org slug.

invite_idrequiredpathId

Invite id (orginv_...).

Responses

revokeOrgInvite responses
StatusDescriptionBody
204

The invite is revoked.

401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json

GET /v1/org-invites/{token}

Read an invite through its link

getOrgInvite · scope none

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

getOrgInvite parameters
NameInTypeDescription
tokenrequiredpathstring

pattern ^[A-Za-z0-9_-]{32,64}$

The token from an invite link (/invites/{token}).

Responses

getOrgInvite responses
StatusDescriptionBody
200

The invite, as its link shows it.

OrgInvitePreview
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json

POST /v1/org-invites/{token}/accept

Accept an invite and join the organization

acceptOrgInvite · scope session

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

acceptOrgInvite parameters
NameInTypeDescription
tokenrequiredpathstring

pattern ^[A-Za-z0-9_-]{32,64}$

The token from an invite link (/invites/{token}).

Responses

acceptOrgInvite responses
StatusDescriptionBody
200

The new membership.

OrgMembership
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json

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

object

OrgMembershipPage fields
FieldTypeDescription
itemsrequiredarray of OrgMembership
next_cursorrequiredstring | null

OrgCreate

object

OrgCreate fields
FieldTypeDescription
slugrequiredSlug
display_namestring | null

length ≤ 128

descriptionstring | null

length ≤ 4096

Org

object

Org fields
FieldTypeDescription
idrequiredId
slugrequiredSlug
display_namestring | null

length ≤ 128

descriptionstring | null

length ≤ 4096

avatar_urlstring (uri) | null (uri)
require_second_approverboolean

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 (updateOrg).

created_atrequiredstring (date-time)
updated_atrequiredstring (date-time)

OrgUpdate

object

All fields optional; omitted fields are unchanged.

OrgUpdate fields
FieldTypeDescription
display_namestring | null

length ≤ 128

descriptionstring | null

length ≤ 4096

avatar_urlstring (uri) | null (uri)
require_second_approverboolean

Require a second person to approve a deployment onto this organization's robots.

MemberPage

object

MemberPage fields
FieldTypeDescription
itemsrequiredarray of Member
next_cursorrequiredstring | null

MemberPut

object

MemberPut fields
FieldTypeDescription
rolerequiredOrgRole

Member

object

Member fields
FieldTypeDescription
userrequiredUserPublic
rolerequiredOrgRole
created_atrequiredstring (date-time)

OrgInviteStatus

string

one of pending · accepted · revoked · expired

pending until someone accepts it, an owner revokes it, or seven days pass (expired).

OrgInvitePage

object

OrgInvitePage fields
FieldTypeDescription
itemsrequiredarray of OrgInvite
next_cursorrequiredstring | null

OrgInviteCreate

object

OrgInviteCreate fields
FieldTypeDescription
emailrequiredstring (email)

length 3–254

The address to invite. Stored lower-cased.

roleOrgRole

default "member"

The role the person will have once they accept.

OrgInviteCreated

OrgInvite and object

OrgInviteCreated fields
FieldTypeDescription
idrequiredId
emailrequiredstring

length ≤ 254

rolerequiredOrgRole
statusrequiredOrgInviteStatus
invited_byrequiredUserPublic | null

The owner who sent it; null once that account is gone.

accepted_byUserPublic | null

Who accepted it, once someone has.

created_atrequiredstring (date-time)
expires_atrequiredstring (date-time)
accepted_atstring (date-time) | null (date-time)
revoked_atstring (date-time) | null (date-time)
accept_pathrequiredstring

The link's path on the hub's web app, /invites/{token}. Shown in this response only.

accept_urlrequiredstring | 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 accept_path.

mailedrequiredboolean

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

object

OrgInvitePreview fields
FieldTypeDescription
orgrequiredOrg
rolerequiredOrgRole
statusrequiredOrgInviteStatus
invited_byrequiredUserPublic | null
email_hintrequiredstring

The invited address with its local part masked: s***@university.edu.

expires_atrequiredstring (date-time)
viewerrequiredOrgInviteViewer | null

Whether the signed-in caller may accept it; null for an anonymous caller.

OrgMembership

object

OrgMembership fields
FieldTypeDescription
orgrequiredOrg
rolerequiredOrgRole

OrgRole

string

one of owner · member

OrgInvite

object

OrgInvite fields
FieldTypeDescription
idrequiredId
emailrequiredstring

length ≤ 254

rolerequiredOrgRole
statusrequiredOrgInviteStatus
invited_byrequiredUserPublic | null

The owner who sent it; null once that account is gone.

accepted_byUserPublic | null

Who accepted it, once someone has.

created_atrequiredstring (date-time)
expires_atrequiredstring (date-time)
accepted_atstring (date-time) | null (date-time)
revoked_atstring (date-time) | null (date-time)

OrgInviteViewer

object

OrgInviteViewer fields
FieldTypeDescription
usernamerequiredSlug
may_acceptrequiredboolean
reasonrequiredstring | null

one of member · other_account · not_pending · needs_session

Why not, when may_accept is false:

  • member: already in the organization;
  • other_account: the address belongs to another account here;
  • not_pending: used, revoked or expired;
  • needs_session: an API key cannot accept.
messagerequiredstring | null

The same reason as one sentence a page can show.