Skip to main content
POST
Assign an team member to an AI contact

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

Query Parameters

Response Structure

The endpoint returns a success response confirming the assignment:

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

  1. Agent Assignment: The team member is added to the contact’s assigned agents list
  2. Notification: The assigned agent may receive a notification (depending on your settings)
  3. Visibility: The contact appears in the agent’s assigned contacts view
  4. Multiple Assignments: A contact can have multiple assigned agents
  5. 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=true query 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

Important Notes

  • Valid IDs Required: Both aiContactId and teamMemberId 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
  • Default Behavior: By default, the agent is added to existing assignments (not replaced)
  • Replace Mode: Set removeExistingAgents=true to 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

Workflow Example

Complete workflow for assignment UI:

Headers

x-api-key
string
required

API key required to authorize the request

Path Parameters

aiContactId
string
required

ID of the AI contact

teamMemberId
string
required

ID of the team member

Query Parameters

removeExistingAgents
boolean

If true, it will replace the existing agents with the new one

ticketV2Id
string

Ticket to scope the assignment to. Required for email contacts, whose tickets are per-thread and cannot be resolved from the contact alone.

Response

Team member assigned successfully.