Stream Resource
A Stream is a pub-sub primitive that lets you broadcast JSON messages at a high rate to an elastic group of subscribers.
- Messages are ephemeral - they can be published (created), but they cannot be queried, updated or deleted
- The maximum Message payload size as serialized JSON is 4KB.
- The maximum Message publishing rate per Stream is 30 per second.
- Message delivery to remote endpoints is not guaranteed.
- Messages may be received by remote endpoints in a different order than they were published.
See also Stream Message for information about the messages in a stream.
Sync Stream properties
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that we created to identify the Sync Stream resource. |
unique_name
|
An application-defined string that uniquely identifies the resource. It can be used in place of the resource's |
account_sid
|
The SID of the Account that created the Sync Stream resource. |
service_sid
|
The SID of the Sync Service the resource is associated with. |
url
|
The absolute URL of the Message Stream resource. |
links
|
The URLs of the Stream's nested resources. |
date_expires
|
The date and time in GMT when the Message Stream expires and will be deleted, specified in ISO 8601 format. If the Message Stream does not expire, this value is |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
created_by
|
The identity of the Stream's creator. If the Stream is created from the client SDK, the value matches the Access Token's |
Create a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service to create the new Stream in. |
unique_name
Optional
|
An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The |
ttl
Optional
|
How long, in seconds, before the Stream expires and is deleted (time-to-live). |
Example 1
Fetch a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Stream resource to fetch. |
sid
Path
|
The SID of the Stream resource to fetch. |
Example 1
Read multiple Sync Stream resources
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams
Note: Without a PageSize
query parameter, this will return only the first 50 Message Streams. Add a PageSize
query parameter to fetch up to 100 items at once. The example has a PageSize
value of 20.
See paging for more information.
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Stream resources to read. |
Example 1
Update a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Stream resource to update. |
sid
Path
|
The SID of the Stream resource to update. |
ttl
Optional
|
How long, in seconds, before the Stream expires and is deleted (time-to-live). |
Example 1
Delete a Sync Stream resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Streams/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Stream resource to delete. |
sid
Path
|
The SID of the Stream resource to delete. |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.