Deployments let you set a particular Build to be live on a particular Environment.
The unique string that we created to identify the Deployment resource.
^ZD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Deployment resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Service that the Deployment resource is associated with.
^ZS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Environment for the Deployment.
^ZE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Build for the deployment.
^ZB[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT when the Deployment resource was created specified in ISO 8601 format.
The date and time in GMT when the Deployment resource was last updated specified in ISO 8601 format.
The absolute URL of the Deployment resource.
POST https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Deployments
application/x-www-form-urlencoded
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createDeployment() {11const deployment = await client.serverless.v112.services("ServiceSid")13.environments("ZEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.deployments.create({ buildSid: "ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" });1516console.log(deployment.sid);17}1819createDeployment();
1{2"sid": "ZD00000000000000000000000000000000",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "ServiceSid",5"environment_sid": "ZEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"build_sid": "ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",7"date_created": "2018-11-10T20:00:00Z",8"date_updated": "2018-11-10T20:00:00Z",9"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000"10}
POST
ing to the deployment endpoint without a Build SID will delete any existing deployments in that Environment. Calls to Functions & Assets that were hosted by that Environment will result in 404s.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createDeployment() {11const deployment = await client.serverless.v112.services("ServiceSid")13.environments("ZEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.deployments.create();1516console.log(deployment.sid);17}1819createDeployment();
1{2"sid": "ZD00000000000000000000000000000000",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "ServiceSid",5"environment_sid": "ZEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"build_sid": "ZB00000000000000000000000000000000",7"date_created": "2018-11-10T20:00:00Z",8"date_updated": "2018-11-10T20:00:00Z",9"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000"10}
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Deployments/{Sid}
The SID of the Environment used by the Deployment to fetch.
^ZE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID that identifies the Deployment resource to fetch.
^ZD[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchDeployment() {11const deployment = await client.serverless.v112.services("ServiceSid")13.environments("ZEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.deployments("ZDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")15.fetch();1617console.log(deployment.sid);18}1920fetchDeployment();
1{2"sid": "ZDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"service_sid": "ServiceSid",5"environment_sid": "ZEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",6"build_sid": "ZB00000000000000000000000000000000",7"date_created": "2018-11-10T20:00:00Z",8"date_updated": "2018-11-10T20:00:00Z",9"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000"10}
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Deployments
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listDeployment() {11const deployments = await client.serverless.v112.services("ServiceSid")13.environments("ZEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.deployments.list({ limit: 20 });1516deployments.forEach((d) => console.log(d.sid));17}1819listDeployment();
1{2"deployments": [],3"meta": {4"first_page_url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=0",5"key": "deployments",6"next_page_url": null,7"page": 0,8"page_size": 50,9"previous_page_url": null,10"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=0"11}12}