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.
A protected Function or Asset requires a valid Twilio request signature to be accessed. This means that the Function or Asset is only accessible if the request to access it contains the X-Twilio-Signature header and the signature is valid. This means you can limit your Functions and Assets only to be accessible to Twilio webhooks, such as on an incoming call or SMS message. Configure a phone number on the Twilio console to set a Function as the response to a webhook.
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
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||25 MB||1000 Assets|
|Private||10 MB||50 Assets|
|Protected||25 MB||1000 Assets|