Callbacks
Inbound Message
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.
postWebhookinboundMessage
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": "message.received",
"id": "bf6307bd-884d-4c1f-b6ea-c62b8c495d3c",
"occurred_at": "2019-01-23T18:10:02.574Z",
"payload": {
"cc": [],
"completed_at": null,
"cost": {
"amount": "0.0051",
"currency": "USD"
},
"cost_breakdown": {
"carrier_fee": {
"amount": "0.00305",
"currency": "USD"
},
"rate": {
"amount": "0.00205",
"currency": "USD"
}
},
"direction": "inbound",
"encoding": "GSM-7",
"errors": [],
"from": {
"carrier": "T-MOBILE USA, INC.",
"line_type": "Wireless",
"phone_number": "+18665550001"
},
"id": "7ee4241c-f127-47e5-9c34-3aac291f8058",
"media": [],
"messaging_profile_id": "0f512bda-ae1e-4597-8e11-e5f5686b97d3",
"num_chars": 13,
"organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
"parts": 1,
"received_at": "2019-01-23T18:10:02.574Z",
"record_type": "message",
"sent_at": null,
"subject": "From Telnyx!",
"tags": [
"Greetings"
],
"tcr_campaign_billable": true,
"tcr_campaign_id": "TCPA3X7",
"tcr_campaign_registered": "REGISTERED",
"text": "Hello, World!",
"to": [
{
"carrier": "TELNYX LLC",
"line_type": "VoIP",
"phone_number": "+18445550001",
"status": "delivered"
}
],
"type": "SMS",
"valid_until": null,
"webhook_failover_url": "https://backup.example.com/hooks",
"webhook_url": "https://www.example.com/hooks"
},
"record_type": "event"
}
}Response
The server must return an HTTP 200, otherwise we will reattempt delivery at the failover webhook URL.