> ## 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.

# REST API (push invoices)

> Push invoices into equate from your own systems with one authenticated POST — no connector setup required.

The **REST API input** is built in: every workspace can push invoices to
`POST /api/v1/invoices`, authenticated with a workspace [API key](https://equatetravel.ai/docs/guides/api-keys.md).
A pushed document is ingested exactly like a manual upload or an email attachment — it
becomes a [job](https://equatetravel.ai/docs/guides/concepts.md#jobs) and flows through your
[pipelines](https://equatetravel.ai/docs/guides/pipelines.md) like everything else.

> [!NOTE]
>
> This is for feeding your **dashboard pipelines** programmatically. If you want
> synchronous, structured extract-and-match results returned to your code, use the
> [agent API](https://equatetravel.ai/docs/api-reference/introduction.md) instead — see
> [agents vs pipelines](https://equatetravel.ai/docs/platform/agent-vs-workflow.md) for choosing between them.

## Push an invoice

Supply the file as a base64 string or a URL equate can fetch:

```bash theme={null}
curl -X POST https://equatetravel.ai/api/v1/invoices \
  -H "Authorization: Bearer ip_live_xxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "fileUrl": "https://example.com/invoices/OC-44821.pdf",
    "fileName": "OC-44821.pdf",
    "reference": "order-9921"
  }'
```

| Field | Required | Notes |
| - | - | - |
| `fileBase64` | One of the two | The file bytes, base64-encoded (≈10.5 MB decoded max). Pair with `fileType`. |
| `fileUrl` | One of the two | A public http(s) URL equate fetches server-side. |
| `fileType` | Optional | MIME type — PDF, plain text, CSV or Excel. |
| `fileName` | Optional | Shown in the queue; generated when omitted. |
| `reference` | Optional | Your correlation id, echoed back in the response. |
| `sourceId` | Optional | Target a specific source; defaults to the workspace's built-in **REST API** source. |

A successful push returns `202 Accepted` with the created job:

```json theme={null}
{
  "data": {
    "jobId": "5f0c…",
    "sourceFileId": "9a1d…",
    "processed": true,
    "pipelineId": "c44a…",
    "reference": "order-9921"
  }
}
```

`processed` tells you whether a pipeline picked the document up immediately
(**as-they-arrive** handling) or it's waiting for a scheduled or manual run —
see [pipeline handling](https://equatetravel.ai/docs/guides/pipelines.md).

## Wiring it into a pipeline

In the pipeline builder, choose **REST API** as the input. Anything you push lands on
that pipeline's queue and is matched, reviewed and delivered per its configuration. Use
`sourceId` only when you run several API-fed pipelines and need to address one
specifically.

## Errors to handle

| Status | Code | Meaning |
| - | - | - |
| `401` | `UNAUTHORIZED` | Missing, malformed or revoked API key. |
| `403` | `FEATURE_NOT_AVAILABLE` | The workspace's plan doesn't include API access (Professional and above). |
| `400` | `VALIDATION_ERROR` / `FETCH_FAILED` | Bad body, or `fileUrl` couldn't be fetched. |
| `413` | `PAYLOAD_TOO_LARGE` | File exceeds the size limit. |
| `415` | `UNSUPPORTED_MEDIA_TYPE` | Not PDF, text, CSV or Excel. |
| `502` | `INGEST_FAILED` | Ingestion failed — often a plan document limit. |

The full request/response schema lives in the
[API reference](https://equatetravel.ai/docs/api-reference/invoices/push.md).

> [card] [Next: create an API key](https://equatetravel.ai/docs/guides/api-keys.md)
>
> Workspace admins create keys under Settings → API keys; the secret is shown once.


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