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

# API preview

> Explore the next Watchdog API for invoices, source documents, imports, and workflow runs.

<Warning>
  This API is under development. Its contract may change before release. These endpoints are
  separate from the current API at `api.watchdog.no`; continue using the [current API
  reference](/api-reference/introduction) for existing integrations.
</Warning>

The new API separates business documents from the work that produces them:

| Resource        | What it represents                                                                |
| --------------- | --------------------------------------------------------------------------------- |
| Agreement       | A draft, active or archived agreement with prices and shared source relationships |
| Invoice         | A published invoice or credit note, including financial values and parties        |
| Document        | An organization-owned source file                                                 |
| InvoiceImport   | Processing of source documents, with its current status and outcome               |
| WorkflowRun     | One submitted operation, with aggregate progress                                  |
| WorkflowRunItem | One unit of work within that operation, with its result or failure                |

Create an invoice directly from structured JSON, or upload a file and submit it for import. A
single import creates one workflow run with one item. Read the item to find its resulting invoice.
Processing failures and non-invoice files remain import outcomes; they do not create pending invoices.

## Try the development API

Use the API base URL provided for your development environment. For a local checkout, follow
`apps/api-worker/README.md` in the repository and start the Worker with:

```bash theme={null}
bun run dev:api:worker -- -p 3500
```

The examples and generated endpoint pages use `http://localhost:3500`. Replace that base URL with
your development deployment's URL when applicable. A documentation preview does not deploy the API
or start import processing; file imports also require the workflow service described in the setup.

Start with the [quickstart](/api-preview/quickstart) for copyable requests, then use
[API conventions](/api-preview/conventions), [invoice semantics](/api-preview/invoices), and
[workflow runs](/api-preview/workflow-runs) to interpret the responses.

## Reference and release status

Every endpoint page is generated from the same OpenAPI contract as the API client. Download the
[preview specification](/openapi-preview.json) for your own tooling. The endpoint schemas define
the exact inputs, outputs, permissions, and errors; the guides explain how to use them together.

The initial modules are invoices, Documents, imports, workflow runs, suppliers and recipients, and
organization teams. Existing accounting integrations and frontend workflows retain their current
backend paths until their separate migration. The current API reference remains available throughout
that transition.
