Skip to content
API Reference

Accept

invitations.accept(strtoken, InvitationAcceptParams**kwargs) -> InvitationAcceptResponse
POST/invitations/{token}/accept

Accept and consume an invitation token to join the organization

ParametersExpand Collapse
token: str
minLength1
maxLength500
x_client_request_id: Optional[str]
formatuuid
ReturnsExpand Collapse
class InvitationAcceptResponse:

Result of accepting an invitation

organization_id: str

ID of the organization joined

minLength1
maxLength255
organization_name: str

Name of the organization joined

success: bool

Whether the invitation was successfully accepted

user_id: Optional[str]

ID of the user who accepted the invitation

minLength1
maxLength255

Accept

from keycardai_api import KeycardAPI

client = KeycardAPI()
response = client.invitations.accept(
    token="token",
)
print(response.organization_id)
{
  "organization_id": "ab3def8hij2klm9opq5rst7uvw",
  "organization_name": "organization_name",
  "success": true,
  "user_id": "ab3def8hij2klm9opq5rst7uvw"
}
Returns Examples
{
  "organization_id": "ab3def8hij2klm9opq5rst7uvw",
  "organization_name": "organization_name",
  "success": true,
  "user_id": "ab3def8hij2klm9opq5rst7uvw"
}