跳转到内容

InviteLinkService

此内容尚不支持你的语言。

Manages shareable invite links that let users self-join an organization — distinct from direct email invitations sent via MemberService InviteUser. Links carry a role assignment and optional usage and expiry constraints.

Method Description
CreateInviteLink Create a shareable invite link
ListInviteLinks List all invite links for the organization
RevokeInviteLink Revoke an invite link
ValidateInviteLink Validate a link token and provision an account if needed
RedeemInviteLink Redeem a link to join the organization

Create a new shareable invite link. The server generates a cryptographically random token and returns the full shareable URL.

Authorization: Requires PERMISSION_MEMBERS_INVITE permission

Field Type Description
role_id string Role to assign to users who redeem the link. Defaults to the organization’s employee role if empty.
max_uses int32 Maximum number of redemptions. 0 means unlimited.
expires_in_hours int32 Hours until the link expires. 0 means no expiry. Valid range 0 to 8760 (1 year).
data_governance_region string Optional data governance region users who redeem this link inherit. One of EU, LATAM, BR, APAC, US. Empty means inherit the org default.
Field Type Description
invite_link InviteLink The newly created invite link.
url string Full URL for sharing, ending in /join?token=<TOKEN>.

List all invite links for the organization — active, expired, maxed-out, and revoked — ordered by creation date descending.

Authorization: Requires PERMISSION_MEMBERS_INVITE permission

Empty request.

Field Type Description
invite_links InviteLink[] All invite links for the organization.

Revoke an invite link, making it immediately unusable. Idempotent — revoking an already-revoked link returns success. A link belonging to another organization returns NOT_FOUND.

Authorization: Requires PERMISSION_MEMBERS_INVITE permission

Field Type Description
invite_link_id string ID of the invite link to revoke. Required.

Empty response on success.

Validate an invite link token and provision a user account if needed. This is a pre-authentication endpoint — the token is the authorization. Rate limited to 10 requests per minute per IP (RESOURCE_EXHAUSTED when exceeded).

Authorization: Public (token-based, no authentication required)

Field Type Description
token string The invite link token from the URL query parameter.
email string Email address of the user joining the organization. Max 254 characters.
Field Type Description
organization_name string Name of the organization the invite link belongs to.

Redeem an invite link to join its organization. The caller’s email is taken from their authentication token, and the link’s use count is incremented atomically.

Redemption fails with FAILED_PRECONDITION when the link is expired, revoked, or has reached its usage limit; with ALREADY_EXISTS when the email already belongs to a member of the organization; and with NOT_FOUND for an unknown token.

Authorization: Authenticated user

Field Type Description
token string The invite link token from the URL query parameter.
Field Type Description
organization_name string Name of the organization the user was added to.

A shareable invite link.

Field Type Description
id string Unique identifier.
token string Cryptographically random base64url-encoded token (43 characters).
role_id string Role assigned to users who redeem this link.
max_uses int32 Maximum number of redemptions. 0 means unlimited.
use_count int32 Number of times this link has been redeemed.
expires_at Timestamp When the link expires. Empty if no expiry.
revoked_at Timestamp When the link was revoked. Empty if not revoked.
created_by string ID of the admin who created the link.
created_at Timestamp When the link was created.
data_governance_region string Data governance region assigned to users who redeem this link. One of EU, LATAM, BR, APAC, US. Empty means inherit the org default.