Invite Member
Invite a new member to the organization.
Endpoint
POST /api/v1/organizations/{org_id}/members/invite
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <access_token> |
Content-Type | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
org_id | integer | Yes | Unique identifier of the organization. You can obtain organization IDs from the List Organizations endpoint. |
Request Body
{
"email": "newuser@example.com",
"workspace_id": 1,
"role_id": 2,
"message": "Welcome to the team!"
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address of the user to invite. Must be a valid email format. The user will receive the invitation email at this address. |
workspace_id | integer | Yes | ID of the workspace within the organization where the user will be granted access. The workspace must exist in the organization. Use List Workspaces to find workspace IDs. |
role_id | integer | Yes | ID of the role to assign to the user upon acceptance. The role determines the user's permissions within the organization. Use List Roles to find available role IDs. |
message | string | No | Optional personal message to include in the invitation email. This message appears in the invitation email sent to the user. |
Response
Success (201)
{
"success": true,
"data": {
"invitation": {
"id": 1,
"token": "invitation_token",
"email": "newuser@example.com",
"expires_at": "2024-01-08T00:00:00Z"
},
"message": "Invitation sent successfully"
},
"message": "Invitation sent successfully"
}
Features
- Validate organization membership and permissions
- Validate email not already a member
- Validate invitation not already sent
- Validate organization can invite based on plan
- Select target workspace and role
- Allow personal welcome message
- Send invitation email immediately
- Invitation expires after 7 days (configurable)
- Create audit log entry