Skip to main content

Cancel a scheduled message

DELETE 
/messages/:id

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.

Request

Path Parameters

    id uuidrequired

    The id of the message to cancel

Responses

200: Successful response

403: Forbidden

404: Not found.

default: Unexpected error

Request samples


curl -L -X DELETE 'https://api.telnyx.com/v2/messages/:id' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>'

Response samples


{
"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!",
"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,
"currency": null
},
"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": []
}