Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Deployment


Deployments let you set a particular Build to be live on a particular Environment.


Deployment Properties

deployment-properties page anchor
Resource properties
sidtype: SID<ZD>Not PII

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


service_sidtype: SID<ZS>Not PII

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


environment_sidtype: SID<ZE>Not PII

The SID of the Environment for the Deployment.


build_sidtype: SID<ZB>Not PII

The SID of the Build for the deployment.


date_createdtype: string<DATE TIME>Not PII

The date and time in GMT when the Deployment resource was created specified in ISO 8601(link takes you to an external page) format.


date_updatedtype: string<DATE TIME>Not PII

The date and time in GMT when the Deployment resource was last updated specified in ISO 8601(link takes you to an external page) format.


urltype: string<URI>Not PII

The absolute URL of the Deployment resource.


Create a Deployment resource

create-a-deployment-resource page anchor
POST https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Deployments

Parameters

create-parameters page anchor
URI parameters
ServiceSidtype: stringNot PII
Path Parameter

The SID of the Service to create the Deployment resource under.


EnvironmentSidtype: SID<ZE>Not PII
Path Parameter

The SID of the Environment for the Deployment.


Request body parameters
BuildSidtype: SID<ZB>Not PII

The SID of the Build for the Deployment.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.deployments
_12
.create({buildSid: 'ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'})
_12
.then(deployment => console.log(deployment.sid));

Output

_10
{
_10
"sid": "ZD00000000000000000000000000000000",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"service_sid": "ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"environment_sid": "ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"build_sid": "ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "2018-11-10T20:00:00Z",
_10
"date_updated": "2018-11-10T20:00:00Z",
_10
"url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000"
_10
}

(information)

Info

POSTing 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.

Clear all Deployments from an Environment

clear-all-deployments-from-an-environment page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.deployments
_12
.create()
_12
.then(deployment => console.log(deployment.sid));

Output

_10
{
_10
"sid": "ZD00000000000000000000000000000000",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"service_sid": "ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"environment_sid": "ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"build_sid": "ZB00000000000000000000000000000000",
_10
"date_created": "2018-11-10T20:00:00Z",
_10
"date_updated": "2018-11-10T20:00:00Z",
_10
"url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000"
_10
}


Fetch a Deployment resource

fetch-a-deployment-resource page anchor
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Deployments/{Sid}

URI parameters
ServiceSidtype: stringNot PII
Path Parameter

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


EnvironmentSidtype: SID<ZE>Not PII
Path Parameter

The SID of the Environment used by the Deployment to fetch.


Sidtype: SID<ZD>Not PII
Path Parameter

The SID that identifies the Deployment resource to fetch.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.deployments('ZDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.fetch()
_12
.then(deployment => console.log(deployment.sid));

Output

_10
{
_10
"sid": "ZDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"service_sid": "ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"environment_sid": "ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"build_sid": "ZB00000000000000000000000000000000",
_10
"date_created": "2018-11-10T20:00:00Z",
_10
"date_updated": "2018-11-10T20:00:00Z",
_10
"url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000"
_10
}


Read multiple Deployment resources

read-multiple-deployment-resources page anchor
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Environments/{EnvironmentSid}/Deployments

URI parameters
ServiceSidtype: stringNot PII
Path Parameter

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


EnvironmentSidtype: SID<ZE>Not PII
Path Parameter

The SID of the Environment used by the Deployment resources to read.


PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

List multiple Deployments

list-multiple-deployments page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.deployments
_12
.list({limit: 20})
_12
.then(deployments => deployments.forEach(d => console.log(d.sid)));

Output

_12
{
_12
"deployments": [],
_12
"meta": {
_12
"first_page_url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=0",
_12
"key": "deployments",
_12
"next_page_url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=1",
_12
"page": 0,
_12
"page_size": 50,
_12
"previous_page_url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=0",
_12
"url": "https://serverless.twilio.com/v1/Services/ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=0"
_12
}
_12
}


Rate this page: