v47

latestOpenAPI 3.1.0raw.githubusercontent.com2026-06-181,0851,7264.5 MB
Messages

Cancel a scheduled message

Cancel a scheduled message that has not yet been sent. Only messages with status=scheduled and send_at more than a minute from now can be cancelled.

delete/messages/{id}

Path parameters

idstring uuid required

The id of the message to cancel

Response

Successful response

record_type'message'

Identifies the type of the resource.

direction'outbound'

The direction of the message. Inbound messages are sent to you whereas outbound messages are sent from you.

idstring uuid

Identifies the type of resource.

type'SMS' | 'MMS'

The type of message.

messaging_profile_idstring

Unique identifier for a messaging profile.

organization_idstring uuid

The id of the organization the messaging profile belongs to.

textstring

Message body (i.e., content) as a non-empty string.

Required for SMS

num_charsinteger

The number of characters in the message text

subjectstring nullable

Subject of multimedia message

webhook_urlstring url nullable

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

webhook_failover_urlstring url nullable

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

encodingstring

Encoding scheme used for the message body.

partsinteger

Number of parts into which the message's body must be split.

tagsstring[]

Tags associated with the resource.

tcr_campaign_idstring nullable

The Campaign Registry (TCR) campaign ID associated with the message.

tcr_campaign_billableboolean

Indicates whether the TCR campaign is billable.

tcr_campaign_registeredstring nullable

The registration status of the TCR campaign.

received_atstring date-time

ISO 8601 formatted date indicating when the message request was received.

sent_atstring date-time nullable

ISO 8601 formatted date indicating when the message was sent.

completed_atstring date-time nullable

ISO 8601 formatted date indicating when the message was finalized.

valid_untilstring date-time nullable

Message must be out of the queue by this time or else it will be discarded and marked as 'sending_failed'. Once the message moves out of the queue, this field will be nulled

smart_encoding_appliedboolean

Indicates whether smart encoding was applied to this message. When true, one or more Unicode characters were automatically replaced with GSM-7 equivalents to reduce segment count and cost. The original message text is preserved in webhooks.

Example response

{
  "record_type": "message",
  "direction": "outbound",
  "id": "40385f64-5717-4562-b3fc-2c963f66afa6",
  "type": "SMS",
  "messaging_profile_id": "4000eba1-a0c0-4563-9925-b25e842a7cb6",
  "organization_id": "b448f9cc-a842-4784-98e9-03c1a5872950",
  "from": {
    "phone_number": "+18445550001",
    "carrier": "TELNYX LLC",
    "line_type": "VoIP"
  },
  "to": [
    {
      "phone_number": "+18665550001",
      "status": "cancelled",
      "carrier": "T-MOBILE USA, INC.",
      "line_type": "Wireless"
    }
  ],
  "cc": [],
  "text": "Hello, World!",
  "num_chars": 13,
  "subject": "From Telnyx!",
  "media": [],
  "webhook_url": "https://www.example.com/hooks",
  "webhook_failover_url": "https://backup.example.com/hooks",
  "encoding": "GSM-7",
  "parts": 1,
  "tags": [
    "Greetings"
  ],
  "cost": {
    "amount": "0.0",
    "currency": "USD"
  },
  "cost_breakdown": null,
  "tcr_campaign_id": "TCPA3X7",
  "tcr_campaign_billable": true,
  "tcr_campaign_registered": "REGISTERED",
  "received_at": "2019-01-23T18:10:02.574Z",
  "sent_at": null,
  "completed_at": null,
  "valid_until": null,
  "errors": []
}