Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Functions & Assets (API-only)

Twilio Functions & Assets is a serverless environment to empower developers like you to quickly and easily create production-grade, event-driven applications that scale with your business. Assets can be used to upload and host static files that support web, voice, and messaging applications.

The new Serverless API lets you deploy Twilio Functions & Assets.

Beta limitations, known issues and limits

  • Functions and Assets created by the API are not reflected in the console UI for those products. You cannot read Functions/Assets created via the console UX via the API. The two systems are separate. See this overview of the differences.
  • To set a Function created by this API to execute against a phone number, you must set the voice/sms webhook to the full Function path, not try and select it in the Functions drop down on the phone numbers page.
  • There is no GET of Asset Versions - you cannot retrieve the asset file content itself via the API at this time.


  • An account can have 10 services.
  • A service can have up to 25 environments.
  • A build can contain up to 50 Function versions.
  • A build can contain up to 1000 public/protected asset versions.
  • A build can contain up to 50 private asset versions.
  • An account can do up to 100 builds per hour.
  • Builds without an active deployment are deleted after 24 hours.
  • Function execution time is limited to 10 seconds.
  • An account can execute up to 30 functions concurrently.

Both public and private Assets have limitations on the maximum file size of each when using APIs.

Asset Type Maximum Size
Public and protected 25 MB
Private 10 MB

Getting started

If you would like to start deploying Functions & 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 start playing with the API itself, head over to our Quickstart.

API reference

The API consists of the following resources:

The animation below shows the relationship and purpose for each resource.

Serverless API resource overview animation

Understanding domains

With the new API, we're giving 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]

So that means a service with the unique name called thanos can create the following domains by specifying domain suffix (or leaving it blank) when creating an environment. //Environment DomainSuffix left blank //Environment DomainSuffix=dev //Environment DomainSuffix=test //Environment DomainSuffix=stage
Rate this page:

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 browsing the Twilio tag on Stack Overflow.