Skip to content

client.invitations

Bases: SyncResource

Sync invitations namespace (client.invitations) — admin-only.

create

create(*, email: str, role: WorkspaceRole | str = WorkspaceRole.MEMBER) -> Invitation

Invite an email into this workspace (admin; 201). The response's accept_url is the same link the invitation email carries — hand it over chat as an alternative delivery.

Raises:

Type Description
ForbiddenError

caller is not a workspace admin (AUTH_FORBIDDEN).

ConflictError

email already a member (USER_EMAIL_TAKEN), already invited (INVITATION_PENDING), or quota reached counting pending invitations (RESOURCE_LIMIT_EXCEEDED).

list

list(*, status: str | None = None) -> _InvitationsEnvelope

This workspace's invitations, newest first (admin; {items} envelope, unpaginated — bounded by the user quota).

Parameters:

Name Type Description Default
status str | None

filter to one lifecycle state (pending/accepted/declined/revoked/expired).

None

revoke

revoke(invitation_id: UUID | str) -> Invitation

Withdraw a pending invitation (admin) — the emailed link dies.

Raises:

Type Description
NotFoundError

unknown invitation id (INVITATION_NOT_FOUND).

ConflictError

already resolved (INVITATION_NOT_PENDING).