Description:
Develop a system for inviting users to organizations via email with time-limited invitation links. The system should support sending multiple invitations in a single request and ensure that only authorized users can send invitations.
Authentication and Authorization:
API endpoint requires a valid JWT token in the Authorization header.
Only users with the "Admin" role for the specific organization can send invitations.
Acceptance Criteria:
Admins can send invitations to one or multiple email addresses.
Admins can specify which organization a user can be invited to.
The system supports sending up to 50 invitations in a single request.
Data Validation and Sanitization:
The API should validate that the emails field is present and contains valid email addresses.
The API should validate that the org_id is a valid UUID.
The JWT in the Authorization header must be valid and not expired.
The API should validate that the requesting user has admin rights for the specified organization.
Purpose:
To invite users to join an organization by sending secure, time-limited invitation links via email.
Expected Outcome:
A fully functional invitation system that allows organization admins to invite new members (single or multiple) to join organizations through secure, time-limited invitation links sent to their email addresses.
Issue Description: Create User Invitation System
Description: Develop a system for inviting users to organizations via email with time-limited invitation links. The system should support sending multiple invitations in a single request and ensure that only authorized users can send invitations.
Authentication and Authorization:
Acceptance Criteria:
Data Validation and Sanitization:
emails
field is present and contains valid email addresses.org_id
is a valid UUID.Purpose: To invite users to join an organization by sending secure, time-limited invitation links via email.
Expected Outcome: A fully functional invitation system that allows organization admins to invite new members (single or multiple) to join organizations through secure, time-limited invitation links sent to their email addresses.
API Endpoints:
Send Invitation(s)
[POST] /api/v1/organisations/send-invite
Request Headers:
Authorization: Bearer <JWT_TOKEN>
Request Body:
Success Response (201 Created):
Failure Responses:
Error Handling:
Requirements:
Testing: