Invites are only relevant when user registration is restricted. If open registration is enabled, invites are not required for account creation.
List Invites
GET /api/auth/invites
Retrieve all invite codes in the system.
Request
Response
Returns an array of invite objects.Unique invite identifier (CUID)
The invite code that users enter during registration
Number of times this invite has been used
Maximum allowed uses.
null for unlimited uses.ISO 8601 timestamp when invite expires.
null for no expiration.ISO 8601 timestamp when invite was created
ID of the admin who created this invite
Basic information about the admin who created the invite
Example Response
Create Invite
POST /api/auth/invites
Generate a new invite code with optional expiration and usage limits.
Request
Expiration timestamp. Use
"never" for no expiration, or provide:- ISO 8601 timestamp (e.g.,
"2024-12-31T23:59:59.000Z") - Relative duration (e.g.,
"7d","30d","1h")
Maximum number of times this invite can be used. Omit or set to
null for unlimited uses. Minimum: 1.Create unlimited invite expiring in 7 days
Create single-use invite
Create invite with specific expiration
Response
Returns the created invite object.Example Response
Rate Limiting
This endpoint is rate-limited to 1 request per second.Get Invite
GET /api/auth/invites/:id
Get details about a specific invite by ID or code.
Request
The:id parameter accepts either:
- Invite ID (e.g.,
cliii123456789) - Invite code (e.g.,
abc123)
Get by ID
Get by code
Response
Returns a single invite object in the same format as the list endpoint.Errors
- 404 Not Found: Invite not found through ID or code
Delete Invite
DELETE /api/auth/invites/:id
Permanently delete an invite code.
Request
The:id parameter must be the invite ID (not the code).
Response
Returns the deleted invite object.Example Response
Errors
- 404 Not Found: Invite not found
Invite Code Format
Invite codes are randomly generated strings with length configured by the server administrator (default: 6 characters). The code length is set in server settings underinvitesLength.
Automatic Cleanup
The server automatically removes expired invites based on thetasksClearInvitesInterval setting (default: every 30 minutes).
Usage Tracking
Theuses field increments each time someone successfully registers with the invite. When uses reaches maxUses, the invite can no longer be used.