API reference

Organization

8 endpoints under /v1/organizations.

Read Current Org

get/v1/organizations/current

Read the caller's current organization.

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Update Current Org

patch/v1/organizations/current

Update org name, billing email or settings. Audited atomically with the mutation: ORGANIZATION_RENAMED iff name changed, otherwise ORGANIZATION_UPDATED.

Headers

  • X-Organization-IDstringoptional

Request body

  • namestringoptional
  • billing_emailstring (email)optional
  • settingsobjectoptional

Failures return the error envelope; branch on error_code.

Request
Response

List Invitations

get/v1/organizations/current/invitations

List pending (unaccepted, unexpired) invitations.

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Create Invitation

post/v1/organizations/current/invitations

Invite a new member to the org. The member_invite OperationSpec enforces max_members, shared with the agent-tool path. The ORG_INVITATION_SENT audit row commits with the invitation.

Headers

  • X-Organization-IDstringoptional

Request body

  • emailstring (email)required
  • rolestringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Revoke Invitation

delete/v1/organizations/current/invitations/{invitation_id}

Revoke a pending invitation. Ownership by the caller's org is checked before delegating, since the service takes only the invitation id; this blocks cross-org deletion.

Path parameters

  • invitation_idstring (uuid)required

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

List Members

get/v1/organizations/current/members

List every member of the caller's org.

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Update Member

patch/v1/organizations/current/members/{user_id}

Change a member's role. Emits ORG_MEMBER_ROLE_CHANGED; demoting the last owner is refused (RemoveMemberError).

Path parameters

  • user_idstring (uuid)required

Headers

  • X-Organization-IDstringoptional

Request body

  • rolestringrequired

Failures return the error envelope; branch on error_code.

Request
Response

Remove Member

delete/v1/organizations/current/members/{user_id}

Remove a member from the org, revoking the API keys they owned.

Path parameters

  • user_idstring (uuid)required

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response