# List logs

> List what happened to your resources and what they printed, newest first.

> Nevia is in early access for selected teams. The CLI installs with `curl -fsSL https://get.nevia.cloud | sh`, and the MCP server is at https://api.nevia.cloud/mcp. A person signs in once in the browser.
> Setup, sign-in and requesting access: [SKILL.md](https://nevia.cloud/SKILL.md). When Nevia fits and when it doesn't: [why.md](https://nevia.cloud/why.md).

> For the complete documentation index, see [llms.txt](https://nevia.cloud/llms.txt). This page's HTML version: https://nevia.cloud/docs/reference/api/observability/listLogs

`GET https://api.nevia.cloud/v1/logs`

## Authorization

- `bearerAuth`: HTTP bearer in the Authorization header

Send the token in the `Authorization: Bearer <token>` header. See [Authenticate](https://nevia.cloud/docs/reference/api.md#authenticate).

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `workspace` | query | array<string> | no | Workspace ids or exact names. A deleted workspace is selected by its id only. When one is absent the answer covers every workspace the caller can see. |
| `resource` | query | array<string> | no | Computer or database ids, or their exact names together with `workspace`. |
| `project` | query | array<string> | no | Project ids. The answer covers the computers and databases in those projects, deleted ones included, and a member scoped to a project can read it. With `resource`, each resource must be in one of them. |
| `kind` | query | string | no | When present, the answer covers only resources of this kind. One of `computer` · `database`. |
| `from` | query | string (date-time) | no | Window start, RFC 3339, inclusive. Defaults to one hour before `to`. |
| `to` | query | string (date-time) | no | Window end, RFC 3339, exclusive. Defaults to now. |
| `type` | query | string | no | What kind of record it is. - `event`: Something that happened to the resource, written by Nevia. - `output`: Text the resource printed, on a `stream`. One of `event` · `output`. |
| `event` | query | array<LogEvent> | no | Only these events. Implies `type=event`. |
| `q` | query | string | no | Only records that contain this text, ignoring case, in what a record shows: its `body`, its `type`, its `event` or `stream`, or its resource's id or name. Length `1 <= length <= 200`. |
| `limit` | query | integer | no | Page size. Default `100`. Range `1 <= value <= 500`. |
| `cursor` | query | string | no | `next_cursor` from the previous page. The page walks that page's window, whatever `from` and `to` say. A cursor whose window starts more than an hour before the 7-day reach back is refused with `400 validation_failed`: start the read again. |

## Behavior

The scope is the one `GET /v1/usage` takes. Without `workspace`, it is every workspace you can see. With `project`, it is the resources in those projects, which a member scoped to a project can read. With `resource`, it is those resources. An `event` record is one thing that happened, written by Nevia, with a `reason` when one is known. `actor` and `operation` are not reported yet and are null. An `output` record is the line a resource printed, with its `stream`. `unreported.streams` in the answer lists the streams this deployment does not report. The window defaults to the hour before `to` and may span at most 7 days. A read reaches back at most 7 days: a `from` further back than that reads from 7 days ago, and `window` in the answer says so. Page older with `next_cursor`. `console_url` opens the same scope, window and filters in the console. Answers `503 not_supported` where logs are not deployed.

## Example request

### cURL

```bash
curl -X GET "https://api.nevia.cloud/v1/logs" \
  -H "Authorization: Bearer $TOKEN"
```

### JavaScript

```js
fetch("https://api.nevia.cloud/v1/logs", {
  method: "GET",
  headers: {
    "Authorization": `Bearer ${process.env.TOKEN}`
  }
})
```

### Python

```python
import os
import requests

url = "https://api.nevia.cloud/v1/logs"

response = requests.request("GET", url, headers = {
  "Authorization": f"Bearer {os.environ['TOKEN']}"
})

print(response.text)
```

## Responses

### 200

The records, newest first.

Content type: `application/json`

Schema: `LogList`

| Field | Type | Required | Description |
|---|---|---|---|
| `logs` | array<LogRecord> | yes | Newest first. |
| `next_cursor` | string \| null | yes | Cursor for the next, older page, sent as `cursor`. |
| `has_more` | boolean | yes |  |
| `window` | TimeWindow | yes | The period the answer covers, after defaults. |
| `unreported` | Unreported | yes | What this deployment does not report yet. Every list is empty where everything is reported. |
| `console_url` | string (uri) | yes | Opens the same scope, window and filters in the console. |

Example:

```json
{
  "logs": [
    {
      "id": "e3b0c44298fc1c14",
      "time": "2026-09-10T12:34:56Z",
      "type": "event",
      "event": "slept",
      "stream": "stdout",
      "severity": "info",
      "body": "Slept on request",
      "reason": "requested",
      "resource": {
        "id": "01d4cnjmn4fbb1r5btxb5mypv62",
        "kind": "computer",
        "name": "atlas-build",
        "workspace": "01d4cnjjq40hnnh0nwmkg35nv2h",
        "project": "01ck8y1dm5qqnf88mytnh4m0h4g"
      },
      "actor": "01d4cnjmn4fbb1r5btxb5mypv62",
      "operation": "01d4cnjm89yk0r3xtv80dy0x7by",
      "process": "string",
      "trace_id": "string",
      "attributes": {}
    }
  ],
  "next_cursor": "string",
  "has_more": true,
  "window": {
    "from": "2026-09-10T12:34:56Z",
    "to": "2026-09-10T12:34:56Z"
  },
  "unreported": {
    "metrics": [
      "memory"
    ],
    "used": [
      "memory"
    ],
    "events": [
      "slept"
    ],
    "streams": [
      "stdout"
    ],
    "destinations": true
  },
  "console_url": "https://nevia.aiven.io/computers/01d4cnjmn4fbb1r5btxb5mypv62/logs?ws=01d4cnjjq40hnnh0nwmkg35nv2h&from=2026-11-28T02%3A46%3A58.000Z&to=2026-11-28T03%3A46%3A58.000Z"
}
```

### 400

`validation_failed`: malformed body, unknown field, or invalid id or name. Fix `details.field` and retry.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `validation_failed`:

```json
{
  "error": {
    "code": "validation_failed",
    "message": "Unknown field `colour` in the request body. Remove it; request bodies are strict.",
    "details": {
      "field": "colour",
      "in": "body"
    }
  }
}
```

### 401

`unauthorized`: the credential is missing, malformed, expired, or revoked. Send a valid bearer token.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `unauthorized`:

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Missing credential. Send `Authorization: Bearer <token>` with an access token.",
    "details": {}
  }
}
```

### 404

`not_found`: absent, or outside the caller's access. Both cases return the same response. Check the id.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `not_found`:

```json
{
  "error": {
    "code": "not_found",
    "message": "Computer 01d4cnjk3xg90y576w8y6t4gdwm was not found. List the computers you can access with GET /v1/computers?workspace=<ws>.",
    "details": {
      "computer": "01d4cnjk3xg90y576w8y6t4gdwm"
    }
  }
}
```

### 429

`rate_limited`: slow down. Retry after `Retry-After`.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `rate_limited`:

```json
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests. Retry after 2 seconds.",
    "details": {
      "retry_after_seconds": 2
    }
  }
}
```

### 500

`request_failed`, or the failed action's own code, such as `creation_failed`, `authorization_failed` or `command_execution_failed`. The diagnostic stays in server logs.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `request_failed`:

```json
{
  "error": {
    "code": "request_failed",
    "message": "request failed",
    "details": {}
  }
}
```

### 503

The action is temporarily unavailable, named by its code (`creation_failed`, `wake_failed`, ...). Wait at least `Retry-After` seconds (60 by default). `details.retryable` says whether repeating the request is safe. Keep the original `Idempotency-Key`. Signing in again does not help.

Content type: `application/json`

Schema: `ErrorEnvelope`

Body of every error response

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | Error | yes |  |

Example `creation_failed`:

```json
{
  "error": {
    "code": "creation_failed",
    "message": "The computer could not be created. Try again later.",
    "details": {
      "retryable": true
    }
  }
}
```
