Send a message with a Phone Number, Alphanumeric Sender ID, Short Code or Number Pool.
This endpoint allows you to send a message with any messaging resource. Current messaging resources include: long-code, short-code, number-pool, and alphanumeric-sender-id.
Message payload
Successful response with details about a message.
{- "from": "+18445550001",
- "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600000000",
- "subject": "From Telnyx!",
- "text": "Hello, World!",
- "to": "+18445550001",
- "type": "MMS",
- "use_profile_webhooks": true,
}
{- "data": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}
}
{- "data": {
- "event_type": "message.sent",
- "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "occurred_at": "date-time",
- "payload": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}, - "record_type": "event"
},
}
Message payload
auto_detect | boolean Default: false Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. |
from required | string <address> Phone number, in +E.164 format, used to send the message. |
media_urls | Array of strings <url> A list of media URLs. The total media size must be less than 1 MB. Required for MMS |
subject | string Subject of multimedia message |
text | string Message body (i.e., content) as a non-empty string. Required for SMS |
to required | string <address> (ToNumber) Receiving address (+E.164 formatted phone number or short code). |
type | string The protocol for sending the message, either SMS or MMS. |
use_profile_webhooks | boolean Default: true 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. |
webhook_failover_url | string <url> The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. |
webhook_url | string <url> The URL where webhooks related to this message will be sent. |
Successful response with details about a message.
object (OutboundMessagePayload) | |||||||||||||||||||||||||||||||||||||||||||||
|
{- "from": "+18445550001",
- "subject": "From Telnyx!",
- "text": "Hello, World!",
- "to": "+13125550002",
- "type": "MMS",
- "use_profile_webhooks": true,
}
{- "data": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}
}
{- "data": {
- "event_type": "message.sent",
- "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "occurred_at": "date-time",
- "payload": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}, - "record_type": "event"
},
}
Message payload
auto_detect | boolean Default: false Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. |
media_urls | Array of strings <url> A list of media URLs. The total media size must be less than 1 MB. Required for MMS |
messaging_profile_id required | string Unique identifier for a messaging profile. |
subject | string Subject of multimedia message |
text | string Message body (i.e., content) as a non-empty string. Required for SMS |
to required | string <address> (ToNumber) Receiving address (+E.164 formatted phone number or short code). |
type | string The protocol for sending the message, either SMS or MMS. |
use_profile_webhooks | boolean Default: true 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. |
webhook_failover_url | string <url> The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. |
webhook_url | string <url> The URL where webhooks related to this message will be sent. |
Successful response with details about a message.
object (OutboundMessagePayload) | |||||||||||||||||||||||||||||||||||||||||||||
|
{- "from": "+18445550001",
- "messaging_profile_id": "abc85f64-5717-4562-b3fc-2c9600000000",
- "subject": "From Telnyx!",
- "text": "Hello, World!",
- "to": [
- "+13125550002"
], - "type": "MMS",
- "use_profile_webhooks": true,
}
{- "data": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}
}
{- "data": {
- "event_type": "message.sent",
- "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "occurred_at": "date-time",
- "payload": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}, - "record_type": "event"
},
}
Message payload
auto_detect | boolean Default: false Automatically detect if an SMS message is unusually long and exceeds a recommended limit of message parts. |
from required | string <address> Phone number, in +E.164 format, used to send the message. |
media_urls | Array of strings <url> A list of media URLs. The total media size must be less than 1 MB. Required for MMS |
subject | string Subject of multimedia message |
text | string Message body (i.e., content) as a non-empty string. Required for SMS |
to required | string <address> (ToNumber) Receiving address (+E.164 formatted phone number or short code). |
type | string The protocol for sending the message, either SMS or MMS. |
use_profile_webhooks | boolean Default: true 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. |
webhook_failover_url | string <url> The failover URL where webhooks related to this message will be sent if sending to the primary URL fails. |
webhook_url | string <url> The URL where webhooks related to this message will be sent. |
Successful response with details about a message.
object (OutboundMessagePayload) | |||||||||||||||||||||||||||||||||||||||||||||
|
{- "from": "+18445550001",
- "subject": "From Telnyx!",
- "text": "Hello, World!",
- "to": "+18445550001",
- "type": "MMS",
- "use_profile_webhooks": true,
}
{- "data": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}
}
{- "data": {
- "event_type": "message.sent",
- "id": "86f58db9-0fe3-4adc-9d1f-46e66e6e9323",
- "occurred_at": "date-time",
- "payload": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}, - "record_type": "event"
},
}
Note: This API endpoint can only retrieve messages that are no older than 10 days since their creation. If you require messages older than this, please generate an MDR report.
Successful response with details about a message.
object (OutboundMessagePayload) | |||||||||||||||||||||||||||||||||||||||||||||
|
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.Message.retrieve("uuid")
{- "data": {
- "completed_at": null,
- "cost": null,
- "direction": "outbound",
- "encoding": "GSM-7",
- "errors": [ ],
- "from": {
- "carrier": "TELNYX LLC",
- "line_type": "VoIP",
- "phone_number": "+18445550001"
}, - "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
- "media": [
- {
- "content_type": null,
- "sha256": null,
- "size": null,
}
], - "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
- "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"
], - "text": "Hello, World!",
- "to": [
- {
- "carrier": "T-MOBILE USA, INC.",
- "line_type": "Wireless",
- "phone_number": "+18665550001",
- "status": "queued"
}
], - "type": "MMS",
- "valid_until": null,
}
}