Get deployment events
GET
https://api.vercel.com/v3/deployments/{idOrUrl}/eventsGet the build logs of a deployment by deployment ID and build ID. It can work as an infinite stream of logs or as a JSON endpoint depending on the input parameters.
Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.deployments.getDeploymentEvents({ idOrUrl: "dpl_5WJWYSyB7BpgTj3EuwF37WMRBXBtPQ2iTMJHJBJyRfd", direction: "backward", follow: 1, limit: 100, name: "bld_cotnkcr76", since: 1540095775941, until: 1540106318643, statusCode: "5xx", delimiter: 1, builds: 1, teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
[ { "created": "123", "payload": { "created": "123", "date": "123", "deploymentId": "example_id", "id": "icfg_1234567890", "info": { "entrypoint": "string", "name": "Example Name", "path": "string", "readyState": "string", "serviceName": "Example Name", "step": "string", "type": "string" }, "proxy": { "cacheId": "example_id", "clientIp": "string", "host": "string", "lambdaRegion": "string", "method": "string", "path": "string", "pathType": "string", "pathTypeVariant": "string", "referer": "string", "region": "string", "responseByteSize": "123", "scheme": "string", "statusCode": "123", "timestamp": "123", "userAgent": [], "vercelCache": "BYPASS", "vercelId": "example_id", "wafAction": "bypass", "wafRuleId": "example_id" }, "requestId": "example_id", "serial": "string", "statusCode": "123", "text": "string" }, "type": "command" }]AuthorizationbearerToken
Default authentication mechanism