Skip to contentSkip to navigationSkip to topbar
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.


Status Properties

status-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<ZB>

Optional

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>

Optional

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>

Optional

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>

Optional

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

Possible values:
buildingcompletedfailed

urlstring<uri>

Optional

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 StatusLink to code sample: Fetch a Status
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchBuildStatus() {
11
const buildStatus = await client.serverless.v1
12
.services("ServiceSid")
13
.builds("ZBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
14
.buildStatus()
15
.fetch();
16
17
console.log(buildStatus.sid);
18
}
19
20
fetchBuildStatus();

Output

1
{
2
"sid": "ZBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"service_sid": "ServiceSid",
5
"status": "completed",
6
"url": "https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds/ZB00000000000000000000000000000000/Status"
7
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.