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
|
The unique string that we created to identify the Environment resource. |
account_sid
|
The SID of the Account that created the Environment resource. |
service_sid
|
The SID of the Service that the Environment resource is associated with. |
build_sid
|
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
|
The date and time in GMT when the Environment resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the Environment resource was last updated specified in ISO 8601 format. |
url
|
The absolute URL of the Environment resource. |
links
|
The URLs of the Environment resource's nested resources. |
Create an Environment resource
https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to create the Environment resource under. |
unique_name
Required
|
A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 characters. |
domain_suffix
Optional
|
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
https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to fetch the Environment resource from. |
sid
Path
|
The SID of the Environment resource to fetch. |
Example 1
Read multiple Environment resources
https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to read the Environment resources from. |
Example 1
Delete an Environment resource
https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{Sid}
Parameters
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Service to delete the Environment resource from. |
sid
Path
|
The SID of the Environment resource to delete. |
Example 1
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.