Organizations

Tenancy — organizations, members, roles, invitations, join codes, org-owned tokens.

Endpoints · 17
POST/v1/organizations/createclient.organizations.create

Create an organization. The acting user becomes its first owner.

create(input: { name: string; }): Promise<{ organization: Organization; }>;
POST/v1/organizations/getclient.organizations.get

Get one organization (requires org:view).

get(input: { organizationId: string; }): Promise<{ organization: Organization; }>;
POST/v1/organizations/invitations/acceptclient.organizations.invitations.accept

Accept an invitation with its token — the acting user BECOMES a member. The user's email must match the invited address. No prior membership needed.

accept(input: { token: string; }): Promise<{ organizationId: string; role: OrgRole; }>;
POST/v1/organizations/invitations/createclient.organizations.invitations.create

Create an invitation for an email (requires members:manage). Returns the one-time `token` (the invite link) — email delivery lands with the mail App.

create(input: { organizationId: string; email: string; role?: OrgRole; }): Promise<OrgInvitationCreated>;
POST/v1/organizations/invitations/listclient.organizations.invitations.list

List pending invitations (requires members:manage).

list(input: { organizationId: string; }): Promise<{ invitations: OrgInvitation[]; }>;
POST/v1/organizations/invitations/revokeclient.organizations.invitations.revoke

Revoke a pending invitation (requires members:manage).

revoke(input: { organizationId: string; id: string; }): Promise<{ ok: true; }>;
POST/v1/organizations/join-codes/createclient.organizations.joinCodes.create

Create a shareable join code (requires members:manage). `maxUses` null = unlimited.

create(input: { organizationId: string; role?: OrgRole; maxUses?: number; }): Promise<OrgJoinCodeCreated>;
POST/v1/organizations/join-codes/joinclient.organizations.joinCodes.join

Join an organization with a code — the acting user BECOMES a member. No prior membership needed. `alreadyMember` true if they were already in the org.

join(input: { code: string; }): Promise<{ organizationId: string; role: OrgRole; alreadyMember: boolean; }>;
POST/v1/organizations/join-codes/listclient.organizations.joinCodes.list

List join codes (requires members:manage).

list(input: { organizationId: string; }): Promise<{ joinCodes: OrgJoinCode[]; }>;
POST/v1/organizations/join-codes/revokeclient.organizations.joinCodes.revoke

Revoke a join code (requires members:manage).

revoke(input: { organizationId: string; id: string; }): Promise<{ ok: true; }>;
POST/v1/organizations/listclient.organizations.list

List the organizations the acting user belongs to (with their role).

list(): Promise<{ organizations: OrgMembership[]; }>;
POST/v1/organizations/members/listclient.organizations.members.list

List an organization's members (requires members:view).

list(input: { organizationId: string; }): Promise<{ members: OrgMember[]; }>;
POST/v1/organizations/members/removeclient.organizations.members.remove

Remove a member (idempotent; requires members:manage). 409 `last_owner` if it would leave the org with zero owners.

remove(input: { organizationId: string; userId: string; }): Promise<{ ok: true; }>;
POST/v1/organizations/members/set-roleclient.organizations.members.setRole

Change a member's role (requires members:manage). 409 `last_owner` if it would leave the org with zero owners.

setRole(input: { organizationId: string; userId: string; role: OrgRole; }): Promise<{ ok: true; }>;
POST/v1/organizations/rolesclient.organizations.roles

The role→permission matrix (no org scope needed).

roles(): Promise<OrgRoleMatrix>;
POST/v1/organizations/tokens/createclient.organizations.tokens.create

Mint an organization-owned api-token (requires org:manage). The secret + `bearer` (`<key>:<secret>`) are returned ONCE.

create(input: { organizationId: string; name?: string; env?: "live" | "test"; }): Promise<{ apiToken: { key: string; secret: string; lastFour: string; bearer: string; }; }>;
POST/v1/organizations/updateclient.organizations.update

Rename an organization (requires org:manage).

update(input: { organizationId: string; name: string; }): Promise<{ ok: true; }>;
Widgets · 14

Embeddable React components for this App. Click one to preview its UI. Previews render the component only — live data calls are disabled here (wire the Provider's basePath to a connector, as the Console does, to make them functional).