Invitations
Create New Invites
Changed onUnified endpoint to create invitations for users OR admins based on role.
Authorization:
- Only admin users can create invitations (for both admins and regular users)
- Non-admin users will receive 403 Forbidden
For Admin Invitations (role="admin"):
- Creates Firebase user with SSO authentication
- Sends activation email with 24-hour expiry token
- One membership per organization. Inviting an email that belongs to another organization is rejected unless ALLOW_MULTI_ORG_ADMINS is on
- An email that is already an active admin here is reported per email as already_a_member; its membership is left untouched
- Uses business_admins collection
For User Invitations (role != "admin"):
- Validates emails exist in Firestore
- Checks users are not already in any business
- Creates invitation and sends email
- Uses invitations collection
Request Body:
- user_emails: List of email addresses
- role: "admin" | "user"
- invitation_expiry: Days until expiry (default: 7 for users, 24 hours for admins)
post/api/v1/invitations/create
Request
- Base URLhttps://api.neosapien.xyz (the document declares no server; this is the origin it was published from)
- URLhttps://api.neosapien.xyz/api/v1/invitations/create
- AuthHTTP bearer
Request body
Response
Successful Response
Changes
- warning
added the new
already_a_memberenum value to the//response property for the response status
- warning