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

# v2 API beta

> Run Origami's agent from your own code: send a brief, get back a table.

> [!NOTE]
>
> v2 is **deprecated for new integrations**. It stays fully functional, with no
> removal date. New work should target the [v3 API](https://docs.origami.chat/v3/overview.md). See the
> [v2 → v3 migration guide](https://docs.origami.chat/api-v2-to-v3-migration.md).

The v2 API runs Origami's agent from your code. You send it a brief in plain English,
it does the research and builds a table, and you read the result back.

The core loop uses three objects:

* **[Agent](https://docs.origami.chat/agents/reference/create-agent.md)** — a worker in your org. Create one and reuse it.
* **[Run](https://docs.origami.chat/agents/reference/send-run.md)** — one brief and the work that follows. An agent does one run at a time.
* **[Table](https://docs.origami.chat/agents/reference/get-table.md)** — what the agent builds. Read its rows with [`GET /api/v2/tables/{tableId}/rows`](https://docs.origami.chat/agents/reference/list-rows).

The wider API adds workspaces, documents, enrichment runs, campaigns, sequences,
scheduled agents, and projects. See [objects and relationships](https://docs.origami.chat/agents/objects.md)
for the whole map and how everything connects.

## How runs work

Every run is **asynchronous**. `POST /api/v2/agents` and `POST /api/v2/agents/{id}/runs`
respond `202 Accepted` with the run already `running` — the agent works in the background.
You poll [`GET /api/v2/agents/{id}/runs/{runId}`](https://docs.origami.chat/agents/reference/get-run) until `status`
is no longer `running`, honoring the `Retry-After` header (15 seconds) while it runs. Runs
typically take 1–5 minutes. See the [run object](https://docs.origami.chat/agents/run-object.md) for the full response
shape.

Pick a model per run with the `model` field — `origami-lite` or `origami-max`. The default
is the highest model your plan unlocks (`origami-lite` on starter, `origami-max` on pro and
above).

## Start here

> [card] [Quickstart](https://docs.origami.chat/agents/quickstart.md)
>
> Start an agent, follow up, poll, and fetch the data — end to end.

> [card] [Create an agent](https://docs.origami.chat/agents/reference/create-agent.md)
>
> The first call, and every field it takes.

> [card] [Run object](https://docs.origami.chat/agents/run-object.md)
>
> Status, actions, tables, and the optional stats and transcript.

> [card] [Read rows back](https://docs.origami.chat/agents/reference/list-rows.md)
>
> Pull the rows the agent built, with typed cells, filters, and CSV.

Want the AI to do the work? Use v2. Already have the data and just need to read it back?
Use [`GET /api/v2/tables/{tableId}/rows`](https://docs.origami.chat/agents/reference/list-rows).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.