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 |
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 Request
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)
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
- This endpoint adds the team member to the contact’s assigned agents
- To replace all assigned agents with a single agent, use the internal assignment endpoint
- A contact can have multiple assigned team members working together
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
aiContactId
andteamMemberId
must 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
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
Response
Team member assigned successfully.