User Invites API
Introduction
This is the API documentation for the User Invites API. This API is used to invite users to your organization.
Send user invitations
sendUserInvites()
The sendUserInvites
API is used to invite users and automatically also create a user invite. With this method you can invite multiple users at once.
import { roqBrowserClient } from 'lib/roq/roq-client'
const status = async () => {
const userInvitation = await roqBrowserClient.roqPlatform.sendUserInvites({
data: {
tenantId: 'ee764883-f2c3-4486-9de6-070345e350af',
userInvites: [{
createdByUserId: '530c9a92-71c5-4dce-a6e3-c638c2d0b1bc',
email: "wick.john@roq.tech",
locale: "en-US",
roles: ["content-creator"]
}]
}
})
return userInvitation
}
Parameter | Type | Description |
---|---|---|
data | object | User invites data |
data:tenantId | uuid | ID of the tenant (organization) |
data:userInvites | array | Array of invitees |
data:userInvites:email | string | Email of the invitee |
data:userInvites:firstName | string | First name of the invitee |
data:userInvites:lastName | string | Last name of the invitee |
data:userInvites:locale | string | Language of the invitee (used for the email) |
data:userInvites:data | array | Additional custom data |
data:userInvites:createdByUserId | uuid | ID of the inviting user |
data:userInvites:roles | array | Array of IDs of roles for the invitee |
resendUserInvite()
The resendUserInvite
API will resend the invitation to the invitee.
import { roqBrowserClient } from 'lib/roq/roq-client'
const userInviteModel = async() => {
const userInvitationId = "d1459a92-71c5-4edc-a6a1-c638c2d0d34c"
return await roqBrowserClient.roqPlatform.resendUserInvite({
userInviteId: userInvitationId
})
}
Parameter | Type | Description |
---|---|---|
userInviteId | uuid | The invitee ID |
Cancel user invitation
cancelUserInvite()
The cancelUserInvite
API will cancel a user invitation based on the user invitation ID.
import { roqBrowserClient } from 'lib/roq/roq-client'
const cancelUserInvitation = async() => {
const userInvitationId = "d1459a92-71c5-4edc-a6a1-c638c2d0d34c"
return await roqBrowserClient.roqPlatform.cancelUserInvite({
userInviteId:userInvitationId
})
}
Parameter | Type | Description |
---|---|---|
userInviteId | uuid | The invitee ID |
Get user invitations data
You can fetch user invitations data using the userInvites
.
userInvites()
You can get the user invitations list using the userInvites()
method. You can limit the results and search the invitee by email, name, or keywords, etc.
import { roqBrowserClient } from 'lib/roq/roq-client'
const userInvitesData = async() => {
return await roqBrowserClient.roqPlatform.userInvites({
limit: 10
})
}
Parameter | Type | Description |
---|---|---|
limit | integer | Limit the results |
search | object | Search parameter |
filter | object | Filter parameter |
offset | integer | Offset the results |
order | object | Order parameter |
userInvite()
Get the data of the invitee by using the userInvite()
method. You can get the data by using the invitee ID.
const inviteeData = async() => {
const inviteeId = "78f665fb-61ab-4931-a565-3136e6d01553"
return await roqBrowserClient.roqPlatform.userInvite({ id:inviteeId})
}
Parameter | Type | Description |
---|---|---|
id | uuid | The invitee ID |