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: true
expired: false
acceptedAt: null
Accepted
Successfully accepted invitation
pending: false
expired: false
acceptedAt: timestamp
Expired
Invitation past expiration date
pending: true
expired: true
acceptedAt: null
Completed
Member added to workspace
pending: false
expired: false
acceptedAt: timestamp
Invitations automatically expire after the specified duration. Expired invitations cannot be accepted and require a new invitation to be sent.