Callbacks

TeXML Call Completed

Webhook sent when a TeXML call is completed. This webhook uses Telnyx headers (telnyx-timestamp, telnyx-signature-ed25519) that are compatible with Standard Webhooks specification for SDK generation. Custom validation logic can map these to standard webhook-timestamp and webhook-signature equivalents. See https://github.com/standard-webhooks/standard-webhooks for details.

postWebhookTexmlCallCompletedWebhook

Headers

telnyx-timestampinteger required

Unix timestamp for replay attack prevention

Unix timestamp (seconds since epoch) of when the webhook was sent - compatible with webhook-timestamp

telnyx-signature-ed25519string required

Ed25519 signature of timestamp|payload for verification

Base64 encoded Ed25519 signature for webhook verification - compatible with webhook-signature

Payload application/x-www-form-urlencoded

AccountSidstring required

The unique identifier of the account (user_id).

AnsweredTimestring date-time

The time when the call was answered (only present when CallStatus is 'completed').

CallControlIdstring

The call control ID (only present when CallStatus is 'completed').

CallDurationstring

The duration of the call in seconds (conditional, only present if start_time and end_time are available).

CallInitiatedAtstring date-time required

The timestamp when the call was initiated.

CallLegIdstring

The call leg ID (only present when CallStatus is 'completed').

CallQualityStatsstring

JSON-encoded call quality statistics (only present when CallStatus is 'completed').

CallSessionIdstring

The call session ID (only present when CallStatus is 'completed').

CallSidstring required

The unique identifier of the call (call_control_id).

CallSidLegacystring required

Legacy call identifier, same as CallSid.

CallStatus'completed' | 'busy' | 'no-answer' | 'canceled' | 'failed' required

The status of the call.

CallbackSource'call-progress-events' required

The source of the callback.

CallerIdstring

The display name of the caller.

ConnectionIdstring required

The unique identifier of the connection.

DialCallDurationstring

The duration of the dialed call in seconds (conditional, only present in hangup action callbacks for Dial).

DialCallSidstring

The unique identifier of the dialed call (conditional, only present in hangup action callbacks for Dial).

DialCallSidLegacystring

Legacy dialed call identifier, same as DialCallSid (conditional, only present in hangup action callbacks for Dial).

DialCallStatus'completed' | 'busy' | 'no-answer' | 'canceled' | 'failed'

The status of the dialed call (conditional, only present in hangup action callbacks for Dial).

EndTimestring date-time

The time when the call ended (only present when CallStatus is 'completed').

ErrorCodestring

Error code if an error occurred (conditional).

ErrorMessagestring

Error message if an error occurred (conditional).

Fromstring required

The phone number or SIP address of the caller.

HangupCausestring

The reason for call hangup (only present when CallStatus is 'completed').

HangupSourcestring

The source of the hangup (conditional, only present for hangup events).

OccurredAtstring date-time

The timestamp when the event occurred (only present when CallStatus is 'completed').

OrganizationIdstring

The organization ID (only present when CallStatus is 'completed').

ParentCallSidstring

The unique identifier of the parent call that initiated this outbound call (conditional, only present for outbound calls initiated via Dial).

ParentCallSidLegacystring

Legacy parent call identifier, same as ParentCallSid (conditional, only present for outbound calls initiated via Dial).

RecordingDurationstring

The duration of the recording in seconds (conditional, only present if recording was enabled).

RecordingUrlstring

The URL where the call recording can be accessed (conditional, only present if recording was enabled).

SequenceNumberinteger required

The sequence number of the event.

ShakenStirAttestationstring

SHAKEN/STIR attestation level (conditional, only present if shaken_stir_data is available).

ShakenStirValidatedboolean

Whether SHAKEN/STIR validation passed (conditional, only present if shaken_stir_data is available).

SipHangupCausestring

The SIP hangup cause code (conditional, only present for hangup events).

StartTimestring date-time

The time when the call started (only present when CallStatus is 'completed').

Timestampstring date-time required

The UTC timestamp when the webhook was generated.

Tostring required

The phone number or SIP address that was called.

UserIdstring

The user ID (only present when CallStatus is 'completed').

Example payload

{
  "AccountSid": "f5586561-8ff0-4291-a51b-c7dfe4139ff9",
  "AnsweredTime": "2024-01-15T10:30:15Z",
  "CallControlId": "v3:9X2vxPDFY2RHSJ1EdMS0RHRksMTg7ldNxdjWbVr9zBjbGjGsSe-aiQ",
  "CallDuration": "45",
  "CallInitiatedAt": "2024-01-15T10:30:26.028Z",
  "CallLegId": "abc123-leg1",
  "CallQualityStats": "{\"mos\":4.2,\"jitter\":10,\"packet_loss\":0.5}",
  "CallSessionId": "session-abc123",
  "CallSid": "v3:9X2vxPDFY2RHSJ1EdMS0RHRksMTg7ldNxdjWbVr9zBjbGjGsSe-aiQ",
  "CallSidLegacy": "v3:9X2vxPDFY2RHSJ1EdMS0RHRksMTg7ldNxdjWbVr9zBjbGjGsSe-aiQ",
  "CallStatus": "completed",
  "CallbackSource": "call-progress-events",
  "CallerId": "John Doe",
  "ConnectionId": "1234567890",
  "DialCallDuration": "120",
  "DialCallSid": "v3:9X2vxPDFY2RHSJ1EdMS0RHRksMTg7ldNxdjWbVr9zBjbGjGsSe-aiQ",
  "DialCallSidLegacy": "v3:9X2vxPDFY2RHSJ1EdMS0RHRksMTg7ldNxdjWbVr9zBjbGjGsSe-aiQ",
  "DialCallStatus": "completed",
  "EndTime": "2024-01-15T10:31:00Z",
  "ErrorCode": "10001",
  "ErrorMessage": "Call failed",
  "From": "+35319605860",
  "HangupCause": "normal_clearing",
  "HangupSource": "caller",
  "OccurredAt": "2024-01-15T10:31:00Z",
  "OrganizationId": "org-abc123",
  "ParentCallSid": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
  "ParentCallSidLegacy": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
  "RecordingDuration": "90",
  "RecordingUrl": "https://api.telnyx.com/v2/recordings/abc123.wav",
  "ShakenStirAttestation": "A",
  "SipHangupCause": "200",
  "StartTime": "2024-01-15T10:30:00Z",
  "Timestamp": "2024-01-15T10:30:00Z",
  "To": "+13129457420",
  "UserId": "f5586561-8ff0-4291-a51b-c7dfe4139ff9"
}

Response

The server must return an HTTP 200, otherwise we will reattempt delivery at the failover webhook URL.

Changes

Webhooks have no change history: a webhook is keyed by its event name rather than a path and method, so no recorded change can name it.