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 string that we created to identify the Environment resource.

accountSid
sid<AC> Not PII

The SID of the Account that created the Environment resource.

serviceSid
sid<ZS> Not PII

The SID of the Service that the Environment resource is associated with.

buildSid
sid<ZB> Not PII

The SID of the build deployed in the environment.

uniqueName

An application-defined string that uniquely identifies the Environment resource. It can be used in place of the Environment resource's sid in the URL to address the Environment resource.

domainSuffix

A URL-friendly name that represents the environment and forms part of the domain name.

domainName

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

dateCreated
date_time<iso8601> Not PII

The date and time in GMT when the Environment resource was created specified in ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

The date and time in GMT when the Environment resource was last updated specified in ISO 8601 format.

url
url Not PII

The absolute URL of the Environment resource.

links
uri_map Not PII

The URLs of the environment's nested resources.

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 SID of the Service to create the Environment resource under.

unique_name
Required
post string PII MTL: 7 DAYS

An application-defined string that uniquely identifies the Environment resource. It can be used as an alternative to the sid in the URL path to address the Environment resource. This value must have fewer than 256 characters.

domain_suffix
Optional
post string PII MTL: 7 DAYS

A URL-friendly name that represents the environment and forms part of the domain name. Must have fewer than 32 characters.

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 SID of the Service to fetch the Environment resource from.

        sid
        Required
        get sid<ZE> Not PII

        The SID of the Environment resource to fetch.

        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 SID of the Service to read the Environment resources from.

              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 SID of the Service to delete the Environment resource from.

                    sid
                    Required
                    delete sid<ZE> Not PII

                    The SID of the Environment resource to delete.

                    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.