Get an invocation with its jobs and tasks
GET
https://api.vercel.com/v1/vercel-ci/invocations/{invocationId}/treeReturns an invocation attempt together with every job definition, its latest job run, and the task definitions and active task runs of that job run. Defaults to the latest attempt when
attempt is omitted. With follow=1 the response is a newline-delimited JSON stream: a {"type":"tree", ...} event with the full tree is sent immediately and again whenever it changes, and a final {"type":"end","reason":...} event is sent when the attempt finishes (completed) or the stream reaches its maximum duration (timeout), after which clients should reconnect.https://api.vercel.com/v1/vercel-ci/invocations/{invocationId}/tree
const response = await fetch('https://api.vercel.com/v1/vercel-ci/invocations/invocationId/tree?attempt=string&follow=123&teamId=string&slug=string', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', },});
const data = await response.json();console.log(data);Response
{ "invocation": { "invocationId": "example_id", "attempt": "123", "teamId": "example_id", "source": { "type": "string" }, "createdAt": "123", "repositoryKey": "string", "ref": "string", "commitSha": "string", "skipped": { "reason": "Customer requested refund" }, "bootstrappingStarted": { "startedAt": "123" }, "bootstrappingFailed": { "reason": "Customer requested refund" }, "sandboxSnapshotted": { "sandboxSnapshotId": "example_id", "workingDirectory": "string", "snapshottedAt": "123" }, "sandboxNamed": { "sandboxName": "Example Name", "workingDirectory": "string", "readyAt": "123" }, "jobDefinitionsCreated": { "names": [], "source": "string", "scheduledAt": "123" }, "completed": { "completedAt": "123", "conclusion": "string" }, "setupConclusion": { "result": "string" }, "runConclusion": { "result": "string" }, "status": "string" }, "repositories": "value", "jobs": [ { "definition": { "invocationId": "example_id", "invocationAttempt": "123", "jobDefinitionId": "example_id", "kind": "string", "name": "Example Name", "command": "string", "createdAt": "123" }, "run": { "invocationId": "example_id", "invocationAttempt": "123", "jobDefinitionId": "example_id", "attempt": "123", "createdAt": "123", "started": { "startedAt": "123" }, "completed": { "completedAt": "123", "conclusion": { "result": "string" } } }, "tasks": [ { "definition": { "invocationId": "example_id", "invocationAttempt": "123", "jobDefinitionId": "example_id", "jobRunAttempt": "123", "taskDefinitionId": "example_id", "name": "Example Name", "packageDirectory": "string", "operation": { "kind": "string", "command": "string" }, "dependencyTaskDefinitionIds": [], "createdAt": "123" }, "run": { "invocationId": "example_id", "invocationAttempt": "123", "jobDefinitionId": "example_id", "jobRunAttempt": "123", "taskDefinitionId": "example_id", "attempt": "123", "createdAt": "123", "started": { "startedAt": "123" }, "completed": { "completedAt": "123", "conclusion": { "result": "string" } }, "deploymentBinding": { "deploymentId": "example_id", "deploymentCreatedAt": "123", "eventAt": "123", "readyState": "string" } } } ] } ]}Errors
{ "error": { "code": "string", "message": "string" }}AuthorizationbearerToken
Default authentication mechanism