WhatsApp API Platform
Agent Assignments

Assign agents to a customer

PATCH
/api/v1/agents/assign

Idempotently adds one or more agents to a customer's assignments. Agents already on the customer are returned under already_assigned and not re-inserted.

The customer field accepts either the customer's internal id (cuid2) or its public identifier. If you pass an identifier that exists across multiple WABAs in your tenant, also pass wabaId to disambiguate — otherwise the call returns 400 ambiguous_customer.

Authorization

ApiKeyAuth
X-API-Key<token>

API key from your dashboard (Settings > API Keys)

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://loading/api/v1/agents/assign" \  -H "Content-Type: application/json" \  -d '{    "customer": "919876543210",    "agentIds": [      "agt_abc123",      "agt_def456"    ]  }'
{
  "success": true,
  "data": {
    "added": [
      "agt_abc123"
    ],
    "already_assigned": [
      "agt_def456"
    ]
  }
}
{
  "success": false,
  "message": "to field is required"
}
{
  "success": false,
  "message": "user not authenticated"
}
{
  "success": false,
  "message": "forbidden"
}
{
  "success": false,
  "message": "customer not found"
}
{
  "success": false,
  "message": "internal server error"
}