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.
Property nameTypeRequiredPIIDescriptionChild properties
The unique string that we created to identify the Build resource.
Pattern:
^ZB[0-9a-fA-F]{32}$Min length: 34Max length: 34The SID of the Account that created the Build resource.
Pattern:
^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34The SID of the Service that the Build resource is associated with.
Pattern:
^ZS[0-9a-fA-F]{32}$Min length: 34Max length: 34The status of the Build. Can be: building, completed, or failed.
Possible values:
buildingcompletedfailedThe absolute URL of the Build Status resource.
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds/{Sid}/Status
Property nameTypeRequiredPIIDescription
The SID of the Build resource to fetch.
Pattern:
^ZB[0-9a-fA-F]{32}$Min length: 34Max length: 341// 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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function fetchBuildStatus() {14const buildStatus = await client.serverless.v115.services("ServiceSid")16.builds("ZBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")17.buildStatus()18.fetch();1920console.log(buildStatus.sid);21}2223fetchBuildStatus();
Response
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}