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.https://api.vercel.com/v1/vercel-ci/invocations/{invocationId}/attempts/{attempt}/task-logs
const response = await fetch('https://api.vercel.com/v1/vercel-ci/invocations/invocationId/attempts/attempt/task-logs?task=[]&conclusion=[]&level=[]&search=string&limit=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
{ "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.