This Twilio product is currently available as a beta release. Some features are not yet implemented and others may be changed before the product is declared as Generally Available. Beta products are not covered by a Twilio SLA.
Learn more about beta product support.
Twilio Assets is a static file hosting service that allows developers to quickly upload and serve the files needed to support their applications. With Twilio Assets you can host files that support web, voice, and messaging applications. Twilio Assets is frequently used to host
.mp3 audio files used in TwiML, to serve images sent through MMSes, or store configuration used by Twilio Functions.
Twilio Assets provides you with two different types of Assets: public and private. The primary difference between the two types is how they are accessed. Public Assets are made available over the public internet. Private Assets are not publicly available, instead they are packaged with your Twilio Functions.
Anyone with the URL to a public asset will be able to access it. Therefore, customers should be thoughtful about what data they include in a public asset.
Please note that asset files are uploaded as is with all metadata persisted. If your asset files contain metadata, that will be stored with the file. An example would be exif metadata stored with an image. If you are making files available, please note that metadata is persisted and not removed/changed by the Assets product in anyway.
When Twilio builds your Function for deployment it will include any and all Private Assets you have uploaded. This makes Private Assets perfect for storing configuration files, templates and other sensitive data that supports your application.
Public Assets are served over HTTPS from the Twilio CDN to ensure it is highly available and secure. Typically, Public Assets are used to store static files that support an application. For example, Public Assets are perfect for hosting
.mp3 audio files used in TwiML or serve images sent through MMSes.
- Every Asset Request begins with an HTTP Client issuing a request to your Twilio Asset. For most Assets, the HTTP client is the Twilio Voice or Messaging API responding to an incoming phone call or text message
- Twilio Asset Gateway receives this request and attempts to validate it. If the request or Twilio Signature is invalid the request is rejected with the appropriate HTTP 400 response.
- After Twilio Asset Gateway has accepted the HTTP request, it will locate where your Asset has been stored on the Twilio CDN.
- Once the Twilio Asset Gateway has located the Asset it will request the content from the Twilio CDN
- Upon receiving the result from the Twilio CDN, the Twilio Asset Gateway will construct an HTTP Response and return it to the HTTP Client. In the background, the Twilio Asset Gateway will also cache the content of the Asset to ensure subsequent requests are faster.
Assets provides a simple drag-and-drop interface that makes getting started easy. Start by opening Assets in the Console. To upload a file to Assets, simply drag and drop the file onto the Assets list. Once the file has finished uploading, it will be available at the URL listed.
Assets also supports the standard file upload dialogue available in all major browsers. To open the file upload dialogue click the plus button ('+') in the top left corner of the Assets list.
Both public and private Assets have limitations on the maximum file size and quantity of each.
|Asset Type||Maximum Size||Quantity|
|Public||100 MB||500 Assets|
|Private||5 MB||10 Assets|