v77

latestOpenAPI 3.1.0MITraw.githubusercontent.com2026-08-012528701.8 MB
Messages

Redact a message

Redact the body of a previously sent message. This endpoint clears the message body for compliance, privacy, or moderation purposes — it does not support arbitrary updates to message attributes. The only accepted value for body is an empty string (""); any other value is rejected.

Messages that are still in progress (queued or initiated) cannot be redacted. Messages in terminal states such as delivered, undelivered, or failed are eligible. Once redacted, the original body is overwritten and cannot be recovered.

The :message_id path parameter is the message segment ID — the same ID returned by the create endpoint and shown in /api/messaging/logs.

Permissions

The API token used to authenticate must have the following scope(s) enabled to make a successful request: Messaging.

Learn more about API scopes.

patch/api/messaging/messages/{message_id}

Path parameters

message_idstring uuid required

Universal Unique Identifier.

The message segment ID — the same ID returned by the create endpoint and shown in /api/messaging/logs.

Request body

bodystring required

Must be an empty string ("") to redact the message. Any non-empty value is rejected with body_must_be_empty. This is the only field that can be updated.

Response

Response returned when a message has been successfully redacted.

idstring uuid required

Universal Unique Identifier.

fromstring required

The source phone number.

tostring required

The destination phone number.

bodystring required

The message body text. Returns an empty string when the message has been redacted.

status'queued' | 'initiated' | 'sent' | 'delivered' | 'undelivered' | 'failed' | 'read' required

Delivery state of a message.

direction'inbound' | 'outbound' required

The direction of a message.

kind'sms' | 'mms' | 'whatsapp' required

The kind of message.

mediastring[] required

Array of URLs for any media attachments on the message. Empty for SMS.

number_of_segmentsinteger required

Number of segments the message body was split into for delivery.

error_codestring nullable required

Provider-specific error code if delivery failed. Null when no error occurred.

error_messagestring nullable required

Human-readable error message if delivery failed. Null when no error occurred.

created_atstring date-time required

Date and time when the message was created.

project_idstring uuid required

Universal Unique Identifier.

status_callback_urlstring uri nullable required

Callback URL configured to receive message status events. Null if no callback was configured.

message_uristring required

Relative URL for retrieving the message via the /api/messaging/logs endpoint.

Example response

{
  "from": "+15559876543",
  "to": "+15551234567",
  "body": "Your order #12345 has shipped!",
  "media": [],
  "number_of_segments": 1,
  "created_at": "2024-05-06T12:20:00Z",
  "message_uri": "/api/messaging/logs/c2d3e4f5-a6b7-8901-cdef-234567890abc"
}