---
title: get-log-lines-for-the-tasks-of-an-invocation-attempt
product: vercel
url: /docs/rest-api/vercel-ci/get-log-lines-for-the-tasks-of-an-invocation-attempt
canonical_url: "https://vercel.com/docs/rest-api/vercel-ci/get-log-lines-for-the-tasks-of-an-invocation-attempt"
last_updated: 2026-09-25
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about get-log-lines-for-the-tasks-of-an-invocation-attempt on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Get log lines for the tasks of an invocation attempt

```http
GET /v1/vercel-ci/invocations/{invocationId}/attempts/{attempt}/task-logs
```

Returns 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.

## Authentication

**bearerToken**: HTTP bearer

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `invocationId` | string | Yes |  |
| `attempt` | string | Yes |  |


## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `task` | array | No | Only return tasks with one of these names (e.g., \"web#test\"). |
| `conclusion` | array | No | Only return completed tasks with one of these conclusions. |
| `level` | array | No | Only return log lines with one of these levels. |
| `search` | string. maxLength: 256 | No | 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. |
| `limit` | number | No | Maximum number of tasks to return (default: 10, max: 25). |
| `teamId` | string | No | The Team identifier to perform the request on behalf of. |
| `slug` | string | No | The Team slug to perform the request on behalf of. |


## Example request

### TypeScript

```typescript
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);
```

### Next.js

```typescript
'use server';

export async function callEndpoint() {
  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 ${process.env.VERCEL_ACCESS_TOKEN}`,
      'Content-Type': 'application/json',
    },
    next: { revalidate: 3600 }
  });

  if (!response.ok) {
    throw new Error('Request failed');
  }

  return response.json();
}
```

### cURL

```bash
curl -X GET 'https://api.vercel.com/v1/vercel-ci/invocations/invocationId/attempts/attempt/task-logs?task=[]&conclusion=[]&level=[]&search=string&limit=123&teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
```

## Example response

```json
{
  "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"
}
```

## Responses

### 200: Successfully fetched task log lines.

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "tasks",
    "hasMore"
  ],
  "properties": {
    "tasks": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "jobDefinitionId",
          "jobName",
          "jobRunAttempt",
          "taskDefinitionId",
          "taskName",
          "lines"
        ],
        "properties": {
          "jobDefinitionId": {
            "type": "string"
          },
          "jobName": {
            "type": "string"
          },
          "jobRunAttempt": {
            "type": "number"
          },
          "taskDefinitionId": {
            "type": "string"
          },
          "taskName": {
            "type": "string"
          },
          "taskRunAttempt": {
            "type": "number"
          },
          "conclusion": {},
          "lines": {
            "type": "array"
          }
        }
      }
    },
    "hasMore": {
      "type": "boolean",
      "description": "Whether more tasks matched the filters than were returned. With `search`, whether more than 1000 lines matched."
    }
  }
}
```

### 400: One of the provided values in the request query is invalid.

### 401: The request is not authorized.

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
```

### 403: You do not have permission to access this resource.

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
```

### 404: No description

### 410: No description

### 429: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "name",
        "message",
        "limit"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "limit": {
          "type": "number"
        }
      }
    }
  }
}
```

### 500: No description

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
```

---

## Related

- [vercel-ci endpoints](/docs/rest-api#vercel-ci)

- [REST API overview](/docs/rest-api)

- [OpenAPI spec](https://vercel.com/openapi.json) (machine-readable, all endpoints)

---

[View full sitemap](/docs/sitemap)
