The new Serverless API empowers you to deploy Twilio Functions and Assets programmatically.
To deploy Functions and Assets right away, we suggest you look into the Serverless Toolkit, which gives you an installable development environment from which to build and deploy everything you need.
To play with the API itself, head over to our Quickstart.
The API comprises the following resources:
The animation below shows the relationship and purpose for each resource:
The new API gives you more control over the domains you serve your Functions and Assets from once deployed. Your domain structure looks like this:
https://[service unique name]-[random characters]-[optional domain suffix].twil.io/
So that means a Service with the unique name thanos
can create the following domains by specifying a domain suffix (or leaving it blank) when creating an Environment:
1https://thanos-3432.twil.io/ // Environment domain suffix left blank2https://thanos-3432-dev.twil.io/ // Environment domain suffix = dev3https://thanos-3432-test.twil.io/ // Environment domain suffix = test4https://thanos-3432-stage.twil.io/ // Environment domain suffix = stage
The following entities will be retained for up to 7 days and then deleted:
The following entities will be retained for up to 30 days and then deleted:
console.log()
, console.info()
, console.warn()
, and console.error()
methodsThis policy will not affect any active deployments at any point. It will only apply to users working with the API, Serverless Toolkit or the new UI editor. It does not apply to Functions (Classic) and Assets (Classic).
Data generated by the underlying products used via Functions, such as SMS or voice calls, is retained/deleted in line with those products' own data-retention policies. You can find details of individual product data-retention policies in the specific product documentation, such as this page for SMS and this page for voice calls.
GET
for Asset Versions. You cannot retrieve the Asset file content itself via the API.devDependencies
instead of dependencies
if using the Serverless Toolkit.Both public and private Assets have limitations on the maximum file size of each when using APIs:
Asset Type | Maximum Size |
---|---|
Public and protected | 25MB |
Private | 10MB |