organizations
26 endpoints
get /invites/{token}
Get public invite info by token
No authentication
Public endpoint returning the invite's role, expiry, and org name. Deliberately omits the invitee email.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| token | path | string | yes | Invite token |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
delete /invites/{token}
Decline an invite by token
No authentication
Public invitee-side reject. Possession of the plaintext token is the proof.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| token | path | string | yes | Invite token |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
post /invites/{token}/accept
Accept an invite by token
Requires authentication
Authenticated accept via the URL-supplied plaintext token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| token | path | string | yes | Invite token |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
delete /invites/by-id/{id}
Decline a pending invite by id
Requires authentication
Authenticated decline for the /invites/pending list. The server matches the invite's email to the caller's.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Invite id |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
post /invites/by-id/{id}/accept
Accept a pending invite by id
Requires authentication
Authenticated accept for the /invites/pending list. The server matches the invite's email to the caller's.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Invite id |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
get /invites/pending
List the caller's pending invites
Requires authentication
Returns pending invitations addressed to the authenticated user's email.
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
get /orgs
List the caller's organizations
Requires authentication
Returns every organization the caller belongs to, each with its member count.
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
post /orgs
Create an organization
Requires authentication
Creates a new organization owned by the caller. A user may create at most 5 organizations in any 24 hours; the sixth is refused with 429 ORG_CREATE_LIMIT.
Request body: dto.CreateOrgRequest
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | yes |
Responses
- 201 Created · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
- 429 Too Many Requests · apimodel.ErrorEnvelope
get /orgs/{id}
Get an organization by id
Requires authentication
Returns the organization detail plus its live member count.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
patch /orgs/{id}
Update an organization
Requires authentication
Updates an organization's mutable fields and returns the trimmed summary.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Request body: dto.UpdateOrgRequest
| Name | Type | Required | Description |
|---|---|---|---|
| aiEnabled | boolean | no | AIEnabled is a pointer so nil means "leave unchanged": a client that only renames the org must not switch AI off by omitting the field. |
| avatarUrl | string | no | |
| name | string | no |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
get /orgs/{id}/audit-log
Get an organization's audit log
Requires authentication
Returns recent audit events, most-recent first. Owner/admin only. Offset-paginated (bounded admin list).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
| limit | query | integer | no | Page size (default 50) |
| offset | query | integer | no | Row offset (default 0) |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
post /orgs/{id}/delete
Delete an organization
Requires authentication
Owners only. Needs the organization's name typed and a re-authentication (the current password, or the code from POST /orgs/{id}/deletion-code). Every subscription that has not ended is cancelled at Stripe first; if Stripe does not confirm, nothing is deleted (502 BILLING_CANCEL_FAILED). Then the organization is deleted and every member, pending invite and organization API key loses access at once. Its data is purged after 30 days; billing and time records are kept for the statutory period. nextOrgId is where the caller continues: another of their organizations, or a new empty workspace (newWorkspace) when this was their last. A wrong password or code is 403 REAUTH_FAILED. Irreversible.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Request body: dto.DeleteOrgRequest
| Name | Type | Required | Description |
|---|---|---|---|
| code | string | no | Code is required when it has none. |
| confirmName | string | no | ConfirmName is the organization's name, typed by the owner. |
| password | string | no | Password is required when the account has one. |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
- 429 Too Many Requests · apimodel.ErrorEnvelope
- 502 Bad Gateway · apimodel.ErrorEnvelope
get /orgs/{id}/deletion-check
What deleting an organization will do
Requires authentication
Whether the caller may delete the organization (owners only), how they confirm it (password or a mailed code), how many other people lose access, whether a subscription is cancelled first and whether accounting records are kept. Read-only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
post /orgs/{id}/deletion-code
Mail a code that confirms deleting an organization
Requires authentication
For an owner whose account has no password: mails a 6-digit code (10 minutes, 5 attempts) that confirms POST /orgs/{id}/delete. 400 for an account with a password. Rate-limited per user.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
- 429 Too Many Requests · apimodel.ErrorEnvelope
get /orgs/{id}/get-started
State of the first-run Get started card
Requires authentication
Whether the dashboard shows its Get started card to the caller, and how far its three steps are. Visible is false for anyone who is not an owner or admin of the organization, for an organization that never had the card, and once the card was hidden or finished. Finishing the last step hides the card for good.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
post /orgs/{id}/get-started/hide
Hide the first-run Get started card
Requires authentication
Hides the Get started card for the whole organization. Owner/admin only. Idempotent.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
- 404 Not Found · apimodel.ErrorEnvelope
post /orgs/{id}/invite
Invite a member to an organization
Requires authentication
Invites a single email to the org. Admin/owner only. The plaintext token is returned only in test mode.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Request body: dto.InviteMemberRequest
| Name | Type | Required | Description |
|---|---|---|---|
| string | yes | ||
| projects | dto.ProjectGrantInput[] | no | Projects the invitee joins on redemption. Empty is legitimate: an admin reaches every project without a grant, and a member invited with no projects simply has nothing to open yet. |
| role | string (admin | member | guest) | no |
Responses
- 201 Created · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
get /orgs/{id}/invites
List an organization's sent invites
Requires authentication
Returns pending invitations sent by the organization. Admin/owner only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
delete /orgs/{id}/invites/{inviteId}
Cancel a pending invitation
Requires authentication
Cancels a pending invitation. Admin/owner only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
| inviteId | path | integer | yes | Invite id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
post /orgs/{id}/invites/{inviteId}/resend
Resend an invitation email
Requires authentication
Re-sends the invitation email for a pending invite. Admin/owner only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
| inviteId | path | integer | yes | Invite id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
post /orgs/{id}/invites/bulk
Bulk-invite members
Requires authentication
Invites many emails in one call and returns a per-email success/failure list.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Request body: dto.BulkInviteRequest
| Name | Type | Required | Description |
|---|---|---|---|
| emails | string[] | yes | |
| role | string (admin | member | guest) | no |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
get /orgs/{id}/members
List an organization's members
Requires authentication
Returns the org member roster. Admin/owner only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
delete /orgs/{id}/members/{memberId}
Remove a member from an organization
Requires authentication
Removes a user from the org (cascades to project memberships). Admin/owner only.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
| memberId | path | integer | yes | Member id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
patch /orgs/{id}/members/{memberId}/role
Update a member's role
Requires authentication
Owner-only. Rejects role=owner (use transfer-ownership) and self-targeting.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
| memberId | path | integer | yes | Member id |
Request body: dto.UpdateMemberRoleRequest
| Name | Type | Required | Description |
|---|---|---|---|
| role | string (owner | admin | member | guest) | yes |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope
delete /orgs/{id}/members/me
Leave an organization
Requires authentication
Removes the caller from the org. Refused if the caller is the sole owner.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Responses
- 200 OK · object
- 401 Unauthorized · apimodel.ErrorEnvelope
- 409 Conflict · apimodel.ErrorEnvelope
post /orgs/{id}/transfer-ownership
Transfer organization ownership
Requires authentication
Owner-only atomic owner swap.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | integer | yes | Organization id |
Request body: dto.TransferOwnershipRequest
| Name | Type | Required | Description |
|---|---|---|---|
| newOwnerUserId | integer | yes |
Responses
- 200 OK · object
- 400 Bad Request · apimodel.ErrorEnvelope
- 401 Unauthorized · apimodel.ErrorEnvelope
- 403 Forbidden · apimodel.ErrorEnvelope