Cancel a transfer
Cancels a transfer that will not settle on its own.
Row-locks a non-terminal transfer and synchronously terminates an identified provider target leg before marking it failed with admin_canceled. The state change, transfer event and audit record are atomic.
When there is nothing to clean up
A requested transfer with no target yet needs no provider cleanup.
After dialing begins, a missing target identity or an unconfirmed provider outcome fails closed without changing saga state — so a cancel never leaves a live leg behind.
Optional reason text is trimmed and, when present, must be 8–500 characters.
Use Idempotency-Key for network retries and If-Match for concurrency control.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
id*stringuuidIf-Match?stringOptional strong ETag (or *) from a prior response. A stale tag returns 412 without changing the resource.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$1 <= length <= 255application/json- body
reason?|Optional operator reason. Null is equivalent to omission.
Updated terminal transfer.
application/json- response
Complete customer-safe transfer state. Every nullable field is explicit. Raw provider errors and infrastructure pod identity are excluded.
id*stringuuidorg_id*stringuuidsession_id*stringuuidattempt*integerOne-based transfer attempt within this call, including unsuccessful attempts. Older records may reuse one.
1 <= valuekind*stringcold or warm for a transfer to a human by phone; agent for a same-call handoff to another Kejue Voice agent (always method handoff, recorded in its final state - bridged when the other agent took over, failed when it could not be started).
"cold""warm""agent"method*string"refer""bridge""handoff"state*TransferState"requested""dialing""ringing""briefing""bridging""bridged""failed""recovering""resolved"destination*stringThe number or SIP URI dialled, or for an agent handoff the slug of the agent that took over.
1 <= length <= 2048trunk_id*|LiveKit/provider trunk identifier; it is not necessarily a UUID.
label*|nullannouncement*|nullcaller_identity*|nullcaller_number*|nullconsult_room*|nulltarget_identity*|nullsip_status_code*|nullsip_status_text*|nullfailure_code*|nullfailure_message*|nullfailure_advice*|nullstate_entered_at*stringdate-timestate_deadline_at*|nullabsolute_deadline_at*stringdate-timelast_heartbeat_at*stringdate-timeversion*integerint641 <= valuecreated_at*stringdate-timeupdated_at*stringdate-timecurl -X POST 'https://api.kejue.co/v1/transfers/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b", "session_id": "1ffd059c-17ea-40a8-8aef-70fd0307db82", "attempt": 1, "kind": "cold", "method": "refer", "state": "requested", "destination": "string", "trunk_id": "string", "label": "string", "announcement": "string", "caller_identity": "string", "caller_number": "string", "consult_room": "string", "target_identity": "string", "sip_status_code": 100, "sip_status_text": "string", "failure_code": "capability_denied", "failure_message": "string", "failure_advice": "string", "state_entered_at": "2019-08-24T14:15:22Z", "state_deadline_at": "2019-08-24T14:15:22Z", "absolute_deadline_at": "2019-08-24T14:15:22Z", "last_heartbeat_at": "2019-08-24T14:15:22Z", "version": 1, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}