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.
The unique string that we created to identify the Build resource.
^ZB[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Build resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Service that the Build resource is associated with.
^ZS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The status of the Build. Can be: building
, completed
, or failed
.
building
completed
failed
The absolute URL of the Build Status resource.
GET https://serverless.twilio.com/v1/Services/{ServiceSid}/Builds/{Sid}/Status
The SID of the Build resource to fetch.
^ZB[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 fetchBuildStatus() {11const buildStatus = await client.serverless.v112.services("ServiceSid")13.builds("ZBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.buildStatus()15.fetch();1617console.log(buildStatus.sid);18}1920fetchBuildStatus();
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}