Menu

Expand
Rate this page:

Environment

Environments define the different domains your Functions and Assets are available under. You can have one environment, or you can have many, e.g., a dev, stage, and prod. You can deploy a Build to any of your 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 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
Loading Code Sample...
        
        

        Create Environment

        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
        Loading Code Sample...
              
              

              Fetch Environment

              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
              Loading Code Sample...
                    
                    

                    Read Environment

                    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
                    Loading Code Sample...
                          
                          

                          Delete Environment

                          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 Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                          Loading Code Sample...
                                
                                
                                

                                Thank you for your feedback!

                                Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

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

                                Thanks for your feedback!

                                thanks-feedback-gif