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

Build Status


The /Status endpoint for each Build lets you retrieve the status of that Build. We recommend using this endpoint to poll for the status, rather than the /Builds endpoint.


BuildStatus Properties

buildstatus-properties page anchor
Property nameTypePIIDescription
sidSID<ZB>
Not PII

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

Pattern: ^ZB[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

The SID of the Account that created the Build resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

service_sidSID<ZS>

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

Pattern: ^ZS[0-9a-fA-F]{32}$Min length: 34Max length: 34

statusenum<string>

The status of the Build. Can be: building, completed, or failed.

Possible values:
buildingcompletedfailed

urlstring<uri>

The absolute URL of the Build Status resource.


Fetch a BuildStatus resource

fetch-a-buildstatus-resource page anchor
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds/{Sid}/Status

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


SidSID<ZB>required

The SID of the Build resource to fetch.

Pattern: ^ZB[0-9a-fA-F]{32}$Min length: 34Max length: 34

Fetch a BuildStatus

fetch-a-buildstatus page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function fetchBuildStatus() {
_20
const buildStatus = await client.serverless.v1
_20
.services("ServiceSid")
_20
.builds("ZBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_20
.buildStatus()
_20
.fetch();
_20
_20
console.log(buildStatus.sid);
_20
}
_20
_20
fetchBuildStatus();

Output

_10
{
_10
"sid": "ZBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"service_sid": "ServiceSid",
_10
"status": "completed",
_10
"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds/ZB00000000000000000000000000000000/Status"
_10
}


Rate this page: