Menu

Expand
Rate this page:

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

Resource Properties in REST API format
sid
sid<ZE> Not PII

The unique string that we created to identify the Environment resource.

account_sid
sid<AC> Not PII

The SID of the Account that created the Environment resource.

service_sid
sid<ZS> Not PII

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

build_sid
sid<ZB> Not PII

The SID of the build deployed in the environment.

unique_name

A user-defined string that uniquely identifies the Environment resource.

domain_suffix

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

domain_name

The base domain name for all Functions and Assets deployed in the Environment, using the Service unique name, a randomly-generated Service suffix, and an optional Environment domain suffix.

date_created
date_time<iso8601> Not PII

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

date_updated
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 resource's nested resources.

Create an Environment resource

post
https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments
Parameters
Parameters in REST API format
service_sid
Path
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

A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 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. It can be a maximum of 16 characters.

Example 1
        
        
        
        

        Fetch an Environment resource

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

        The SID of the Service to fetch the Environment resource from.

        sid
        Path
        get sid<ZE> Not PII

        The SID of the Environment resource to fetch.

        Example 1
              
              
              
              

              Read multiple Environment resources

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

              The SID of the Service to read the Environment resources from.

              Example 1
                    
                    
                    
                    

                    Delete an Environment resource

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

                    The SID of the Service to delete the Environment resource from.

                    sid
                    Path
                    delete sid<ZE> Not PII

                    The SID of the Environment resource to delete.

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

                                
                                
                                

                                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