Overview
Assign a specific team member (agent) to a contact. This creates a direct relationship between the team member and the contact, making the team member responsible for managing that conversation. This is essential for routing conversations to the right person, implementing assignment rules, and ensuring accountability in customer interactions.Use Cases
- Manual Assignment: Allow supervisors to manually assign conversations to specific agents
- Load Balancing: Programmatically distribute contacts across team members
- Specialized Routing: Assign contacts to agents based on skills, language, or expertise
- Escalation Workflows: Reassign contacts to senior agents when needed
- Territory Management: Assign contacts to agents based on geographic region
- VIP Handling: Route high-value customers to dedicated account managers
Authentication
This endpoint requires authentication using an API key. Include your API key in the request header:Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
aiContactId | string (UUID) | Yes | Unique identifier of the contact to assign |
teamMemberId | string (UUID) | Yes | Unique identifier of the team member to assign |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
removeExistingAgents | boolean | No | false | If true, replaces all existing assigned agents with the new one |
Response Structure
The endpoint returns a success response confirming the assignment:| Field | Type | Description |
|---|---|---|
success | boolean | Whether the assignment was successful |
message | string | Confirmation message |
Example Requests
Add Agent to Existing Assignments (Default Behavior)
Replace All Agents with New Agent
Example Response
Common Use Cases
1. Assign Contact from Dropdown Selection
2. Round-Robin Assignment
3. Skill-Based Assignment
4. Reassign to Senior Agent (Escalation)
4a. Replace All Agents with New Agent
5. Geographic Territory Assignment
6. Bulk Assignment
Assignment Behavior
What Happens When You Assign
- Agent Assignment: The team member is added to the contact’s assigned agents list
- Notification: The assigned agent may receive a notification (depending on your settings)
- Visibility: The contact appears in the agent’s assigned contacts view
- Multiple Assignments: A contact can have multiple assigned agents
- Activity Log: The assignment is recorded in the contact’s activity history
Replacing vs Adding
- By default, this endpoint adds the team member to the contact’s assigned agents
- To replace all assigned agents with a single agent, set the
removeExistingAgents=truequery parameter - When
removeExistingAgents=false(default), a contact can have multiple assigned team members working together - When
removeExistingAgents=true, all previous agent assignments are removed and only the new agent is assigned
Error Responses
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid contact or agent ID |
| 401 | Unauthorized - Invalid or missing API key |
| 404 | Not Found - Contact or team member not found |
| 500 | Internal Server Error - Something went wrong |
Important Notes
- Valid IDs Required: Both
aiContactIdandteamMemberIdmust be valid UUIDs from your organization - Team Member Verification: The team member must exist and be active in your organization
- Contact Ownership: The contact must belong to your organization
- Idempotent: Assigning the same agent multiple times won’t create duplicates
- No Body Required: This is a simple POST with no request body needed
- Immediate Effect: The assignment takes effect immediately
- Default Behavior: By default, the agent is added to existing assignments (not replaced)
- Replace Mode: Set
removeExistingAgents=trueto remove all previous agents and assign only the new one
Best Practices
1. Verify IDs Before Assignment
2. Handle Errors Gracefully
3. Provide User Feedback
Related Endpoints
- GET /api/public/team-members/all - Get list of all team members to choose from
- GET /api/public/contact//info - Get contact info including currently assigned agents
- POST /api/public/contact//update-metadata - Update contact metadata
Workflow Example
Complete workflow for assignment UI:Headers
API key required to authorize the request
Path Parameters
ID of the AI contact
ID of the team member
Query Parameters
If true, it will replace the existing agents with the new one
Response
Team member assigned successfully.
