Assign agents to a customer
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 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"
}Upload Media POST
Upload a media file to the WhatsApp media library. The uploaded media can then be used in messages by referencing its `id`. **Supported file types and size limits:** | Type | Formats | Max Size | |------|---------|----------| | Image | PNG, JPG, JPEG | 5 MB | | Video | MP4 | 16 MB | | Audio | OGG, MP3, M4A, WEBM | 16 MB | | Document | PDF | 100 MB |
Clear all agent assignments for a customer DELETE
Removes every agent assigned to the customer in one call.


