Skip to main content
POST
/
auth
/
invite
Invite user
curl --request POST \
  --url https://server26-dot-royalti-project.uc.r.appspot.com/auth/invite \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "jsmith@example.com",
  "sendEmail": true,
  "message": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "redirect_url": "<string>",
  "role": "<string>"
}'
{
  "message": "Successful, Email verification Instructions have been sent to your email"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

const response = await fetch('https://server26-dot-royalti-project.uc.r.appspot.com/auth/invite', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "email": "sample-email",
    "sendEmail": true,
    "message": "Welcome to the workspace!",
    "redirectUrl": "https://app.royalti.io/email/activate"
  })
});

const data = await response.json();
console.log(data);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Query Parameters

userId
string

The workspaceId/userId of the invitee

Body

application/json
email
string<email>
required

The email address of the user to be invited

sendEmail
boolean
default:true

This sends an invite email to the user, by default it is true

message
string

This adds a message to invite email to the user

firstName
string

The first name of the user to be invited

lastName
string

The last name of the user to be invited

redirect_url
string

The URL to redirect the user to after they accept the invitation

role
string

The role of the invited user

Response

Success - Existing User Invite

message
string