Skip to content
API Reference

Retrieve

client.invitations.retrieve(stringtoken, InvitationRetrieveParams { xClientRequestID } params?, RequestOptionsoptions?): InvitationRetrieveResponse { created_by_name, email, expires_at, 3 more }
GET/invitations/{token}

View invitation details by token without consuming the token

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

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

formatuuid
ReturnsExpand Collapse
InvitationRetrieveResponse { created_by_name, email, expires_at, 3 more }

Public invitation details viewable by token

created_by_name: string

Name of the user who sent the invitation

email: string

Email address for the invitation

formatemail
expires_at: string

When the invitation expires

formatdate-time
organization_name: string

Name of the organization being invited to

Role that will be assigned when invitation is accepted

Accepts one of the following:
"org_admin"
"org_member"
"org_viewer"

Status of an invitation

Accepts one of the following:
"pending"
"accepted"
"expired"
"revoked"

Retrieve

import KeycardAPI from '@keycardai/api';

const client = new KeycardAPI();

const invitation = await client.invitations.retrieve('token');

console.log(invitation.created_by_name);
{
  "created_by_name": "created_by_name",
  "email": "dev@stainless.com",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "organization_name": "organization_name",
  "role": "org_admin",
  "status": "pending"
}
Returns Examples
{
  "created_by_name": "created_by_name",
  "email": "dev@stainless.com",
  "expires_at": "2019-12-27T18:11:19.117Z",
  "organization_name": "organization_name",
  "role": "org_admin",
  "status": "pending"
}