Skip to main content

Message Detail Records

| cURL | Python | Node | Java | .NET | Ruby |


cURL

Once a send message API request goes through, your SMS or MMS will be put into a queue to be sent to its destination. A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

Retrieving an MDR

Note

You will have to acquire an API Key to run this code in your terminal.

Note

Don't forget to update YOUR_API_KEY here.

Request Payload

curl -X GET \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
"https://api.telnyx.com/v2/messages/834f3d53-8a3c-4aa0-a733-7f2d682a72df"

Response Payload

{
"data": {
"record_type": "message",
"id": "834f3d53-8a3c-4aa0-a733-7f2d682a72df",
"direction": "outbound",
"type": "sms",
"from": "+18445550001",
"to": [
{
"phone_number": "+18665550002",
"status": "delivered",
"updated_at": "2019-01-23T18:10:02.574Z"
}
],
"text": "Hello, World!",
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://www.example.com/callbacks",
"use_profile_webhooks": false,
"cost": {
"cost": "1.23",
"currency": "USD"
},
"parts": 1,
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"valid_until": "2019-01-23T18:10:02.574Z",
"errors": [],
"carrier": "Verizon",
"line_type": "Wireless"
}
}

MDR schema and status descriptions

A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

MDR schema

id

ID of the message request, which is a UUID.

It is included as a string in the POST /messages response payload for outbound messages, or the payload of an incoming webhook for inbound messages.

e.g.,"c51c89d9-68ad-4db2-a471-cf622d21c40d"

text

Text delivered in the body of the message.

webhook_url

The URL where webhooks related to this message will be sent.

webhook_failover_url

The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.

use_profile_webhooks

If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.

created_atupdated_at

Created/updated at time in Unix time in milliseconds, returned as a 13-digit integer (1 ms = 10-3 sec).

e.g., 1522097596060 is Mon, 26 Mar 2018 20:53:16 UTC

fromSender's +E.164 formatted phone number, represented as a string.
toObject containing the receiver's +E.164 formatted phone number, represented as a string, and the status of the messgae as well as the last updated timestamp.
directionOptions: ["inbound", "outbound"]
carrier

Indicates the carrier name for the number you're sending to or receiving from

line_type

Indicates the type of number you're sending to or receiving from Options: ["Wireline", "Wireless", "VoIP"]

costcurrency

Default: null

null means that the amount/currency was unknown when the MDR was cut and that the field will be populated later. This is commonly seen in MDRs posted to the delivery status webhook.

type

Type of messaging service e.g., "SMS" = text message

MDR status field

status describes the status/state of the message request when the MDR was retrieved. The value is a string without whitespace.

Inbound status

When you request an MDR for an inbound message request, the status of the retrieved MDR will most likely be "delivered". That said, there are two inbound statuses:

"received"Received by the Telnyx Messaging Services.
"delivered"Transmitted to you, after receipt.

Outbound status

For an outbound message request:

  • An MDR is only created when Telnyx attempts to send the message. A rejected request will not have an associated MDR. When a request is rejected, Telnyx responds with the reason e.g., missing or invalid value.
  • If the request includes a reachable delivery status webhook URL, we'll POST the MDR after each status update.
  • Telnyx stores the most recent version of the MDR.
  • The status of a completed request is either "delivered" or "failed", which are the "finished" statuses.

An accepted request will transition through some, but not all, of the following:

"queued"

Released from scheduler and submitted to gateway. [Queued in scheduler, due to outbound rate limiting.]

"gw_timeout"No DLR (delivery receipt) from gateway.
"sent"

Success DLR received from gateway. Message has been sent downstream.

"dlr_timeout"No DLR from downstream.
"delivered"

To the best of our knowledge, the message was delivered.

"failed"

Failure DLR from gateway or downstream, which is notification of message delivery failure.

Python

Once a send message API request goes through, your SMS or MMS will be put into a queue to be sent to its destination. A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

Retrieving an MDR

Note

You will have to set up your development environment and acquire an API Key to run this code.

import telnyx
telnyx.api_key = 'YOUR_API_KEY'

response = telnyx.Message.retrieve("834f3d53-8a3c-4aa0-a733-7f2d682a72df")

Response Payload

{
"data": {
"record_type": "message",
"id": "834f3d53-8a3c-4aa0-a733-7f2d682a72df",
"direction": "outbound",
"type": "sms",
"from": "+18445550001",
"to": [
{
"address": "+18665550002",
"status": "delivered",
"updated_at": "2019-01-23T18:10:02.574Z"
}
],
"text": "Hello, World!",
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://www.example.com/callbacks",
"use_profile_webhooks": false,
"cost": {
"amount": "1.23",
"currency": "USD"
},
"parts": 1,
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"valid_until": "2019-01-23T18:10:02.574Z",
"errors": [],
"carrier": "Verizon",
"line_type": "Wireless"
}
}

MDR schema and status descriptions

A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

MDR schema

id

ID of the message request, which is a UUID.

It is included as a string in the POST /messages response payload for outbound messages, or the payload of an incoming webhook for inbound messages.

e.g.,"c51c89d9-68ad-4db2-a471-cf622d21c40d"

text

Text delivered in the body of the message.

webhook_url

The URL where webhooks related to this message will be sent.

webhook_failover_url

The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.

use_profile_webhooks

If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.

created_atupdated_at

Created/updated at time in Unix time in milliseconds, returned as a 13-digit integer (1 ms = 10-3 sec).

e.g., 1522097596060 is Mon, 26 Mar 2018 20:53:16 UTC

fromSender's +E.164 formatted phone number, represented as a string.
toObject containing the receiver's +E.164 formatted phone number, represented as a string, and the status of the messgae as well as the last updated timestamp.
directionOptions: ["inbound", "outbound"]
carrier

Indicates the carrier name for the number you're sending to or receiving from

line_type

Indicates the type of number you're sending to or receiving from Options: ["Wireline", "Wireless", "VoIP"]

costcurrency

Default: null

null means that the amount/currency was unknown when the MDR was cut and that the field will be populated later. This is commonly seen in MDRs posted to the delivery status webhook.

type

Type of messaging service e.g., "SMS" = text message

MDR status field

status describes the status/state of the message request when the MDR was retrieved. The value is a string without whitespace.

Inbound status

When you request an MDR for an inbound message request, the status of the retrieved MDR will most likely be "delivered". That said, there are two inbound statuses:

"received"Received by the Telnyx Messaging Services.
"delivered"Transmitted to you, after receipt.

Outbound status

For an outbound message request:

  • An MDR is only created when Telnyx attempts to send the message. A rejected request will not have an associated MDR. When a request is rejected, Telnyx responds with the reason e.g., missing or invalid value.
  • If the request includes a reachable delivery status webhook URL, we'll POST the MDR after each status update.
  • Telnyx stores the most recent version of the MDR.
  • The status of a completed request is either "delivered" or "failed", which are the "finished" statuses.

An accepted request will transition through some, but not all, of the following:

"queued"

Released from scheduler and submitted to gateway. [Queued in scheduler, due to outbound rate limiting.]

"gw_timeout"No DLR (delivery receipt) from gateway.
"sent"

Success DLR received from gateway. Message has been sent downstream.

"dlr_timeout"No DLR from downstream.
"delivered"

To the best of our knowledge, the message was delivered.

"failed"

Failure DLR from gateway or downstream, which is notification of message delivery failure.

Node

Once a send message API request goes through, your SMS or MMS will be put into a queue to be sent to its destination. A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

Retrieving an MDR

Note

You will have to set up your development environment and acquire an API Key to run this code.

import Telnyx from 'telnyx';

const telnyx = new Telnyx("YOUR_API_KEY");

const { data: messageDetail } = await telnyx.Message.retrieve("834f3d53-8a3c-4aa0-a733-7f2d682a72df")

Response Payload

{
"data": {
"record_type": "message",
"id": "834f3d53-8a3c-4aa0-a733-7f2d682a72df",
"direction": "outbound",
"type": "sms",
"from": "+18445550001",
"to": [
{
"address": "+18665550002",
"status": "delivered",
"updated_at": "2019-01-23T18:10:02.574Z"
}
],
"text": "Hello, World!",
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://www.example.com/callbacks",
"use_profile_webhooks": false,
"cost": {
"amount": "1.23",
"currency": "USD"
},
"parts": 1,
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"valid_until": "2019-01-23T18:10:02.574Z",
"errors": [],
"carrier": "Verizon",
"line_type": "Wireless"
}
}

MDR schema and status descriptions

A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

MDR schema

id

ID of the message request, which is a UUID.

It is included as a string in the POST /messages response payload for outbound messages, or the payload of an incoming webhook for inbound messages.

e.g.,"c51c89d9-68ad-4db2-a471-cf622d21c40d"

text

Text delivered in the body of the message.

webhook_url

The URL where webhooks related to this message will be sent.

webhook_failover_url

The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.

use_profile_webhooks

If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.

created_atupdated_at

Created/updated at time in Unix time in milliseconds, returned as a 13-digit integer (1 ms = 10-3 sec).

e.g., 1522097596060 is Mon, 26 Mar 2018 20:53:16 UTC

fromSender's +E.164 formatted phone number, represented as a string.
toObject containing the receiver's +E.164 formatted phone number, represented as a string, and the status of the messgae as well as the last updated timestamp.
directionOptions: ["inbound", "outbound"]
carrier

Indicates the carrier name for the number you're sending to or receiving from

line_type

Indicates the type of number you're sending to or receiving from Options: ["Wireline", "Wireless", "VoIP"]

costcurrency

Default: null

null means that the amount/currency was unknown when the MDR was cut and that the field will be populated later. This is commonly seen in MDRs posted to the delivery status webhook.

type

Type of messaging service e.g., "SMS" = text message

MDR status field

status describes the status/state of the message request when the MDR was retrieved. The value is a string without whitespace.

Inbound status

When you request an MDR for an inbound message request, the status of the retrieved MDR will most likely be "delivered". That said, there are two inbound statuses:

"received"Received by the Telnyx Messaging Services.
"delivered"Transmitted to you, after receipt.

Outbound status

For an outbound message request:

  • An MDR is only created when Telnyx attempts to send the message. A rejected request will not have an associated MDR. When a request is rejected, Telnyx responds with the reason e.g., missing or invalid value.
  • If the request includes a reachable delivery status webhook URL, we'll POST the MDR after each status update.
  • Telnyx stores the most recent version of the MDR.
  • The status of a completed request is either "delivered" or "failed", which are the "finished" statuses.

An accepted request will transition through some, but not all, of the following:

"queued"

Released from scheduler and submitted to gateway. [Queued in scheduler, due to outbound rate limiting.]

"gw_timeout"No DLR (delivery receipt) from gateway.
"sent"

Success DLR received from gateway. Message has been sent downstream.

"dlr_timeout"No DLR from downstream.
"delivered"

To the best of our knowledge, the message was delivered.

"failed"

Failure DLR from gateway or downstream, which is notification of message delivery failure.

Java

Once a send message API request goes through, your SMS or MMS will be put into a queue to be sent to its destination. A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

Retrieving an MDR

Note

You will have to set up your development environment and acquire an API Key to run this code.

// Import classes:
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.auth.*;
import com.telnyx.sdk.model.*;
import com.telnyx.sdk.api.MessagesApi;
import java.util.UUID;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.telnyx.com/v2");

// Configure HTTP bearer authorization: bearerAuth
HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
bearerAuth.setBearerToken("BEARER TOKEN");

MessagesApi apiInstance = new MessagesApi(defaultClient);
UUID id = UUID.fromString("834f3d53-8a3c-4aa0-a733-7f2d682a72df"); // UUID | The id of the message
try {
MessageResponse result = apiInstance.retrieveMessage(id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MessagesApi#retrieveMessage");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}

Response Payload

{
"data": {
"record_type": "message",
"id": "834f3d53-8a3c-4aa0-a733-7f2d682a72df",
"direction": "outbound",
"type": "sms",
"from": "+18445550001",
"to": [
{
"address": "+18665550002",
"status": "delivered",
"updated_at": "2019-01-23T18:10:02.574Z"
}
],
"text": "Hello, World!",
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://www.example.com/callbacks",
"use_profile_webhooks": false,
"cost": {
"amount": "1.23",
"currency": "USD"
},
"parts": 1,
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"valid_until": "2019-01-23T18:10:02.574Z",
"errors": [],
"carrier": "Verizon",
"line_type": "Wireless"
}
}

MDR schema and status descriptions

A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

MDR schema

id

ID of the message request, which is a UUID.

It is included as a string in the POST /messages response payload for outbound messages, or the payload of an incoming webhook for inbound messages.

e.g.,"c51c89d9-68ad-4db2-a471-cf622d21c40d"

text

Text delivered in the body of the message.

webhook_url

The URL where webhooks related to this message will be sent.

webhook_failover_url

The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.

use_profile_webhooks

If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.

created_atupdated_at

Created/updated at time in Unix time in milliseconds, returned as a 13-digit integer (1 ms = 10-3 sec).

e.g., 1522097596060 is Mon, 26 Mar 2018 20:53:16 UTC

fromSender's +E.164 formatted phone number, represented as a string.
toObject containing the receiver's +E.164 formatted phone number, represented as a string, and the status of the messgae as well as the last updated timestamp.
directionOptions: ["inbound", "outbound"]
carrier

Indicates the carrier name for the number you're sending to or receiving from

line_type

Indicates the type of number you're sending to or receiving from Options: ["Wireline", "Wireless", "VoIP"]

costcurrency

Default: null

null means that the amount/currency was unknown when the MDR was cut and that the field will be populated later. This is commonly seen in MDRs posted to the delivery status webhook.

type

Type of messaging service e.g., "SMS" = text message

MDR status field

status describes the status/state of the message request when the MDR was retrieved. The value is a string without whitespace.

Inbound status

When you request an MDR for an inbound message request, the status of the retrieved MDR will most likely be "delivered". That said, there are two inbound statuses:

"received"Received by the Telnyx Messaging Services.
"delivered"Transmitted to you, after receipt.

Outbound status

For an outbound message request:

  • An MDR is only created when Telnyx attempts to send the message. A rejected request will not have an associated MDR. When a request is rejected, Telnyx responds with the reason e.g., missing or invalid value.
  • If the request includes a reachable delivery status webhook URL, we'll POST the MDR after each status update.
  • Telnyx stores the most recent version of the MDR.
  • The status of a completed request is either "delivered" or "failed", which are the "finished" statuses.

An accepted request will transition through some, but not all, of the following:

"queued"

Released from scheduler and submitted to gateway. [Queued in scheduler, due to outbound rate limiting.]

"gw_timeout"No DLR (delivery receipt) from gateway.
"sent"

Success DLR received from gateway. Message has been sent downstream.

"dlr_timeout"No DLR from downstream.
"delivered"

To the best of our knowledge, the message was delivered.

"failed"

Failure DLR from gateway or downstream, which is notification of message delivery failure.

.NET

Once a send message API request goes through, your SMS or MMS will be put into a queue to be sent to its destination. A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

Retrieving an MDR

Note

You will have to set up your development environment and acquire an API Key to run this code.

using System;
using Telnyx;
using System.Threading.Tasks;

namespace retrieve_mdr
{
class Program
{
private static string TELNYX_API_KEY = System.Environment.GetEnvironmentVariable("TELNYX_API_KEY");
private static string MDR = "MDR_UUID";
static async Task Main(string[] args)
{
Console.WriteLine("Retrieve UUID!");
TelnyxConfiguration.SetApiKey(TELNYX_API_KEY);
MessagingSenderIdService service = new MessagingSenderIdService();

try
{
var retrieveMessage = await service.GetAsync(MDR);
Console.WriteLine(retrieveMessage);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}

Response Payload

{
"data": {
"record_type": "message",
"id": "834f3d53-8a3c-4aa0-a733-7f2d682a72df",
"direction": "outbound",
"type": "sms",
"from": "+18445550001",
"to": [
{
"address": "+18665550002",
"status": "delivered",
"updated_at": "2019-01-23T18:10:02.574Z"
}
],
"text": "Hello, World!",
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://www.example.com/callbacks",
"use_profile_webhooks": false,
"cost": {
"amount": "1.23",
"currency": "USD"
},
"parts": 1,
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"valid_until": "2019-01-23T18:10:02.574Z",
"errors": [],
"carrier": "Verizon",
"line_type": "Wireless"
}
}

MDR Schema and Status Descriptions

A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

MDR schema

id

ID of the message request, which is a UUID.

It is included as a string in the POST /messages response payload for outbound messages, or the payload of an incoming webhook for inbound messages.

e.g.,"c51c89d9-68ad-4db2-a471-cf622d21c40d"

text

Text delivered in the body of the message.

webhook_url

The URL where webhooks related to this message will be sent.

webhook_failover_url

The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.

use_profile_webhooks

If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.

created_atupdated_at

Created/updated at time in Unix time in milliseconds, returned as a 13-digit integer (1 ms = 10-3 sec).

e.g., 1522097596060 is Mon, 26 Mar 2018 20:53:16 UTC

fromSender's +E.164 formatted phone number, represented as a string.
toObject containing the receiver's +E.164 formatted phone number, represented as a string, and the status of the messgae as well as the last updated timestamp.
directionOptions: ["inbound", "outbound"]
carrier

Indicates the carrier name for the number you're sending to or receiving from

line_type

Indicates the type of number you're sending to or receiving from Options: ["Wireline", "Wireless", "VoIP"]

costcurrency

Default: null

null means that the amount/currency was unknown when the MDR was cut and that the field will be populated later. This is commonly seen in MDRs posted to the delivery status webhook.

type

Type of messaging service e.g., "SMS" = text message

MDR status field

status describes the status/state of the message request when the MDR was retrieved. The value is a string without whitespace.

Inbound status

When you request an MDR for an inbound message request, the status of the retrieved MDR will most likely be "delivered". That said, there are two inbound statuses:

"received"Received by the Telnyx Messaging Services.
"delivered"Transmitted to you, after receipt.

Outbound status

For an outbound message request:

  • An MDR is only created when Telnyx attempts to send the message. A rejected request will not have an associated MDR. When a request is rejected, Telnyx responds with the reason e.g., missing or invalid value.
  • If the request includes a reachable delivery status webhook URL, we'll POST the MDR after each status update.
  • Telnyx stores the most recent version of the MDR.
  • The status of a completed request is either "delivered" or "failed", which are the "finished" statuses.

An accepted request will transition through some, but not all, of the following:

"queued"

Released from scheduler and submitted to gateway. [Queued in scheduler, due to outbound rate limiting.]

"gw_timeout"No DLR (delivery receipt) from gateway.
"sent"

Success DLR received from gateway. Message has been sent downstream.

"dlr_timeout"No DLR from downstream.
"delivered"

To the best of our knowledge, the message was delivered.

"failed"

Failure DLR from gateway or downstream, which is notification of message delivery failure.

Ruby

Once a send message API request goes through, your SMS or MMS will be put into a queue to be sent to its destination. A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

Retrieving an MDR

Note

You will have to set up your development environment and acquire an API Key to run this code.

require 'telnyx'
Telnyx.api_key = 'YOUR_API_KEY'

response = Telnyx::Message.retrieve("834f3d53-8a3c-4aa0-a733-7f2d682a72df")

Response Payload

{
"data": {
"record_type": "message",
"id": "834f3d53-8a3c-4aa0-a733-7f2d682a72df",
"direction": "outbound",
"type": "sms",
"from": "+18445550001",
"to": [
{
"address": "+18665550002",
"status": "delivered",
"updated_at": "2019-01-23T18:10:02.574Z"
}
],
"text": "Hello, World!",
"webhook_url": "https://www.example.com/hooks",
"webhook_failover_url": "https://www.example.com/callbacks",
"use_profile_webhooks": false,
"cost": {
"amount": "1.23",
"currency": "USD"
},
"parts": 1,
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"valid_until": "2019-01-23T18:10:02.574Z",
"errors": [],
"carrier": "Verizon",
"line_type": "Wireless"
}
}

MDR schema and status descriptions

A Message Detail Record (MDR) describes a specific message request and includes those that are active, pending and completed. Telnyx stores the most recent version of the MDR.

MDR schema

id

ID of the message request, which is a UUID.

It is included as a string in the POST /messages response payload for outbound messages, or the payload of an incoming webhook for inbound messages.

e.g.,"c51c89d9-68ad-4db2-a471-cf622d21c40d"

text

Text delivered in the body of the message.

webhook_url

The URL where webhooks related to this message will be sent.

webhook_failover_url

The failover URL where webhooks related to this message will be sent if sending to the primary URL fails.

use_profile_webhooks

If the profile this number is associated with has webhooks, use them for delivery notifications. If webhooks are also specified on the message itself, they will be attempted first, then those on the profile.

created_atupdated_at

Created/updated at time in Unix time in milliseconds, returned as a 13-digit integer (1 ms = 10-3 sec).

e.g., 1522097596060 is Mon, 26 Mar 2018 20:53:16 UTC

fromSender's +E.164 formatted phone number, represented as a string.
toObject containing the receiver's +E.164 formatted phone number, represented as a string, and the status of the messgae as well as the last updated timestamp.
directionOptions: ["inbound", "outbound"]
carrier

Indicates the carrier name for the number you're sending to or receiving from

line_type

Indicates the type of number you're sending to or receiving from Options: ["Wireline", "Wireless", "VoIP"]

costcurrency

Default: null

null means that the amount/currency was unknown when the MDR was cut and that the field will be populated later. This is commonly seen in MDRs posted to the delivery status webhook.

type

Type of messaging service e.g., "SMS" = text message

MDR status Field

status describes the status/state of the message request when the MDR was retrieved. The value is a string without whitespace.

Inbound Status

When you request an MDR for an inbound message request, the status of the retrieved MDR will most likely be "delivered". That said, there are two inbound statuses:

"received"Received by the Telnyx Messaging Services.
"delivered"Transmitted to you, after receipt.

Outbound status

For an outbound message request:

  • An MDR is only created when Telnyx attempts to send the message. A rejected request will not have an associated MDR. When a request is rejected, Telnyx responds with the reason e.g., missing or invalid value.
  • If the request includes a reachable delivery status webhook URL, we'll POST the MDR after each status update.
  • Telnyx stores the most recent version of the MDR.
  • The status of a completed request is either "delivered" or "failed", which are the "finished" statuses.

An accepted request will transition through some, but not all, of the following:

"queued"

Released from scheduler and submitted to gateway. [Queued in scheduler, due to outbound rate limiting.]

"gw_timeout"No DLR (delivery receipt) from gateway.
"sent"

Success DLR received from gateway. Message has been sent downstream.

"dlr_timeout"No DLR from downstream.
"delivered"

To the best of our knowledge, the message was delivered.

"failed"

Failure DLR from gateway or downstream, which is notification of message delivery failure.