Create a new Stream Message.

POST /v1/Services/{ServiceSid}/Streams/{StreamSid}/Messages

Create a new Stream Message.

Path parameters

  • ServiceSid string Required

    The SID of the Sync Service to create the new Stream Message in.

  • StreamSid string Required

    The SID of the Sync Stream to create the new Stream Message resource for.

application/x-www-form-urlencoded

Body

  • Data Required

    A JSON string that represents an arbitrary, schema-less object that makes up the Stream Message body. Can be up to 4 KiB in length.

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • sid string | null

      The unique string that we created to identify the Stream Message resource.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^TZ[0-9a-fA-F]{32}$.

    • data object | null

      An arbitrary, schema-less object that contains the Stream Message body. Can be up to 4 KiB in length.

POST /v1/Services/{ServiceSid}/Streams/{StreamSid}/Messages
curl \
 --request POST 'https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{StreamSid}/Messages' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'Data=%7B%7D'
Request example
{"Data"=>"{}"}
Response examples (201)
{
  "sid": "TZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "data": {}
}