Get log lines for the tasks of an invocation attempt
GET
https://api.vercel.com/v1/vercel-ci/invocations/{invocationId}/attempts/{attempt}/task-logsReturns log lines for the tasks of an invocation attempt in a single request, grouped by task. Tasks can be narrowed by name and by conclusion, for example
conclusion=failed to fetch only the logs of failed tasks. With search, every matching task is searched at once and only tasks with matching lines are returned.Request
import { Vercel } from "@vercel/sdk";
const vercel = new Vercel({ bearerToken: "<YOUR_BEARER_TOKEN_HERE>",});
async function run() { const result = await vercel.vercelCi.getVercelCiTaskLogs({ invocationId: "<id>", attempt: "<value>", teamId: "team_1a2b3c4d5e6f7g8h9i0j1k2l", slug: "my-team-url-slug", });
console.log(result);}
run();Response
{ "tasks": [ { "jobDefinitionId": "example_id", "jobName": "Example Name", "jobRunAttempt": "123", "taskDefinitionId": "example_id", "taskName": "Example Name", "taskRunAttempt": "123", "conclusion": { "result": "string" }, "lines": [ { "level": "string", "timestamp": "123", "message": "string" } ] } ], "hasMore": "true"}Errors
{ "error": { "code": "string", "message": "string" }}AuthorizationbearerToken
Default authentication mechanism
Only return log lines containing this text, ignoring case. Tasks without matching lines are left out,
limit is ignored, and at most 1000 lines are returned.