ConversationsMessage

Create Conversation Message

POST
/v1/Conversations/{ConversationSid}/Messages

Add a new message to the conversation

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Path Parameters

ConversationSid*string

The unique ID of the Conversation for this message.

Header Parameters

X-Twilio-Webhook-Enabled?ConversationMessageWebhookEnabledType

The X-Twilio-Webhook-Enabled HTTP request header

Value in

  • "true"
  • "false"

Request Body

application/x-www-form-urlencoded

Author?string

The channel specific identifier of the message's author. Defaults to system.

Body?string

The content of the message, can be up to 1,600 characters long.

DateCreated?string

The date that this resource was created.

Formatdate-time
DateUpdated?string

The date that this resource was last updated. null if the message has not been edited.

Formatdate-time
Attributes?string

A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. Note that if the attributes are not set "{}" will be returned.

MediaSid?string

The Media SID to be attached to the new Message.

Match^ME[0-9a-fA-F]{32}$
Length34 <= length <= 34
ContentSid?string

The unique ID of the multi-channel Rich Content template, required for template-generated messages. Note that if this field is set, Body and MediaSid parameters are ignored.

Match^HX[0-9a-fA-F]{32}$
Length34 <= length <= 34
ContentVariables?string

A structurally valid JSON string that contains values to resolve Rich Content template variables.

Subject?string

The subject of the message, can be up to 256 characters long.

Response Body

application/json

curl -X POST "https://example.com/v1/Conversations/string/Messages" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'Body=Hello&Author=message+author&Attributes=%7B+%22importance%22%3A+%22high%22+%7D&DateCreated=2015-12-16T22%3A18%3A37Z&DateUpdated=2015-12-16T22%3A18%3A38Z'

{  "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "conversation_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "body": "Hello",  "media": null,  "author": "message author",  "participant_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "attributes": "{ \"importance\": \"high\" }",  "date_created": "2015-12-16T22:18:37Z",  "date_updated": "2015-12-16T22:18:38Z",  "index": 0,  "delivery": {    "total": 2,    "sent": "all",    "delivered": "some",    "read": "some",    "failed": "none",    "undelivered": "none"  },  "content_sid": null,  "url": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "links": {    "delivery_receipts": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Receipts",    "channel_metadata": "https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelMetadata"  }}