Admin
Generate Link
Generate authentication links for users (admin only)
POST
Generate secure authentication links for users. This endpoint allows administrators to create magic links, recovery links, or invitation links that can be sent to users via custom channels.
Request Body
The type of link to generate.Options:
signup- Email confirmation link for new usersmagiclink- Passwordless authentication linkrecovery- Password recovery linkinvite- User invitation linkemail_change- Email change confirmation link
Email address of the user for whom to generate the link.
URL to redirect to after the link is used. If not provided, uses the default redirect URL.
Additional data to include with the link (for invitations or user creation).
Password for the user (required for some link types like recovery).
Response
The generated authentication link that can be sent to the user
One-time password for email verification (when applicable)
Hashed version of the token for verification purposes
Type of verification this link performs
The redirect URL that will be used after verification
Error Responses
Link Types
Magic Link
Generate a passwordless authentication link:Password Recovery Link
Generate a password recovery link:Email Confirmation Link
Generate an email confirmation link for new users:User Invitation Link
Generate an invitation link for new users:Email Change Confirmation
Generate a link to confirm email address changes:Implementation Examples
React Admin Link Generator
Bulk Link Generation
Node.js Backend Handler
Use Cases
Custom Email Templates
Generate links for use in custom email templates:Integration with External Systems
Generate links for integration with CRM or marketing tools:Security Considerations
- Service Role Protection: Never expose service role keys in client-side code
- Link Expiration: Generated links expire after 1 hour by default
- Single Use: Links can only be used once for security
- Rate Limiting: Implement rate limits for link generation
- Audit Logging: Log all link generation activities
Best Practices
Link Management
Link Management
- Generate links only when needed
- Use appropriate link types for different use cases
- Include meaningful redirect URLs
- Track link usage and expiration
Security
Security
- Validate all input parameters
- Use HTTPS for all redirect URLs
- Implement proper access controls
- Monitor for suspicious link generation patterns
User Experience
User Experience
- Provide clear instructions with generated links
- Use descriptive redirect URLs
- Handle expired links gracefully
- Offer alternative authentication methods
Testing
Unit Tests
Related Endpoints
Create User
Create new user accounts
Update User
Update user information
Invite User
Send user invitations
Verify Link
Verify generated links