> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getunbound.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Exports

> Export Logs, Tasks, Users and Tool Use data as CSV from the terminal

`unbound download` exports your organization's data as CSV — the same exports offered in the dashboard, from the terminal.

Requires **Admin** role. Run `unbound status` to check.

## What can be exported

```bash theme={null}
unbound download kinds
```

| Kind                     | What it holds                                                                         |
| ------------------------ | ------------------------------------------------------------------------------------- |
| `logs-export`            | Every LLM call: prompt, model, tokens, status, user and task ID                       |
| `logs-tasks-export`      | One row per task (agent session), with its thread ID                                  |
| `analytics-export`       | Tool Use rows — needs `dataset=terminal-runs\|mcp-actions\|unsanctioned\|mcp-servers` |
| `analytics-tasks-export` | Analytics → Tasks, optionally narrowed to one heatmap day                             |
| `users-export`           | Analytics → Users: per-user cost, tokens and activity                                 |

`unbound download kinds` also lists the filters each one accepts. It reads a list the CLI carries rather than asking the server, so a kind added to Unbound works before it appears here.

## Export something

```bash theme={null}
unbound download start logs-export --last 7d
unbound download start logs-export --last 24h --filter tool_types=CLAUDE_CODE -o today.csv
unbound download start logs-tasks-export --start 2026-07-01 --end 2026-07-31
unbound download start users-export --last 30d
unbound download start analytics-export --filter dataset=terminal-runs --last 7d
```

The command starts the export, waits for it, and saves the file. Without `-o` it writes a file named by the server in the current directory, and refuses to overwrite one that already exists.

## Time range

| Flag               | Range                                                                           |
| ------------------ | ------------------------------------------------------------------------------- |
| `--last <n>d\|h`   | Relative, e.g. `--last 7d`, `--last 24h`                                        |
| `--start`, `--end` | Absolute as `YYYY-MM-DD`, at most 90 days apart and no earlier than 90 days ago |

Omit both and the server applies its own default window.

## Filters

`--search <text>` matches free text, on the logs kinds only.

Repeat `--filter` with the same key to pass a list. Each value is sent separately, which is how the server reads list filters:

```bash theme={null}
unbound download start logs-export --last 7d \
  --filter tool_types=CLAUDE_CODE --filter tool_types=CURSOR
```

<Warning>
  An unknown filter **key** is silently ignored, so a typo widens the export rather than failing — `tool_type=CURSOR` returns every tool. An invalid **value** for a known key is rejected, with the accepted values listed. Run `--check` first and confirm the count moved.
</Warning>

## Check before you export

`--check` counts the rows without starting anything:

```bash theme={null}
unbound download start logs-export --check --last 7d
unbound download start logs-export --check --last 90d --json
```

```json theme={null}
{"row_count":18204,"limit":25000,"exceeds_limit":false,"exact":true}
```

An export of more than **25,000 rows** is refused up front, with the real count, so narrow the range or add filters rather than paging.

## If you stop waiting

A large export takes a few minutes. The job ID is printed when it starts:

```
ℹ Export 4f2a1c9e-1b2c-4d5e-8f90-a1b2c3d4e5f6 started.
⠸ Preparing export… 18,204 rows
```

Interrupting the wait does not cancel the export. Fetch the finished file within **6 hours**:

```bash theme={null}
unbound download get 4f2a1c9e-1b2c-4d5e-8f90-a1b2c3d4e5f6 -o logs.csv
```

`--no-wait` starts an export and returns the ID immediately, for a script that would rather collect it later:

```bash theme={null}
id=$(unbound download start logs-export --last 7d --no-wait --json | jq -r .id)
unbound download get "$id" -o logs.csv
```

Only **3 exports** may be preparing at once per organization. A fourth returns an error asking you to wait — do not poll by re-running the export.

## Output flags

| Flag                  | Behavior                                                         |
| --------------------- | ---------------------------------------------------------------- |
| `-o, --output <file>` | Write to this file instead of the server-chosen name             |
| `--check`             | Print how many rows would be exported, then exit                 |
| `--json`              | Machine-readable output — use with `--check`, or to get a job ID |
| `--no-wait`           | Start the export and print its job ID instead of waiting         |

## For scripts and agents

An export is prepared by a background worker, so it is three steps: start it, poll until it is ready, then download it. `unbound download start` does all three and blocks until the file is on disk.

Without `-o`, the destination depends on where output is going: a file named by the server when you are at a terminal, and stdout when it is piped or redirected. Diagnostics go to stderr either way, so the stream stays clean. The exit code is `0` on success and `1` on any error.

```bash theme={null}
unbound download start logs-export --last 24h | head -5
```

<Note>
  Requires CLI **1.15.0** or later. Tool Use data can also be exported with `unbound analytics tool-use <dataset> --format csv`, which uses this same flow — see [Analytics](/cli/analytics).
</Note>
