Skip to main content
POST
Send user invitations via email with customizable invitation links and user data. This endpoint allows administrators to invite new users to join the platform with pre-configured roles and metadata.
This endpoint requires service role authentication. Only use the service role key on your backend servers, never in client-side code.

Request Body

string
required
Email address to send the invitation to.
object
User metadata to pre-populate when the invitation is accepted.Common fields:
  • first_name - User’s first name
  • last_name - User’s last name
  • role - User’s role in the system
  • team_id - Team or organization ID
  • department - User’s department
string
URL to redirect to after the invitation is accepted. If not provided, uses the default redirect URL.
object
Additional invitation options.Available options:
  • captcha_token - Captcha token for verification
  • data - Additional app metadata

Response

object
Created user object with invitation status
string
Unique identifier for the sent invitation email

Error Responses

Invitation Email Template

The invitation email includes:

Implementation Examples

React Admin Invitation Form

Bulk User Invitation

Node.js Backend Handler

Use Cases

Team Member Invitation

Invite new team members with specific roles:

Client Invitation

Invite external clients with limited access:

Admin Invitation

Invite administrators with elevated privileges:

Security Features

  • Service Role Authentication: Requires valid service role key
  • Email Validation: Validates email format and uniqueness
  • Rate Limiting: Prevents invitation spam
  • Invitation Expiration: Invitations expire after 7 days
  • Audit Logging: Logs all invitation activities

Best Practices

  • Include meaningful user data in invitations
  • Use appropriate redirect URLs for different user types
  • Set reasonable expiration times for invitations
  • Track invitation status and follow up if needed
  • Provide clear invitation emails with next steps
  • Include contact information for support
  • Customize invitation content based on user role
  • Handle expired invitations gracefully
  • Validate all user data before processing
  • Implement proper access controls for invitation sending
  • Monitor for suspicious invitation patterns
  • Use secure redirect URLs (HTTPS only)

Testing

Unit Tests

Create User

Create user accounts directly

Generate Link

Generate custom invitation links

Update User

Update user information

Verify Invitation

Accept user invitations