Skip to content
API Reference

Accept

client.invitations.accept(stringtoken, InvitationAcceptParams { xClientRequestID } params?, RequestOptionsoptions?): InvitationAcceptResponse { organization_id, organization_name, success, user_id }
POST/invitations/{token}/accept

Accept and consume an invitation token to join the organization

ParametersExpand Collapse
token: string
minLength1
maxLength500
params: InvitationAcceptParams { xClientRequestID }
xClientRequestID?: string

Unique request identifier specified by the originating caller and passed along by proxies.

formatuuid
ReturnsExpand Collapse
InvitationAcceptResponse { organization_id, organization_name, success, user_id }

Result of accepting an invitation

organization_id: string

ID of the organization joined

minLength1
maxLength255
organization_name: string

Name of the organization joined

success: boolean

Whether the invitation was successfully accepted

user_id?: string

ID of the user who accepted the invitation

minLength1
maxLength255

Accept

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const response = await client.invitations.accept('token');

console.log(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"
}