API reference
Transfer a call
POST /v1/conversations/{conversation_id}/transfer
Put the caller through to a person: the agent says its own transfer line, the number rings, and the agent leaves the call once somebody answers — or tells the caller nobody could. to_number, or the agent's own transfer number when you leave it out, is checked like any number an agent calls. Once per call, and phone calls only. Needs calls:control.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
conversation_id |
path | string (uuid) | Yes |
Body
Sent as JSON. A field this operation does not take is refused, so a typo fails loudly.
| Field | Type | Required | Description |
|---|---|---|---|
summary |
string | No | What the person who answers is told. |
to_number |
string or null | No | Where to put the caller through, in international format, like +966501234567. Leave it out for the agent's own transfer number. |
Answer
202 with ConversationCommandObject.
Errors
Every error is a problem document with a stable code.
| Status | When |
|---|---|
401 |
The key is missing, mistyped, unknown, revoked or expired. |
403 |
The key lacks a permission, a live key was sent from a browser, or the organization is frozen and the request would change something. |
404 |
This key reaches no such conversation. |
409 |
Not a phone call, not answered, ended, or already transferred. |
422 |
The number may not be called, or the agent has none of its own. |
429 |
Too many requests for this key or its organization; see Retry-After. |
500 |
Something went wrong on our side. Quote the request_id to support. |
Examples
#!/bin/sh
# Transfer a call. Phone calls only, once per call.
curl -sS --fail-with-body -X POST "https://api.aigently.ai/v1/conversations/5b7d9f1b-3d5f-4b7d-a9f1-b3d5f7b9dbfd/transfer" \
-H "Authorization: Bearer $AIGENTLY_API_KEY" \
--json '{
"to_number": "+966501234567",
"summary": "Wants a private room for twenty."
}'
Try it
Sends this request to the API from your browser, with a test key. Nothing it does rings a phone.