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?

Environment

Environments define the different domains your Functions and Assets are available under. You can only have one environment, or you can have many, e.g. a dev, stage and prod. You can deploy Builds to many environments.

Environment properties

Names in PHP format
sid
sid<ZE> Not PII

The unique SID identifier of this Environment.

accountSid
sid<AC> Not PII

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

serviceSid
sid<ZS> Not PII

The unique SID identifier of the Service for this Environment.

buildSid
sid<ZB> Not PII

The unique SID identifier of the Build deployed in this Environment.

uniqueName

A unique, addressable name of this Environment, fewer than 256 characters.

domainSuffix

A URL-friendly name that represents this Environment and forms part of the domain name, fewer than 32 characters.

domainName

The base domain name for all Functions and Assets deployed in this Environment, using the Service unique name and Environment domain suffix.

dateCreated
date_time<iso8601> Not PII

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

dateUpdated
date_time<iso8601> Not PII

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

url
url Not PII

The URL of this Environment.

links
uri_map Not PII

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

Create an Environment resource

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

The unique SID identifier of the Service for this Environment.

unique_name
Required
post string PII MTL: 7 DAYS

A unique, addressable name of this Environment, fewer than 256 characters. Required.

domain_suffix
Optional
post string PII MTL: 7 DAYS

A URL-friendly name that represents this Environment and forms part of the domain name, fewer than 32 characters. Required.

Example 1
        
        
        
        

        Fetch an Environment resource

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

        The unique SID identifier of the Service for this Environment.

        sid
        Required
        get sid<ZE> Not PII

        The unique SID identifier of this Environment.

        Example
              
              
              
              

              Read multiple Environment resources

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

              The unique SID identifier of the Service for these Environments.

              Example
                    
                    
                    
                    

                    Delete an Environment resource

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

                    The unique SID identifier of the Service for this Environment.

                    sid
                    Required
                    delete sid<ZE> Not PII

                    The unique SID identifier of this Environment.

                    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.