Invitation Flow
Organization invitation and user onboarding process
Zyeta implements a comprehensive invitation system that allows organization administrators to invite users to join their organization with predefined roles and permissions.
Overview
The invitation system enables:
- Organization administrators to invite new users
- Assignment of specific roles during invitation
- Secure email-based verification
- Streamlined onboarding for new users
Invitation Lifecycle
Invitations follow a defined lifecycle managed through status transitions:
- Pending: Initial state, awaiting response from invitee
- Accepted: Invitee has accepted and joined the organization
- Rejected: Invitee has explicitly declined the invitation
- Expired: Time limit has passed without response
- Revoked: Administrator has canceled the invitation
Creating Invitations
Organization administrators can invite users with a specified role:
Key aspects of invitation creation:
- Each invitation is tied to a specific organization
- A specific role is assigned
- A secure random token is generated
- Expiration time is set (default: 48 hours)
- Email notifications are automatically sent
Email Notifications
The system sends personalized invitation emails:
These emails contain:
- Organization details
- Inviter’s name
- Secure invitation link with token
- Clear instructions for accepting or declining
Accepting Invitations
When a user follows the invitation link, the system:
- Validates the invitation token
- Checks if the invitation is still pending and not expired
- Verifies the email address matches
For new users, the system:
- Displays a signup form
- Creates a new user account
- Associates the user with the organization using the assigned role
For existing users, the system simply adds them to the organization with the assigned role.
Rejecting Invitations
Users can explicitly reject invitations by:
- Following a “Decline” link in the email
- Clicking a reject button in the application interface
Managing Pending Invitations
Organization administrators can view and manage pending invitations:
- List all pending invitations
- Resend invitations
- Revoke invitations before they’re accepted
The invitation list provides:
- Invitee email address
- Timestamp of invitation
- Current status
- Expiration time
Invitation Token Security
The invitation system incorporates multiple security measures:
- Unique Tokens: Each invitation has a cryptographically secure random token
- Limited Validity: Tokens expire after a configurable time period
- Single Use: Tokens become invalid after use
- Email Verification: Token must be used with the invited email address
- Organization Context: Each token is tied to a specific organization
Role Validation
The system enforces hierarchical role constraints:
This ensures that:
- Users can only invite others with roles of lower privilege
- Owners can invite admins, members, and guests
- Admins can invite members and guests
- Members can only invite guests (if allowed)
API Endpoints
The invitation flow is managed through these endpoints:
Endpoint | Method | Description |
---|---|---|
/api/invitations/send | POST | Create a new invitation |
/api/invitations/resend | POST | Resend an existing invitation |
/api/invitations/accept | POST | Accept an invitation |
/api/invitations/reject | POST | Reject an invitation |
/api/invitations/list | GET | List all invitations for an organization |
/api/invitations/{id} | GET | Get details of a specific invitation |
Request and Response Examples
Invitation UI Flow
The frontend implements a streamlined invitation flow:
- User receives email with invitation link
- User clicks link and is directed to the application
- System validates the invitation token
- New users complete a registration form
- Existing users are prompted to login
- User is redirected to the organization dashboard
Next Steps
- Authentication Overview: Complete authentication system
- JWT Authentication: How token-based authentication works
- Role-Based Access Control: Understanding permission management
Was this page helpful?