# Invite user to organization div strong 🔨 In Development — This section is still being developed and may change. Invite a new user to join an organization. Only organization admins can send invitations. #### Path Parameters **`org_id`** string required Organization ID (e.g., "ORG_B66136CBB1304C98"). #### Request Body **`email`** string required Email address of the user to invite. **`role`** string optional · Defaults to `"member"` Role to assign to the invited user. Must be one of: `"owner"`, `"admin"`, `"member"`. **`department`** string optional Department to assign the user to. **`message`** string optional Custom invitation message. ## Returns An [InviteOrganizationUserResponse](#inviteorganizationuserresponse) object. Invite User as Member ```bash curl -X POST https://api.freddy.aitronos.com/v1/organization/ORG_B66136CBB1304C98/invite-user \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "new.user@company.com", "role": "member", "department": "Engineering", "message": "Welcome to our engineering team!" }' ``` ```python import requests response = requests.post( f"https://api.freddy.aitronos.com/v1/organization/{org_id}/invite-user", headers={"Authorization": f"Bearer {api_key}"}, json={ "email": "new.user@company.com", "role": "member", "department": "Engineering", "message": "Welcome to our engineering team!" } ) invitation = response.json() print(f"Invitation sent to: {invitation['email']}") ``` ```javascript const response = await fetch(`https://api.freddy.aitronos.com/v1/organization/${orgId}/invite-user`, { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'new.user@company.com', role: 'member', department: 'Engineering', message: 'Welcome to our engineering team!' }) }); const invitation = await response.json(); console.log(`Invitation sent to: ${invitation.email}`); ``` Invite User as Admin ```bash curl -X POST https://api.freddy.aitronos.com/v1/organization/ORG_B66136CBB1304C98/invite-user \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "email": "manager@company.com", "role": "admin", "department": "Operations" }' ``` ```python import requests response = requests.post( f"https://api.freddy.aitronos.com/v1/organization/{org_id}/invite-user", headers={"Authorization": f"Bearer {api_key}"}, json={ "email": "manager@company.com", "role": "admin", "department": "Operations" } ) invitation = response.json() print(f"Admin invitation sent to: {invitation['email']}") ``` ```javascript const response = await fetch(`https://api.freddy.aitronos.com/v1/organization/${orgId}/invite-user`, { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'manager@company.com', role: 'admin', department: 'Operations' }) }); const invitation = await response.json(); console.log(`Admin invitation sent to: ${invitation.email}`); ``` ## Response ```json { "success": true, "message": "User invited successfully", "email": "new.user@company.com", "role": "member", "department": "Engineering", "invitationId": "inv_1234567890abcdef", "invitedAt": "2025-01-15T10:30:00Z", "expiresAt": "2025-01-22T10:30:00Z" } ```