Skip to content
Docs
Reference

BackstageClient.userInvitations

BackstageClient.userInvitations in @ticketlayer/backstage.

@ticketlayer/backstage


@ticketlayer/backstage / BackstageClient / userInvitations

userInvitations: {
  cancel: (id: string, requestOptions?: RequestOptions) => Promise<{
     id: string;
     success: boolean;
  }>;
  create: (request: {
     accountId?: string;
     email: string;
     firstName?: string;
     lastName?: string;
     organisationId?: string;
     roleIds?: string[];
   }, requestOptions?: RequestOptions) => Promise<{
     code: string;
     createdAt: string;
     email: string;
     expiresAt: string;
     id: string;
     organisationId: string;
     redeemedAt: string | null;
     userId: string;
  }>;
  get: (id: string, requestOptions?: RequestOptions) => Promise<{
     code: string;
     createdAt: string;
     email: string;
     expiresAt: string;
     id: string;
     organisationId: string;
     redeemedAt: string | null;
     userId: string;
  }>;
  list: (options?: {
     organisationId?: string;
     status?: "expired" | "pending" | "all" | "redeemed";
   }, requestOptions?: RequestOptions) => Promise<{
     code: string;
     createdAt: string;
     email: string;
     expiresAt: string;
     id: string;
     organisationId: string;
     redeemedAt: string | null;
     userId: string;
  }[]>;
  resend: (id: string, requestOptions?: RequestOptions) => Promise<{
     code: string;
     createdAt: string;
     email: string;
     expiresAt: string;
     id: string;
     organisationId: string;
     redeemedAt: string | null;
     userId: string;
  }>;
};

Defined in: client.ts:2025

User Invitations methods

cancel()#

cancel: (id: string, requestOptions?: RequestOptions) => Promise<{
  id: string;
  success: boolean;
}>;

Cancel user invitation Cancel a pending user invitation

Parameters#

ParameterType
idstring
requestOptions?RequestOptions

Returns#

Promise<{ id: string; success: boolean; }>

Operation Id#

cancelUserInvitation

create()#

create: (request: {
  accountId?: string;
  email: string;
  firstName?: string;
  lastName?: string;
  organisationId?: string;
  roleIds?: string[];
}, requestOptions?: RequestOptions) => Promise<{
  code: string;
  createdAt: string;
  email: string;
  expiresAt: string;
  id: string;
  organisationId: string;
  redeemedAt: string | null;
  userId: string;
}>;

Create user invitation Create a new user invitation in the caller's organisation and send the invitation email. Its link opens the Backstage invitation page (/invitations/redeem?code=), where the person signs in, or sets a password when the address has no account, and accepting it makes them a member with the roles named here.

Parameters#

ParameterTypeDescription
request{ accountId?: string; email: string; firstName?: string; lastName?: string; organisationId?: string; roleIds?: string[]; }-
request.accountId?stringDescription The account the invited roles are held on. Defaults to the organisation's default (first) account. Example acc_abc123
request.email?stringFormat: email Example newuser@example.com
request.firstName?stringExample John
request.lastName?stringExample Doe
request.organisationId?stringDescription Optional. The invitation is always made in the caller's own organisation; an id or slug naming another is refused (403 INVITATION_ORGANISATION_MISMATCH). Example org_xyz789
request.roleIds?string[]Description Roles the person is given when they accept, on accountId (or the organisation's default account). Each must be a system role or one of this organisation's. Needs roles.assign as well as users.invite. Example [ "rol_system_box_office" ]
requestOptions?RequestOptions-

Returns#

Promise<{ code: string; createdAt: string; email: string; expiresAt: string; id: string; organisationId: string; redeemedAt: string | null; userId: string; }>

Operation Id#

createUserInvitation

get()#

get: (id: string, requestOptions?: RequestOptions) => Promise<{
  code: string;
  createdAt: string;
  email: string;
  expiresAt: string;
  id: string;
  organisationId: string;
  redeemedAt: string | null;
  userId: string;
}>;

Get user invitation Get a specific user invitation by ID

Parameters#

ParameterType
idstring
requestOptions?RequestOptions

Returns#

Promise<{ code: string; createdAt: string; email: string; expiresAt: string; id: string; organisationId: string; redeemedAt: string | null; userId: string; }>

Operation Id#

getUserInvitation

list()#

list: (options?: {
  organisationId?: string;
  status?: "expired" | "pending" | "all" | "redeemed";
}, requestOptions?: RequestOptions) => Promise<{
  code: string;
  createdAt: string;
  email: string;
  expiresAt: string;
  id: string;
  organisationId: string;
  redeemedAt: string | null;
  userId: string;
}[]>;

List user invitations List all user invitations for the organisation

Parameters#

ParameterType
options?{ organisationId?: string; status?: "expired" | "pending" | "all" | "redeemed"; }
options.organisationId?string
options.status?"expired" | "pending" | "all" | "redeemed"
requestOptions?RequestOptions

Returns#

Promise<{ code: string; createdAt: string; email: string; expiresAt: string; id: string; organisationId: string; redeemedAt: string | null; userId: string; }[]>

Operation Id#

listUserInvitations

resend()#

resend: (id: string, requestOptions?: RequestOptions) => Promise<{
  code: string;
  createdAt: string;
  email: string;
  expiresAt: string;
  id: string;
  organisationId: string;
  redeemedAt: string | null;
  userId: string;
}>;

Resend user invitation Resend a user invitation email

Parameters#

ParameterType
idstring
requestOptions?RequestOptions

Returns#

Promise<{ code: string; createdAt: string; email: string; expiresAt: string; id: string; organisationId: string; redeemedAt: string | null; userId: string; }>

Operation Id#

resendUserInvitation