# API reference

Source: https://webagent-docs-staging.lookover.ai/api-reference

> The webagent HTTP API. Base URL, authentication, errors and every public endpoint by group.

The webagent API is a JSON REST API. Everything you can do in the dashboard goes through it, and so does the [MCP server](/mcp).
The pages in this section are generated from the API's own OpenAPI description, so they match the code.

## Base URL [#base-url]

```text
https://api.us.webagent.lookover.ai
```

The examples in these docs write the base URL as `<API_URL>`. Replace it with the host of your stack.

> **Warning: Public host not live yet**
>
> The public API host above is the planned address and is not live yet. Until it is, use the URL of the stack you were given,
> or `http://localhost:4400` against a local stack. Every path below is the same on any host.

## Authentication [#authentication]

Create an API key in the dashboard (it looks like `wa_us_` followed by 43 characters) and send it as a Bearer token:

```bash
curl <API_URL>/v1/sessions \
  -H "Authorization: Bearer wa_us_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

The `x-api-key` header carries the same key and works too. Keep keys on the server side; a key can do everything its
project can. Endpoints that list a session cookie are for the dashboard itself, you use a key.

## Requests and responses [#requests-and-responses]

- Bodies are JSON (`Content-Type: application/json`).
- Create calls accept an `Idempotency-Key` header. Send the same key and body again to get the first answer back instead
  of a second resource.
- Lists that page return `{ items, nextCursor? }`; pass `nextCursor` back as `cursor`.

## Errors [#errors]

Every error has the same body and an HTTP status:

```json
{ "error": { "code": "not_found", "message": "Human-readable text", "requestId": "..." } }
```

`code` is stable and meant for your code; `message` is for people. See [Errors](/reference/errors) for every code.

## Endpoints [#endpoints]

Pick a group in the sidebar. Each page lists the operations of one group, with parameters, request body, responses and
example code. Running a task inside a session is not an endpoint here: use the `run_task` tool of the [MCP server](/mcp).
