BackstageClient.userInvitations
BackstageClient.userInvitations in @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#
| Parameter | Type |
|---|---|
id | string |
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#
| Parameter | Type | Description |
|---|---|---|
request | { accountId?: string; email: string; firstName?: string; lastName?: string; organisationId?: string; roleIds?: string[]; } | - |
request.accountId? | string | Description The account the invited roles are held on. Defaults to the organisation's default (first) account. Example acc_abc123 |
request.email? | string | Format: email Example newuser@example.com |
request.firstName? | string | Example John |
request.lastName? | string | Example Doe |
request.organisationId? | string | Description 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#
| Parameter | Type |
|---|---|
id | string |
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#
| Parameter | Type |
|---|---|
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#
| Parameter | Type |
|---|---|
id | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
code: string;
createdAt: string;
email: string;
expiresAt: string;
id: string;
organisationId: string;
redeemedAt: string | null;
userId: string;
}>
Operation Id#
resendUserInvitation