API reference

Organization

8 endpoints under /v1/organizations.

Read the caller's current organization.

get/v1/organizations/current

Requiresorganizations:admin

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Update org name, billing email or settings.

patch/v1/organizations/current

Audited atomically with the mutation: ORGANIZATION_RENAMED iff name changed, otherwise ORGANIZATION_UPDATED.

Requiresorganizations:admin

Headers

  • X-Organization-IDstringoptional

Request body

  • namestringoptional
  • billing_emailstring (email)optional
  • settingsobjectoptional

Failures return the error envelope; branch on error_code.

Request
Response

List pending (unaccepted, unexpired) invitations.

get/v1/organizations/current/invitations

Requiresorganizations:admin

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Invite a new member to the org.

post/v1/organizations/current/invitations

The member_invite OperationSpec enforces max_members, shared with the agent-tool path. The ORG_INVITATION_SENT audit row commits with the invitation.

Requiresorganizations:admin

Headers

  • X-Organization-IDstringoptional

Request body

  • emailstring (email)required
  • rolestringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Revoke a pending invitation.

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

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

Requiresorganizations:admin

Path parameters

  • invitation_idstring (uuid)required

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

List every member of the caller's org.

get/v1/organizations/current/members

Requiresorganizations:admin

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response

Change a member's role.

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

Emits ORG_MEMBER_ROLE_CHANGED; demoting the last owner is refused (RemoveMemberError).

Requiresorganizations:admin

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 a member from the org, revoking the API keys they owned.

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

Requiresorganizations:admin

Path parameters

  • user_idstring (uuid)required

Headers

  • X-Organization-IDstringoptional

Failures return the error envelope; branch on error_code.

Request
Response