Skip to content
Software capabilities
Telnyx

Inspect Telnyx message delivery

Look up the message UUID in the Telnyx API or Python SDK. Check to[].status for delivery and errors for failures. Billing fields can arrive after the message has been processed.

Documentation reviewed · 2 methods with sources

Ways to do it

  1. API: GET /v2/messages/{id}
  2. SDK: client.messages.retrieve()
API

GET /v2/messages/{id}

Read one message record and its recipient delivery status.

Read source: Telnyx retrieve a message API
Requirements
A Telnyx API key and a message ID.
Limitations
This endpoint looks up messages created within the past 10 days. Use a message detail record report for older messages.

Example shell

curl --fail "https://api.telnyx.com/v2/messages/$TELNYX_MESSAGE_ID" -H "Authorization: Bearer $TELNYX_API_KEY"
SDK

client.messages.retrieve()

Read the message detail record with the Telnyx Python SDK and extract recipient statuses.

Read source: Telnyx Python SDK messages API
Requirements
The telnyx Python package, an API key for the account, and a message UUID.
Limitations
Cost can remain null until billing finalizes. The retrieval endpoint has the same 10-day window when called from the SDK.

Example text

import os
from telnyx import Telnyx

client = Telnyx(api_key=os.environ["TELNYX_API_KEY"])
record = client.messages.retrieve(os.environ["TELNYX_MESSAGE_ID"])
data = record.data
if data and data.direction == "outbound":
    print(data.to, data.status)