Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

Menu

Expand
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?

Function

Functions are JavaScript Node.js code that execute at a particular domain.

The steps to create Functions are as follows:

  1. Create a Function (this resource)
  2. Create a Function Version via serverless-upload.twilio.com

We will need the Function Version SID to include this Function in a Build.

Function properties

Names in PHP format
sid
sid<ZH> Not PII

The unique SID identifier of this Function.

accountSid
sid<AC> Not PII

The unique SID identifier of the Account that owns this Function.

serviceSid
sid<ZS> Not PII

The unique SID identifier of the Service for this Function.

friendlyName

A human-readable description of this Function, fewer than 256 characters.

dateCreated
date_time<iso8601> Not PII

The date that this Function was created, given in ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

The date that this Function was updated, given in ISO 8601 format.

url
url Not PII

The URL of this Function.

links
uri_map Not PII

Contains a dictionary of URL links to nested resources of this Function.

Create a Function resource

post
https://serverless.twilio.com/v1/Services/{ServiceSid}/Functions
Parameters
Names in None format
service_sid
Required
post sid_like<ZS> Not PII

The unique SID identifier of the Service for this Function.

friendly_name
Required
post string PII MTL: 7 DAYS

A human-readable description of this Function, fewer than 256 characters. Required.

Example
        
        
        
        

        Fetch a Function resource

        get
        https://serverless.twilio.com/v1/Services/{ServiceSid}/Functions/{Sid}
        Parameters
        Names in None format
        service_sid
        Required
        get sid_like<ZS> Not PII

        The unique SID identifier of the Service for this Function.

        sid
        Required
        get sid<ZH> Not PII

        The unique SID identifier of this Function.

        Example
              
              
              
              

              Read multiple Function resources

              get
              https://serverless.twilio.com/v1/Services/{ServiceSid}/Functions
              Parameters
              Names in None format
              service_sid
              Required
              get sid_like<ZS> Not PII

              The unique SID identifier of the Service for these Functions.

              Example
                    
                    
                    
                    

                    Update a Function resource

                    post
                    https://serverless.twilio.com/v1/Services/{ServiceSid}/Functions/{Sid}
                    Parameters
                    Names in None format
                    service_sid
                    Required
                    post sid_like<ZS> Not PII

                    The unique SID identifier of the Service for this Function.

                    sid
                    Required
                    post sid<ZH> Not PII

                    The unique SID identifier of this Function.

                    friendly_name
                    Required
                    post string PII MTL: 7 DAYS

                    A human-readable description of this Function, fewer than 256 characters. Required.

                    Example
                          
                          
                          
                          

                          Delete a Function resource

                          delete
                          https://serverless.twilio.com/v1/Services/{ServiceSid}/Functions/{Sid}
                          Parameters
                          Names in None format
                          service_sid
                          Required
                          delete sid_like<ZS> Not PII

                          The unique SID identifier of the Service for these Functions.

                          sid
                          Required
                          delete sid<ZH> Not PII

                          The unique SID identifier of this Function.

                          Example
                                
                                
                                
                                
                                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.