# Invite User to Organization Invite a user to join the organization via email. ## Path Parameters **`organization_id`** string required Organization ID with `org_` prefix. ## Request Body **`email`** string required Valid email address of the user to invite. **`role_id`** string required Role ID to assign to the invited user (e.g., `role_member`, `role_admin`). **`send_invitation`** boolean optional Whether to send the invitation email (default: true). ## Returns Invitation details including invitation key and expiration. ## Authentication Requires authentication. User must be Admin or Owner. Request ```bash curl -X POST \ "https://api.aitronos.com/v1/organizations/org_xyz789/invite-user" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "newmember@example.com", "role_id": "role_member", "send_invitation": true }' ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.crew_management_invitations.invite_user( organization_id="org_abc123", email="user@example.com", role_id="role_abc123", ) print(result) ``` ```python import requests response = requests.post( "https://api.aitronos.com/v1/organizations/org_xyz789/invite-user", headers={"X-API-Key": FREDDY_API_KEY}, json={ "email": "newmember@example.com", "role_name": "Member", "send_email": True } ) ``` ```javascript const response = await fetch('https://api.aitronos.com/v1/organizations/org_xyz789/invite-user', { method: 'POST', headers: { 'X-API-Key': FREDDY_API_KEY, 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'newmember@example.com', role_id: 'role_member', send_invitation: true }) }); ``` **Response:** 201 Created ```json { "invitation_id": "inv_abc123", "email": "newmember@example.com", "invitation_key": "uuid-12345678-1234-1234-1234-123456789abc", "is_new_user": true, "user_id": "usr_xyz789", "expires_at": "2025-11-26T14:30:00Z" } ``` 403 Forbidden ```json { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "You don't have permission to perform this action.", "system_message": "Insufficient permissions for this operation", "type": "client_error", "status": 403, "details": {}, "trace_id": "abc-123-def", "timestamp": "2025-01-01T00:00:00Z" } } ``` ## Related Resources - [Organization Overview](/docs/documentation/organizations)