Workspace Invitations
Learn about the invitation system for managing workspace members and collaboration.
Invitation Schema
Database
The invitation system uses a PostgreSQL table with the following structure:
Schema Definition
Database schema for invitations:
TYPESCRIPT
Invitation Flow
1
Send Invitation
Workspace admin sends invitation with specified role
2
Email Delivery
Invitation email sent with secure token
3
Accept Invitation
Recipient accepts via email link before expiration
4
Member Creation
New workspace member created with assigned role
Key Features
🔒
Security
Secure tokens and expiration for invitations
👑
Role Assignment
Specify member roles during invitation
🗑️
Cascade Deletion
Automatic cleanup with workspace deletion
📊
Status Tracking
Monitor pending and expired invitations
Invitation States
Pending
Invitation sent but not yet accepted
pending: trueexpired: falseacceptedAt: nullAccepted
Successfully accepted invitation
pending: falseexpired: falseacceptedAt: timestampExpired
Invitation past expiration date
pending: trueexpired: trueacceptedAt: nullCompleted
Member added to workspace
pending: falseexpired: falseacceptedAt: timestampInvitations automatically expire after the specified duration. Expired invitations cannot be accepted and require a new invitation to be sent.