Skip to main content
POST
/
auth
/
invite
Invite user
curl --request POST \
  --url https://api.royalti.io/auth/invite \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "[email protected]",
  "sendEmail": true,
  "message": "Welcome to the workspace!",
  "redirectUrl": "https://app.royalti.io/email/activate"
}
'
{
  "message": "Successful, Email verification Instructions have been sent to your email"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

/auth/invite Description:
Creates or updates an invitation for a workspace member. The endpoint guarantees that a TenantInvite record exists so workspace admins can audit, resend, or cancel the invite through /user/invites. When an invite is cancelled later, the associated activation link is invalidated automatically.
Method:
POST
Security:
  • Basic Authentication required
Query Parameters
ParameterTypeDescriptionRequired
userId (Optional)stringExisting tenant user record to attach to the inviteNo
Request Payload:
ParameterTypeDescription
emailstringEmail address to invite.
sendEmail (Optional)booleanWhether to send the invite email (defaults to true).
message (Optional)stringCustom text to include with the invite email.
redirectUrl (Optional)stringOverride activation redirect URL in the invite email.
Invitations are only available to workspace owners or admins. A tenant user can only have one active invitation at a time.

Code Examples

const response = await fetch('https://api.royalti.io/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 tenant user record to associate with the invite

Body

application/json
email
string<email>
required

The email address of the user to be invited

sendEmail
boolean
default:true

Whether to email the invitation (defaults to true)

message
string

Custom message that will be included in the invite email

Example:

"Welcome to the workspace!"

redirectUrl
string

URL override for the activation link in the invite email

Example:

"https://app.royalti.io/email/activate"

Response

Success - Existing User Invite

message
string