Overview
The InviteMemberCommand sends an invitation to a user to join a workspace with a specified role.
Example
{ "commandId": "cmd_invite_123", "commandType": "InviteMemberCommand", "timestamp": "2025-12-11T11:00:00Z", "version": "1.0.0", "data": { "workspaceId": "ws_acme_corp", "invitedEmail": "jane@example.com", "role": "member", "invitedBy": { "userId": "usr_john_doe", "name": "John Doe" }, "personalMessage": "Welcome to our team!" }}Validation Rules
- Inviting member must have permission to invite
- Email must be valid format
- User cannot be already a member
- Workspace must have available seats
- Role must be valid (admin, member, guest)
Results
Success: MemberInvited event is published
Failures:
InsufficientPermissions: Member lacks invite permissionNoSeatsAvailable: Workspace seat limit reachedAlreadyAMember: User is already in workspace