Endpoint
Authentication
Requires a valid Supabase session with theadmin role in user metadata.
Path Parameters
UUID of the waitlist request to activate
Request Body
No request body required.Response
Always
true on successful activationThe UUID of the activated waitlist request
The email address that received the activation link
Error Responses
- 400 Bad Request: Missing waitlist ID
- 401 Unauthorized: Not authenticated
- 403 Forbidden: Not an admin user or cross-origin request
- 404 Not Found: Waitlist entry not found
- 500 Internal Server Error: Failed to generate magic link, send email, or update database
Example Request
Example Response
Activation Flow
The endpoint performs these operations:- Fetch waitlist request using service role client
- Generate Supabase magic link with embedded metadata:
- Sets
app_metadata.roles = ["member"] - Sets
app_metadata.invited_from_waitlist = true - Sets
app_metadata.waitlist_request_id = <id>
- Sets
- Send activation email via Resend with:
- HTML template with branding
- Plain text fallback
- Magic link for one-click sign-in
- Update waitlist status to
activated
User Metadata
When users sign in via the magic link, their Supabase user profile is automatically populated with:- Access to protected routes (via
memberrole) - Bypass of guest throttling
- Audit trail linking to original waitlist request
Email Configuration
Requires these environment variables:RESEND_API_KEY- Resend API key for sending emailsRESEND_FROM_EMAIL(optional) - Custom sender email
lib/email/templates/waitlist-activation.ts.
Security
- Same-origin enforcement: Requests must come from the same origin
- Admin role required: Uses
requireAdminUser()helper - Service role client: Required for magic link generation and metadata setting
- Idempotent: Can be called multiple times (sends a new activation email each time)
Source
Implementation:frontend/app/api/admin/waitlist/[id]/activate/route.ts