Voice

End a voice session

Reconciles the credit reservation taken by POST /api/v1/voice/sessions down to the actual call duration and refunds the difference. Call it when the conversation ends. Idempotent: once the hold is cleared, a repeat call refunds nothing and reports alreadyReconciled: true. Only the session owner can end a call. POST /api/voice/v2/sessions/{id}/end is a legacy alias of this endpoint. Authenticate with an API key (b4m_live_) or a JWT.

post/api/v1/voice/sessions/{id}/end

Request

  • Base URL: https://your-deployment.example.com
  • URL: https://your-deployment.example.com/api/v1/voice/sessions/{id}/end
  • Auth: one of:
    • HTTP bearer
    • API key in header x-api-key

Path parameters

idstring required

The session id returned by POST /api/v1/voice/sessions.

Response

The reservation is reconciled.

refundednumber required

Credits returned to the caller from the up-front reservation.

elapsedSecondsinteger

Billed call duration. Absent when the session had already been reconciled.

alreadyReconciledtrue

Present when there was no live hold left to reconcile; the call is a no-op.

Example response

{
  "refunded": 42,
  "elapsedSeconds": 95
}

Changes

No recorded changes to this operation across all 1 revision of this API.