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

# API reference

> The public equate agent API: base URL, conventions and response envelopes.

The public equate API lets you call a **published agent** from your own systems, and
**push invoices** into your workspace's pipelines. An agent reads a document, says what it
is, matches it to a booking under your business rules, answers in the same request and
then sets off your actions. It is a small, focused surface: run an agent over a single
document or a batch of up to 100, or push a document in for pipeline processing.

> [!NOTE]
>
> The dashboard is backed by a larger set of internal, session-authenticated endpoints
> (jobs, sources, suppliers, pipelines, …). Those are not part of the public API and
> are documented as workflows under [Guides](https://equatetravel.ai/docs/guides/concepts.md), not here.

## Base URL

```
https://equatetravel.ai
```

If your workspace uses a custom domain, swap it in. All public endpoints live under
`/api/v1/`.

## Authentication

Every request needs a workspace API key in the `Authorization` header:

```
Authorization: Bearer ip_live_…
```

See [Authentication](https://equatetravel.ai/docs/api-reference/authentication.md) for creating, scoping and rotating keys.

## Conventions

* **JSON only.** Send `Content-Type: application/json`; responses are JSON.
* **Success envelope.** Successful responses wrap the payload in a top-level `data` object.
* **Error envelope.** Failures return `{ "error": { "code", "message", "details?" } }`.
  See [Errors](https://equatetravel.ai/docs/api-reference/errors.md).
* **Workspace-scoped.** A key resolves to exactly one workspace; agents are addressed by
  their `slug` within that workspace.
* **Correlation.** Pass a `reference` on any request (or batch item) and it's echoed back
  unchanged in the result.
* **A run that finds no booking is still a success.** An agent call answers `200` whenever
  the document could be read. Read `result.outcome` for how it ended. See
  [outcomes](https://equatetravel.ai/docs/guides/agents.md#outcomes).

## Endpoints

> [card] [Run an agent](https://equatetravel.ai/docs/api-reference/agents/run.md)
>
> `POST /api/v1/agents/{slug}/run`. One document in, the result out.

> [card] [Run a batch](https://equatetravel.ai/docs/api-reference/agents/batch.md)
>
> `POST /api/v1/agents/{slug}/batch`. Up to 100 documents, each processed on its own.

> [card] [Push an invoice](https://equatetravel.ai/docs/api-reference/invoices/push.md)
>
> `POST /api/v1/invoices`. Sends a document into your pipelines and returns the job id.

> [card] [Get an invoice's documents](https://equatetravel.ai/docs/api-reference/invoices/documents.md)
>
> `GET /api/v1/invoices/{id}/documents`. Every document of an invoice, with fresh links.
> Add `/{documentId}` for [one document](https://equatetravel.ai/docs/api-reference/invoices/document.md).

> [!NOTE]
>
> Not sure whether to call an agent or push into a pipeline? See
> [agent mode vs workflow mode](https://equatetravel.ai/docs/platform/agent-vs-workflow.md).

## Supplying the document

Both agent endpoints accept the document three ways. Provide exactly one per item:

| Field | Use when |
| - | - |
| `content` | You already have the document as text (max 200,000 chars). |
| `fileUrl` | The file lives at a public http(s) URL equate can fetch. |
| `fileBase64` | You want to send the bytes inline (PDF/CSV/text, \~10.5 MB decoded max). Pair with `fileType`. |

Optional on every request: `reference` (your id) and `fileName`.

A PDF with a text layer is read from its text, with the supplier also identified from its
logos. A scanned PDF is sent to the model as the file. A password-protected PDF is refused
with a `400`.

> [!NOTE]
>
> `modelTier` (`smart` or `fast`) chooses between equate's built-in model presets. An agent
> stores no tier of its own, so leaving it out means `smart`. It only applies while no
> extraction models have been set up for the platform. Once they have, they always run and
> `modelTier` is ignored.

## What comes back

The `result` of every run carries:

| Field | What it is |
| - | - |
| `document` | What the document is: `type` (`invoice`, a document type's name, or `other`) and `isInvoice`. |
| `outcome` | How the run ended: `AUTO_MATCHED`, `NEEDS_REVIEW`, `NO_MATCH`, `EXTRACTED`, `OUT_OF_SCOPE` or `NOT_HANDLED`. |
| `actions` | The agent's actions the outcome set off, each with a `status` of `QUEUED` or `SKIPPED_TEST_MODE`. They run after the response is sent. |
| `data` | The extracted fields, when the agent returns them. |
| `match` | The match, when the agent has booking data and returns it. |

See [building agents](https://equatetravel.ai/docs/guides/agents.md) for what each outcome means and which actions it
sets off.

> [!NOTE]
>
> `fileUrl` must resolve to the file itself, without sign-in. Cloud-storage
> *share* links usually open an interactive viewer instead. equate converts
> well-known ones (SharePoint/OneDrive, Google Drive, Dropbox) to their
> direct-download form automatically, but links restricted to specific people
> or an organisation still require sign-in and will be rejected with a `403`
> explanation. When in doubt, send `fileBase64`: encode the raw file bytes as
> standard base64 (a `data:` URI prefix is tolerated; URL-encoding is not).


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