---
title: search-the-task-logs-of-several-invocation-attempts
product: vercel
url: /docs/rest-api/vercel-ci/search-the-task-logs-of-several-invocation-attempts
canonical_url: "https://vercel.com/docs/rest-api/vercel-ci/search-the-task-logs-of-several-invocation-attempts"
last_updated: 2026-09-25
type: reference
prerequisites:
  []
related:
  - /docs/rest-api
summary: Learn about search-the-task-logs-of-several-invocation-attempts on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Search the task logs of several invocation attempts

```http
GET /v1/vercel-ci/log-search
```

Searches the task logs of up to 50 invocation attempts at once, for example the most recent runs of a branch from `GET /v2/vercel-ci/invocations`. Only invocations and tasks with matching lines are returned. When more than 1000 lines match, the newest are kept.

## Authentication

**bearerToken**: HTTP bearer

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `invocation` | array | Yes | Invocation attempts to search, as \"<invocationId>:<attempt>\" (at most 50). |
| `search` | string. maxLength: 256 | Yes | Only return log lines containing this text, ignoring case. |
| `level` | array | No | Only return log lines with one of these levels. |
| `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/log-search?invocation=[]&search=string&level=[]&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/log-search?invocation=[]&search=string&level=[]&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/log-search?invocation=[]&search=string&level=[]&teamId=string&slug=string' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'
```

## Example response

```json
{
  "invocations": [
    {
      "invocationId": "example_id",
      "attempt": "123",
      "tasks": [
        {
          "jobDefinitionId": "example_id",
          "jobName": "Example Name",
          "jobRunAttempt": "123",
          "taskDefinitionId": "example_id",
          "taskName": "Example Name",
          "taskRunAttempt": "123",
          "conclusion": {},
          "lines": [
            {}
          ]
        }
      ]
    }
  ],
  "hasMore": "true"
}
```

## Responses

### 200: Successfully searched task logs.

Content-Type: `application/json`

```json
{
  "type": "object",
  "required": [
    "invocations",
    "hasMore"
  ],
  "properties": {
    "invocations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "invocationId",
          "attempt",
          "tasks"
        ],
        "properties": {
          "invocationId": {
            "type": "string"
          },
          "attempt": {
            "type": "number"
          },
          "tasks": {
            "type": "array"
          }
        }
      }
    },
    "hasMore": {
      "type": "boolean",
      "description": "Whether more than 1000 lines matched. The newest lines are returned."
    }
  }
}
```

### 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"
        }
      }
    }
  }
}
```

### 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)
