v52

latestOpenAPI 3.1.0raw.githubusercontent.com2026-07-311,1941,9384.1 MB
Callbacks

Call Cost

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.

postWebhookcallCost

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

Example payload

{
  "data": {
    "event_type": "call.cost",
    "id": "0ccc7b54-4df3-4bca-a65a-3da1ecc777f0",
    "occurred_at": "2018-02-02T22:25:27.521992Z",
    "payload": {
      "billed_duration_secs": 120,
      "billing_group_id": "f5586561-8ff0-4291-a0ac-84fe544797bd",
      "call_control_id": "v3:MdI91X4lWFEs7IgbBEOT9M4AigoY08M0WWZFISt1Yw2axZ_IiE4pqg",
      "call_leg_id": "428c31b6-7af4-4bcb-b7f5-5013ef9657c1",
      "call_session_id": "428c31b6-abf3-3bc1-b7f4-5013ef9657c1",
      "client_state": "aGF2ZSBhIG5pY2UgZGF5ID1d",
      "connection_id": "7267xxxxxxxxxxxxxx",
      "cost_parts": [
        {
          "billed_duration_secs": 60,
          "call_part": "sip-trunking",
          "cost": "0.0050",
          "currency": "USD",
          "rate": "0.0050"
        },
        {
          "billed_duration_secs": 120,
          "call_part": "call-recording",
          "cost": "0.0038",
          "currency": "USD",
          "rate": "0.00190"
        },
        {
          "billed_duration_secs": 60,
          "call_part": "call-control",
          "cost": "0.0018",
          "currency": "USD",
          "rate": "0.00180"
        }
      ],
      "occurred_at": "2018-02-02T22:25:27.521992Z",
      "status": "success",
      "total_cost": "0.0106"
    },
    "record_type": "event"
  }
}

Response

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