Rate this page:

Functions & Assets (API)

Twilio Functions & Assets is a serverless environment to empower developers like you to 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.

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

Retention Policy

The following will be retained for a maximum of 30 days and then deleted:

This policy will not impact any active deployments at any point. This policy will only apply to users using the API, serverless toolkit or the new UI editor. This policy does not apply to Functions(Classic) and Assets(Classic).

Data generated by underlying products used via Functions, such as SMS or voice calls, is retained/deleted in line with those products' data policies. Details of individual product data retention policies can be found in the specific product documentation, such as here for SMS and here for voice calls.

Limitations, known issues and limits

  • Functions and Assets created by the API are not reflected in the Classic UI for those products. You cannot read Functions/Assets created via the Classic UI 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 50 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 Versions that are not part of any builds and are older than 30 days will be deleted.
  • Asset Versions that are not part of any build and are older than 30 days will be deleted.
  • Functions that don’t have any Function Versions and are older than 30 days will be deleted.
  • Assets that don’t have any Asset Versions and are older than 30 days will be deleted.
  • 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

UI Editor Limitations

The UI Editor can load up to 100 functions and 100 assets by default. If a service has more than 100 Functions or assets, you would need to click on "Load more" to view the rest of the resources. "Deploy All" button, "Save" button and making changes to dependencies would be disabled until all the functions and assets in service have been loaded.

Deleting functions/assets is disabled untill all functions/assets are loaded for view.

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 by visiting Twilio's Community Forums or browsing the Twilio tag on Stack Overflow.


        Thank you for your feedback!

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

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!

        Refer us and get $10 in 3 simple steps!

        Step 1

        Get link

        Get a free personal referral link here

        Step 2

        Give $10

        Your user signs up and upgrade using link

        Step 3

        Get $10

        1,250 free SMSes
        OR 1,000 free voice mins
        OR 12,000 chats
        OR more