Outcome
Transition an existing ringing local call record to completed with the supplied nonnegative integer duration.
Before you start
- Verify the exact authenticated identity, environment and approved organization context before preparing the request.
- The published application permission is workspace:write. Discover a granted canonical Voice workspace and bind its exact id. A supplied id does not grant access.
- Authorize all documented effects before CLI --confirm or MCP confirm:true. Local events, canonical archival and organization erasure have distinct scope.
Discover the target
topolo whoami --json
topolo actions get app_topolo_voice.calls.complete --detail --json
topolo resources topolo-voice --json
topolo workspaces list topolo-voice --json
- Select the actual granted resource id as VOICE_WORKSPACE_ID; synthetic fixture ids authorize no live operation.
- Use a real local call id retained from calls.incoming or recent granted overview. The recent call list is capped at 25; only an independently authorized organization export contains all local provider_call_id values.
Request
POST /api/calls/complete
Save the exact action input as payload.json. Set VOICE_WORKSPACE_ID from granted canonical resource discovery. Validate it and inspect the exact path, query and body before executing.
Inspect and test this action in the signed action console.
Input fields
| Field | Required | Type | Meaning and constraints |
|---|---|---|---|
callId | Required | string | Actual local call id retained from calls.incoming or granted discovery; must still be ringing in this workspace. {"minLength":1} |
durationSeconds | Required | integer | Required integer >= 0 representing the observed duration; no telephony provider validates it. {"minimum":0} |
The complete input and response schemas are available in the action console and through CLI/MCP action discovery.
Effects
- Atomically updates only a scoped call currently ringing; stores endedAt and durationSeconds. It does not terminate a provider connection.
- Repeating after completion or after missing the call returns 409 call_not_transitionable. Attempts best-effort completion notification separately.
Interpret the response
Use $.data.id for the returned call identifier.
Examples retain complete raw Worker responses. CLI/MCP adds a transport envelope; use CLI --detail for the full result. Delegated Auth projections can vary, and the widget uses the canonical SDK contract.
Verify data.id equals input callId, status completed and durationSeconds matches the supplied value. Read the same workspace overview or authorized export. An ambiguous result requires a read before retrying; terminal calls cannot be changed by a second completion request.
Worked examples
Actual worker and isolated migrated D1; synthetic Auth identity, nondefault workspace grants and archive transport. Notify and Nexus are disabled. No live telephony, remote audio or transcript hosting/deletion is tested. Refused examples explain boundaries; do not execute them as successful workflows.
minimal · Successful request · HTTP 201
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_399b0403-b561-498d-95aa-d8fa70c583e6",
"durationSeconds": 0
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --confirm --detail --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_voice.calls.complete",
"input": {
"callId": "call_399b0403-b561-498d-95aa-d8fa70c583e6",
"durationSeconds": 0
},
"resourceType": "workspace",
"resourceId": "<id returned by granted resource discovery>",
"confirm": true
}
}
Captured response · HTTP 201:
{
"data": {
"id": "call_399b0403-b561-498d-95aa-d8fa70c583e6",
"status": "completed",
"endedAt": "2026-10-04T07:54:39.410Z",
"durationSeconds": 0
}
}
HTTP 201. Verify data.id equals input callId, status completed and durationSeconds matches the supplied value. Read the same workspace overview or authorized export. An ambiguous result requires a read before retrying; terminal calls cannot be changed by a second completion request.
minimal · Refused request · HTTP 409
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_399b0403-b561-498d-95aa-d8fa70c583e6",
"durationSeconds": 1
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
Captured response · HTTP 409:
{
"error": "call_not_transitionable"
}
HTTP 409. The actual handler refused this request. Inspect the exact cause and current state before deciding whether to retry.
minimal · Refused request · HTTP 404
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_missing",
"durationSeconds": 0
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
Captured response · HTTP 404:
{
"error": "call_not_found"
}
HTTP 404. The actual handler refused this request. Inspect the exact cause and current state before deciding whether to retry.
workflow · Successful request · HTTP 201
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_772a7b3c-7ee3-4295-b44a-8c4a24e47ba3",
"durationSeconds": 125
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --confirm --detail --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_voice.calls.complete",
"input": {
"callId": "call_772a7b3c-7ee3-4295-b44a-8c4a24e47ba3",
"durationSeconds": 125
},
"resourceType": "workspace",
"resourceId": "<id returned by granted resource discovery>",
"confirm": true
}
}
Captured response · HTTP 201:
{
"data": {
"id": "call_772a7b3c-7ee3-4295-b44a-8c4a24e47ba3",
"status": "completed",
"endedAt": "2026-10-04T07:54:40.341Z",
"durationSeconds": 125
}
}
HTTP 201. Verify data.id equals input callId, status completed and durationSeconds matches the supplied value. Read the same workspace overview or authorized export. An ambiguous result requires a read before retrying; terminal calls cannot be changed by a second completion request.
workflow · Refused request · HTTP 409
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_772a7b3c-7ee3-4295-b44a-8c4a24e47ba3",
"durationSeconds": 1
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
Captured response · HTTP 409:
{
"error": "call_not_transitionable"
}
HTTP 409. The actual handler refused this request. Inspect the exact cause and current state before deciding whether to retry.
workflow · Refused request · HTTP 404
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_missing",
"durationSeconds": 0
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
Captured response · HTTP 404:
{
"error": "call_not_found"
}
HTTP 404. The actual handler refused this request. Inspect the exact cause and current state before deciding whether to retry.
privacy · Successful request · HTTP 201
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_34f3ad97-75be-4c5d-bb06-ae16acb413e9",
"durationSeconds": 125
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --confirm --detail --json
MCP tool and arguments:
{
"tool": "topolo_call_action",
"arguments": {
"actionId": "app_topolo_voice.calls.complete",
"input": {
"callId": "call_34f3ad97-75be-4c5d-bb06-ae16acb413e9",
"durationSeconds": 125
},
"resourceType": "workspace",
"resourceId": "<id returned by granted resource discovery>",
"confirm": true
}
}
Captured response · HTTP 201:
{
"data": {
"id": "call_34f3ad97-75be-4c5d-bb06-ae16acb413e9",
"status": "completed",
"endedAt": "2026-10-04T07:54:42.065Z",
"durationSeconds": 125
}
}
HTTP 201. Verify data.id equals input callId, status completed and durationSeconds matches the supplied value. Read the same workspace overview or authorized export. An ambiguous result requires a read before retrying; terminal calls cannot be changed by a second completion request.
privacy · Refused request · HTTP 409
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_34f3ad97-75be-4c5d-bb06-ae16acb413e9",
"durationSeconds": 1
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
Captured response · HTTP 409:
{
"error": "call_not_transitionable"
}
HTTP 409. The actual handler refused this request. Inspect the exact cause and current state before deciding whether to retry.
privacy · Refused request · HTTP 404
Actual local worker response and migrated D1. Auth identity/grants/archive are simulated. Notify and metering are disabled; no telephony or remote audio/transcript provider is contacted. Fixture identifiers authorize no live action.
Input · payload.json:
{
"callId": "call_missing",
"durationSeconds": 0
}
CLI:
topolo actions validate app_topolo_voice.calls.complete --data @payload.json --json
topolo actions plan app_topolo_voice.calls.complete --resource-type workspace --resource-id "$VOICE_WORKSPACE_ID" --data @payload.json --json
Captured response · HTTP 404:
{
"error": "call_not_found"
}
HTTP 404. The actual handler refused this request. Inspect the exact cause and current state before deciding whether to retry.
Verify the result
- Verify data.id equals input callId, status completed and durationSeconds matches the supplied value. Read the same workspace overview or authorized export.
- An ambiguous result requires a read before retrying; terminal calls cannot be changed by a second completion request.
Errors and recovery
call_not_transitionable(HTTP 409): Inspect the current call status. Complete/miss require ringing and voicemail requires missed. Do not repeat a terminal transition or invent a new state.call_not_found(HTTP 404): The id is absent from this organization/workspace. Discover or retain the actual local call id in the approved context; supplied ids grant no access.organization_required(HTTP 403): The authenticated request has no organization. Stop and establish the approved owning organization; supplied workspace ids do not create membership.
Auth, resource resolution and published input validation can refuse a request before its handler. Retain the actual error, request id and approved context. A plain-text HTTP 500 is surfaced by CLI/MCP as http_error; that transport code is not a structured Voice handler error.
Recovery boundary
No published reopen, duration correction or terminal state reversal exists. Preserve the recorded state and original request; do not report a provider connection was ended.
Related actions
- Get Voice workspace overview: Read all-workspace counts and the most recent 25 calls and provider failures in one granted Voice workspace.
Evidence
Actual worker and isolated migrated D1; synthetic Auth identity, nondefault workspace grants and archive transport. Notify and Nexus are disabled. No live telephony, remote audio or transcript hosting/deletion is tested.