# Turn invoices into rows > Drop in a file. Get its values. No typing. Page: https://doxtract.manoonlabs.com/docs [Video: Pick the Invoice template, create the inbox, drop in three invoices, then open one to see every value filled in.](https://doxtract.manoonlabs.com/docs/start.mp4) ## Step by step ### 1. Open Inboxes and click Create manually ![The Inboxes page with an arrow to the Create manually button.](https://doxtract.manoonlabs.com/docs/start-create.webp) ### 2. Pick Invoice, then create the inbox ![The Create an inbox form. 1: the template list, set to Invoice. 2: the Create inbox button.](https://doxtract.manoonlabs.com/docs/start-template.webp) ### 3. Drop in your invoices PDF, PNG or JPEG. Phone photos are fine. ![The Import page with an arrow to the area where you drop files.](https://doxtract.manoonlabs.com/docs/start-drop.webp) ### 4. Wait for Parsed, then open one ![The Documents list. 1: the file name, which you click to open. 2: the green Parsed label, which means it is ready.](https://doxtract.manoonlabs.com/docs/start-open.webp) ## Next - [Send by email](https://doxtract.manoonlabs.com/docs/email): Forward invoices instead of uploading. - [Check the values](https://doxtract.manoonlabs.com/docs/review): See where each value came from. - [Get your spreadsheet](https://doxtract.manoonlabs.com/docs/export): Excel, Google Sheets or Xero. - [Xero guide](https://doxtract.manoonlabs.com/docs/xero): Send draft bills and invoices to Xero. - [QuickBooks guide](https://doxtract.manoonlabs.com/docs/quickbooks): Send bills, expenses and invoices to QuickBooks Online. - [Google Sheets guide](https://doxtract.manoonlabs.com/docs/google-sheets): Send rows to a sheet you pick. --- # Forward invoices by email > Every inbox has its own email address. Forward a bill to it and it is read for you. Page: https://doxtract.manoonlabs.com/docs/email ![A supplier emails a bill, you forward it, Doxtract reads it, and you get rows.](https://doxtract.manoonlabs.com/docs/email-flow.webp) ## Forward one email ### 1. Copy your inbox address Open your inbox, then **Import**. Find the **Email** card. ![The Email card on the Import page. 1: the button that copies the address. 2: the Receive mails switch, which must stay on.](https://doxtract.manoonlabs.com/docs/email-address.webp) ### 2. Forward the bill to it ![An email being forwarded. 1: paste the inbox address in To. 2: keep the invoice file attached. 3: Send.](https://doxtract.manoonlabs.com/docs/email-forward.webp) ### 3. Open Documents. It is there ![The Documents list with the emailed invoice on the first row.](https://doxtract.manoonlabs.com/docs/email-arrived.webp) > Emailing needs a free account. Trying Doxtract without signing in? [Sign up](https://doxtract.manoonlabs.com/sign-up) first. ## Easiest: let suppliers send it Give suppliers your inbox address for their invoices. Then you do nothing. ## Photos from your phone ![Two emails. A photo attached as a file works. A photo pasted inside the email text is skipped.](https://doxtract.manoonlabs.com/docs/email-photo.webp) Attach the photo as a file. Photos inside the email text are skipped. ## Outlook: forward automatically ![A mail rule. 1: when mail is from your supplier. 2: forward it to your inbox address. 3: Save.](https://doxtract.manoonlabs.com/docs/email-rule.webp) In Outlook on the web: **Settings → Mail → Rules → Add new rule**. Then send yourself one test bill. > Work account and nothing arrives? Microsoft 365 can [block forwarding outside your company](https://learn.microsoft.com/en-us/defender-office-365/outbound-spam-policies-external-email-forwarding). Ask your admin to allow it. ## Gmail Gmail asks to confirm the inbox address once before it forwards. When the Gmail address is one you already trust, we confirm it for you. The Gmail guide shows every click, with a narrated video. - [Forward from Gmail](https://doxtract.manoonlabs.com/docs/gmail): Every step, with a narrated video. ## Who can send to the inbox Anyone who has the inbox address can send it documents, so keep the address private. To accept only senders you trust, open the inbox's **Email** card and turn on **Only accept mail from trusted senders**. - With it on, mail with files from a sender you have not trusted is held, not read. Find it under **Held mail** and choose **Approve & trust**. Later mail from that sender is read without asking. - Your workspace members are trusted from the start. Add or remove senders under **Trusted senders**, where you can also trust a whole company domain. - Approving a Gmail forwarding request trusts that Gmail account. Mail it forwards automatically comes straight in, even from suppliers you have not approved. - Held mail is kept for 30 days. Nothing is charged until you approve it. - Mail whose sender cannot be verified is held even from a trusted sender. Approving it imports that one email and trusts nobody. ## Example: a cafe ![Coffee, milk and bakery invoices all go to one Invoices inbox and come out as one sheet.](https://doxtract.manoonlabs.com/docs/example-cafe.webp) ## Example: a bookkeeper ![A bookkeeper with one inbox per client and document type, each with its own email address.](https://doxtract.manoonlabs.com/docs/example-bookkeeper.webp) One inbox per client and kind of document. Put the client's name in the inbox name. - [Nothing arrived?](https://doxtract.manoonlabs.com/docs/problems): Quick fixes. --- # Forward bills from Gmail > Gmail asks to confirm the inbox address once. Here is every click, with a narrated video. Page: https://doxtract.manoonlabs.com/docs/gmail [Video with narration: A narrated walkthrough. In Doxtract, copy the inbox address. In Gmail, click the gear, See all settings, Forwarding and POP/IMAP, Add a forwarding address, paste the address, Next, then Proceed. Back in Doxtract, a Gmail address you already trust shows as Confirmed automatically. Any other Gmail address waits for Approve, which opens Google's page where you click Confirm, and the request then shows as Approved. In Gmail, reload, search for your bills, Create filter, and forward them to the inbox address. The next bill arrives in Documents.](https://doxtract.manoonlabs.com/docs/gmail-guide.mp4) ([captions](https://doxtract.manoonlabs.com/docs/gmail-guide.vtt)) ## Add the inbox address in Gmail Copy the address from the inbox's **Email** page. Then [open Gmail](https://mail.google.com/mail/u/0/#inbox) and click the gear, then **See all settings → Forwarding and POP/IMAP → Add a forwarding address**. - Enter the inbox address, then **Next** and **Proceed**. - Gmail sends a confirmation to the inbox address. You do not need to find it. > No **Add a forwarding address** button? Gmail leaves it out when its settings page is opened from a link or reloaded. Go back to your Gmail inbox and open the settings with the gear. Typing the inbox address in the box after **Forward a copy of incoming mail to** does not add it: Gmail refuses it as an invalid forwarding address. ## Confirm the request - Is it the Gmail address you signed in with, a teammate's, or one on the inbox's **Trusted senders**? We confirm it with Gmail for you within a few minutes. On the inbox's **Import** page, open the **Email** card: under **Gmail forwarding requests** it shows as **Confirmed automatically**. - Any other Gmail address waits for you there. Click Approve. Gmail's confirmation page opens in a new tab. Confirm there. If you closed the tab, click **Approve again**. > We only keep a confirmation that really comes from Google. We confirm it for you only when the Gmail address is one you already trust; a request from anyone else always waits for you, so a stranger cannot forward a mailbox into your inbox. If you did not ask for it, reject it with the trash icon. Once Gmail forwards your mail, you can remove the request with its trash icon. ## Choose which mail to forward - Reload Gmail, so it knows the inbox address is confirmed. - Search for your bills, for example by sender or by a word in the subject, then click **Create filter**. - Tick **Forward it to**, pick the inbox address, and click **Create filter**. - To forward everything instead, go back to **Forwarding and POP/IMAP** and choose **Forward a copy of incoming mail to** with the inbox address. > A Gmail filter can only forward to an address Gmail has confirmed. If the inbox address is missing from the filter's **Forward it to** list, add it first and wait until it shows as confirmed or approved here. Just confirmed? Reload Gmail, then make the filter. - [Who can send to the inbox](https://doxtract.manoonlabs.com/docs/email#senders): Trusted senders and held mail. - [Nothing arrived?](https://doxtract.manoonlabs.com/docs/problems): Quick fixes. --- # Check and fix values > Your document on one side, what we read on the other. Page: https://doxtract.manoonlabs.com/docs/review [Video: Click a value to see where it came from on the page, type over a wrong value, and save.](https://doxtract.manoonlabs.com/docs/review.mp4) ## Step by step ### 1. Open a document ![The review page. 1: your document on the left. 2: the values we read on the right.](https://doxtract.manoonlabs.com/docs/review-overview.webp) ### 2. Click a value to find it on the page ![1: the invoice number is clicked. 2: its place on the invoice lights up.](https://doxtract.manoonlabs.com/docs/review-find.webp) ### 3. Wrong? Type over it and save ![1: a new value typed over the invoice number. 2: the Save button.](https://doxtract.manoonlabs.com/docs/review-save.webp) --- # Choose what gets read > Fields are the values you want from each document, like the date or the total. Page: https://doxtract.manoonlabs.com/docs/fields ### 1. Open Fields in your inbox ![The Fields page. 1: the pencil that changes a field. 2: Add field. 3: Edit with AI.](https://doxtract.manoonlabs.com/docs/fields-overview.webp) ### 2. Or tell AI what you want ![The Edit with AI box with the request: Add a field for the delivery date.](https://doxtract.manoonlabs.com/docs/fields-ai.webp) > New documents use the new fields. To update an old one, open it and click **Re-run extraction**. --- # Get your spreadsheet > Download Excel, or send it to Google Sheets or Xero. Page: https://doxtract.manoonlabs.com/docs/export ![A spreadsheet with one row per invoice: vendor, invoice number, date and total.](https://doxtract.manoonlabs.com/docs/export-sheet.webp) ## Download a file ### 1. Open Export and click Download ![The Export page. 1: tick the invoices. 2: pick Excel. 3: the Download button.](https://doxtract.manoonlabs.com/docs/export-download.webp) ## Send it automatically ### 1. Open Connections and click Connect Google Sheets gets a row for each document. Xero gets a draft for you to check. ![The Connections tab. 1: Connect for Xero. 2: Connect for Google Sheets.](https://doxtract.manoonlabs.com/docs/export-connect.webp) --- # Send documents to Xero > Doxtract creates draft bills, invoices, receipts and credit notes in Xero. You approve them in Xero as usual. Page: https://doxtract.manoonlabs.com/docs/xero ### 1. Open Export, then Connections Click Connect next to Xero and sign in. One Xero organisation per workspace. ![The Connections tab. 1: Connect for Xero. 2: Connect for Google Sheets.](https://doxtract.manoonlabs.com/docs/export-connect.webp) ### 2. Send your documents Doxtract creates a draft bill, invoice, receipt or credit note in Xero, with the original file attached. ### 3. Approve in Xero Check each draft in Xero and approve it there, as you do today. ## Drafts only > Doxtract never approves anything. Every document stays a draft until you approve it in Xero. ## Sending a document again - Sending it again updates its existing draft. You do not get a second one. - A draft you already approved in Xero is left alone. - If the draft was deleted or voided in Xero, sending it again creates it again. ## Who can use it Guests can't use the Xero integration. --- # Send documents to QuickBooks > Doxtract creates bills, expenses, supplier credits, invoices and customer credits in QuickBooks Online, with the original file attached. Page: https://doxtract.manoonlabs.com/docs/quickbooks > QuickBooks is being rolled out. If Connections shows it as Coming soon, it is not open for your workspace yet. ### 1. The workspace owner connects QuickBooks Open Export, then Connections, and click Connect next to QuickBooks. One QuickBooks company per workspace. ![The Connections tab with QuickBooks connected, showing the company name and how many documents were exported.](https://doxtract.manoonlabs.com/docs/quickbooks-connect.webp) ### 2. Check the setup Doxtract fills in what your documents become, the accounts and the tax. Change anything on the QuickBooks page, or describe the change and let the AI make it. ![The QuickBooks page: send as supplier invoice, the default account, the tax code and no-tax code, and the switches to attach the file and send automatically.](https://doxtract.manoonlabs.com/docs/quickbooks-settings.webp) ### 3. Send your documents Each document becomes a bill, expense, supplier credit, invoice or customer credit in QuickBooks, with the original file attached. ![The documents table with an exported invoice and its Open in QuickBooks link.](https://doxtract.manoonlabs.com/docs/quickbooks-documents.webp) ## No drafts in QuickBooks > QuickBooks has no drafts. A document you send is a real bill or invoice straight away, which you can still edit or delete in QuickBooks. Turn off Send automatically to send only when you press Export. ## Sending a document again - Sending it again updates the same transaction. You do not get a second one. - A transaction that is paid or partly paid in QuickBooks is left alone. - If it was deleted in QuickBooks, pressing Export creates it again. - An automatic send never brings back something deleted in QuickBooks, so a duplicate you removed stays removed. The document says so. ## Tax - The total in QuickBooks matches the document. If QuickBooks works out a different total, the document says so. - For US companies the tax goes into the line amounts. On invoices you can pick a sales tax code to record it as sales tax instead. - For UK companies each line gets the VAT code that matches its rate. Pick the usual VAT code and the no-VAT code on the QuickBooks page. - Only US and UK companies are supported for now. ## Who can use it Guests can't use QuickBooks. --- # Send documents to Google Sheets > Doxtract adds your documents to a Google Sheet, one row per document or one row per line item. Page: https://doxtract.manoonlabs.com/docs/google-sheets ### 1. The workspace owner connects Google Open Export, then Connections, and click Connect next to Google Sheets. ![The Connections tab. 1: Connect for Xero. 2: Connect for Google Sheets.](https://doxtract.manoonlabs.com/docs/export-connect.webp) ### 2. Pick a sheet Create a new sheet, or pick an existing sheet and tab. ### 3. Choose your rows Pick one row per document, or one row per line item. ### 4. Send your documents Each row has a Document ID that links back to the document in Doxtract. ## Sending a document again - Sending it again updates those same rows. - Only mapped cells are written, so columns you added yourself are left alone. ## Who can use it Guests can't use Google Sheets. --- # Something wrong? > Find your problem. Try the fix. Page: https://doxtract.manoonlabs.com/docs/problems ### My emailed invoice did not arrive Check the address, and that **Receive mails** is on. Sign up if you are using Doxtract without an account. ### The email arrived but a file is missing Send a **PDF, PNG or JPEG** as an attachment. Pictures inside the text are skipped. If you forwarded the email as an attachment, forward it the normal way instead. ### My file is too big The free plan takes files up to 10 MB and 10 pages. [See plans](https://doxtract.manoonlabs.com/pricing) for larger files. ### A value is wrong Type over it and save. [See how](https://doxtract.manoonlabs.com/docs/review). ### A value is missing Add a field for it. [See how](https://doxtract.manoonlabs.com/docs/fields). ### Still stuck Email [support@manoonlabs.com](mailto:support@manoonlabs.com). --- # Quick start > Send a document to the API and get JSON back. Page: https://doxtract.manoonlabs.com/docs/api - Create a key on [API Keys](https://doxtract.manoonlabs.com/settings/developer). The secret is shown once. - Replace `mldxt_...` in the sample with it and send a document. - Read `values` in the response. One page costs 1 credit ([pricing](https://doxtract.manoonlabs.com/pricing)). **cURL** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -F file=@invoice.pdf \ -F schema=invoice ``` **SDK** ```ts // npm install @manoonlabs/doxtract import { Doxtract } from "@manoonlabs/doxtract"; const doxtract = new Doxtract({ apiKey: process.env.DOXTRACT_API_KEY }); const { values } = await doxtract.parse("invoice.pdf", { schema: "invoice", }); console.log(values.total); // 1280.5 ``` **Python** ```python import base64, os, requests with open("invoice.pdf", "rb") as f: file_base64 = base64.b64encode(f.read()).decode() res = requests.post( "https://doxtract.manoonlabs.com/api/v1/parse", headers={"Authorization": f"Bearer {os.environ['DOXTRACT_KEY']}"}, json={"file_base64": file_base64, "schema": "invoice"}, ) print(res.json()["values"]["total"]) # 1280.5 ``` **Cursor** ```json { "mcpServers": { "doxtract": { "url": "https://doxtract.manoonlabs.com/mcp", "headers": { "Authorization": "Bearer mldxt_..." } } } } ``` **Claude Code** ```bash claude mcp add --transport http doxtract https://doxtract.manoonlabs.com/mcp \ --header "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "credits_used": 1, "credits_remaining": 59, "values": { "vendor": "Northwind Supply", "invoiceNumber": "INV-1042", "issued": "2026-10-25", "total": 1280.5, "currency": "USD", "lineItems": [ { "description": "Cable", "amount": 1280.5 } ] } } ``` ## Reference - [Parsing](https://doxtract.manoonlabs.com/docs/api/parsing): POST /api/v1/parse, jobs, every field and response. - [Inboxes](https://doxtract.manoonlabs.com/docs/api/inboxes): Inboxes, documents, exports, email and webhooks. - [TypeScript SDK](https://doxtract.manoonlabs.com/docs/api/sdk): Typed results and errors for Node, Bun and Deno. - [MCP server](https://doxtract.manoonlabs.com/docs/mcp): Connect Cursor, Claude Code or any MCP client. --- # Authentication > One API key for REST and MCP. Page: https://doxtract.manoonlabs.com/docs/api/authentication Create a key on [API Keys](https://doxtract.manoonlabs.com/settings/developer). The full secret is shown once; later the console shows its prefix. Send it on every call as `Authorization: Bearer ` or `x-api-key: `. **Header** ```text Authorization: Bearer mldxt_... ``` The key acts as the workspace it belongs to. Authenticated calls are listed in [Plan](https://doxtract.manoonlabs.com/plan) for the period, and each call updates the key's last used time. ## Base URL and bodies - Base URL: `https://doxtract.manoonlabs.com` - POST and PATCH bodies are JSON objects with `Content-Type: application/json`. DELETE takes no body. - `POST /api/v1/parse` and `POST /api/v1/upload/{inbox_id}` also take `multipart/form-data`, so curl can upload with -F. - An unknown key returns 400 `Unexpected key`, a missing one 400 `Missing key`, and invalid JSON 400 `Request body must be JSON`. - GET and DELETE routes read their input from the path and the query string. - Keys are created and revoked in the console. Schemas are deleted there too. Inboxes and documents can be deleted with the API. ## Check your key ### Identity `GET /api/v1/whoami` Return the workspace and token for this bearer key, and the credits left this month. - There is no request body. - credits_remaining is the credits left this month. It does not change the balance. - Use this to confirm a key before you parse. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/whoami \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "workspaceId": "cm7workspace", "tokenId": "cm7token", "credits_remaining": 59 } ``` --- # TypeScript SDK > The official SDK wraps the REST calls with typed results and errors. Page: https://doxtract.manoonlabs.com/docs/api/sdk Works in Node, Bun and Deno. `zod` is a peer dependency, only needed for Zod schemas. [SDK on GitHub](https://github.com/manoonlabs/doxtract-js) · [npm](https://www.npmjs.com/package/@manoonlabs/doxtract) ## Install **Install** ```bash npm install @manoonlabs/doxtract ``` ## Examples **Parse (no schema)** ```ts import { Doxtract } from "@manoonlabs/doxtract"; const doxtract = new Doxtract({ apiKey: "mldxt_..." }); const { values } = await doxtract.parse("invoice.pdf"); // The model picks the keys. Pass schema to choose them yourself (same JSON field name as REST). console.log(values); ``` **Parse (Zod)** ```ts import { Doxtract } from "@manoonlabs/doxtract"; import { z } from "zod"; const doxtract = new Doxtract({ apiKey: "mldxt_..." }); const Invoice = z.object({ vendor: z.string().nullable(), invoiceNumber: z.string().nullable(), total: z.number().nullable(), lineItems: z.array( z.object({ description: z.string(), amount: z.number() }), ), }); const { values, citations } = await doxtract.parse("invoice.pdf", { schema: Invoice, citations: true, }); values.total; // number | null citations?.["total"]; // where the total was read on the page ``` **Parse (plain schema)** ```ts import { Doxtract } from "@manoonlabs/doxtract"; const doxtract = new Doxtract(); // reads DOXTRACT_API_KEY const { values } = await doxtract.parse<{ vendor: string | null; total: number | null; }>("invoice.pdf", { schema: { type: "object", properties: { vendor: { type: "string" }, total: { type: "number" } }, }, }); ``` **Text and export** ```ts import { writeFile } from "node:fs/promises"; import { Doxtract } from "@manoonlabs/doxtract"; const doxtract = new Doxtract(); // Plain text instead of a file, and the spreadsheet next to the JSON. const result = await doxtract.parse( { text: "Invoice INV-1042 from Northwind Supply. Total 1280.50 USD." }, { schema: "invoice", export: "xlsx" }, ); if (result.export) { await writeFile(result.export.filename, result.export.data); } ``` **Schemas (schemas API)** ```ts import { Doxtract } from "@manoonlabs/doxtract"; const doxtract = new Doxtract(); const schemas = await doxtract.schemas.list(); await doxtract.schemas.create({ name: "Invoice", schema: { type: "object", properties: { total: { type: "number" } }, }, }); await doxtract.schemas.get("invoice"); await doxtract.schemas.update("invoice", { name: "Invoice v2", schema: { type: "object", properties: { total: { type: "number" }, paid: { type: "boolean" } }, }, }); ``` **Key and errors** ```ts import { Doxtract, DoxtractError, InsufficientCreditsError, RateLimitError, } from "@manoonlabs/doxtract"; const doxtract = new Doxtract(); const { credits_remaining } = await doxtract.whoami(); try { await doxtract.parse("invoice.pdf", { schema: "invoice" }); } catch (error) { if (error instanceof RateLimitError) console.error(`Retry in ${error.retryAfter}s`); else if (error instanceof InsufficientCreditsError) console.error(error.upgrade); else if (error instanceof DoxtractError) console.error(error.code, error.message); else throw error; } ``` --- # Parsing > Send a PDF, image or text and get JSON that matches your schema. Page: https://doxtract.manoonlabs.com/docs/api/parsing | Method | Path | What it does | | --- | --- | --- | | `POST` | `/api/v1/parse` | [Parse a document](#parse_document) | | `GET` | `/api/v1/parse/jobs/{job_id}` | [Get parse job](#get_parse_job) | | `GET` | `/api/v1/parse/jobs` | [List parse jobs](#list_parse_jobs) | | `GET` | `/api/v1/parse/webhook-secret` | [Read the parse webhook secret](#get_parse_webhook_secret) | | `POST` | `/api/v1/parse/webhook-secret` | [Rotate the parse webhook secret](#rotate_parse_webhook_secret) | ### Parse a document `POST /api/v1/parse` Extract keys from a PDF, PNG, JPEG, or text document. Upload the file as multipart/form-data, send it as base64 in a JSON body, or send plain text in the text parameter. Add export to also get the result as an Excel or CSV file, or citations to get the page and box each value was read from. The bytes are discarded after the request. **Request body (multipart/form-data or JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `file / file_base64 / text` | file \| string | Yes, exactly one | The document. Send exactly one of these three. PDF, PNG, JPEG, and UTF-8 text files (.txt, .md, .csv, .eml) work. Free workspaces allow 10 MB per document; Starter and Pro allow 25 MB; Business allows 100 MB. `file`: The raw document as a multipart upload, for example -F file=@invoice.pdf. `file_base64`: The same file as a standard base64 string in a JSON body. `text`: Plain text of the document, such as an invoice email, in a JSON body or as a multipart field (-F "text= with it to get one signed parse.job.finished POST when the job ends (see Webhook events on the Inboxes page). X-Webhook-Url without Prefer: respond-async returns 400, and from a key not made by the workspace owner 403. A retry with the same X-Job-Id and the same request returns that same 202 (no second charge). A failure before any charge releases the key so a later retry can run. A failure after the charge keeps the key: the same key returns that failed job for about 24 hours, so use a new UUID to try again. **Upload** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -F file=@invoice.pdf \ -F schema=invoice ``` **JSON body (base64)** ```bash jq -n --rawfile doc <(base64 < invoice.pdf | tr -d '\n') \ '{file_base64: $doc, filename: "invoice.pdf", schema: "invoice"}' \ | curl -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d @- ``` **Text** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{"text": "Invoice INV-1042 from Northwind Supply, issued 2026-10-25. Cable: 1280.50 USD.", "schema": "invoice"}' ``` **Response** ```json { "status": "ok", "credits_used": 1, "credits_remaining": 59, "values": { "vendor": "Northwind Supply", "invoiceNumber": "INV-1042", "issued": "2026-10-25", "total": 1280.5, "currency": "USD", "lineItems": [ { "description": "Cable", "amount": 1280.5 } ] } } ``` ### Get parse job `GET /api/v1/parse/jobs/{job_id}` Return a parse job's status and, when it has finished, the stored result for this workspace. - job_status is queued, running, succeeded, failed, or expired. - A finished succeeded job includes the same values and credits fields as a synchronous 200, with warnings and, for a partial result, failed_page_ranges. - A running job whose process stopped is picked up by this call: the chunks that were not finished run now, then the job settles, before the response is sent. - Another workspace's id or an unknown id returns 404. A result past the 24-hour window returns 410. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/parse/jobs/cm7job \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "job_id": "cm7job", "job_status": "running" } ``` ### List parse jobs `GET /api/v1/parse/jobs` List this workspace's parse jobs, newest first. Parsed values are not included. - Query parameters: page, page_size (max 100), status, from, to (ISO dates), and client_job_id (the X-Job-Id UUID, exact match in this workspace). - Each item has job_id, status, created_at, schema, credits_used, and client_job_id when set. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/parse/jobs?page=1 \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "jobs": [ { "job_id": "cm7job", "status": "succeeded", "created_at": "2026-10-26T00:00:00.000Z", "schema": "invoice", "credits_used": 1, "client_job_id": null } ], "page": 1, "page_size": 10, "total": 1 } ``` ### Read the parse webhook secret `GET /api/v1/parse/webhook-secret` Read the workspace secret that signs parse.job.finished callbacks, the ones an async parse sends to X-Webhook-Url. REST only. - It is made the first time it is read or a parse asks for a callback, and kept until it is rotated. - Only a key created by the workspace owner can read it. Other keys get 403 with code not_owner. - Check the Doxtract-Signature header of each callback with it, the same way as an inbox webhook. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/parse/webhook-secret \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "secret": "whsec_sample" } ``` ### Rotate the parse webhook secret `POST /api/v1/parse/webhook-secret` Replace the secret that signs parse.job.finished callbacks. Callbacks signed with the old secret stop verifying at once. REST only. - There is no request body. 200 returns the new secret. - Only a key created by the workspace owner can rotate it. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/parse/webhook-secret \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "secret": "whsec_new_sample" } ``` > The [Playground](https://doxtract.manoonlabs.com/playground) runs the same parse in the browser and returns the same JSON. --- # Schemas > The schema format, its limits, and the saved schema endpoints. Page: https://doxtract.manoonlabs.com/docs/api/schemas ## Schema format A schema is an object with `type: object` and `properties`. Each property has a type and an optional description the model reads. `array` adds `items`, one node. `object` adds `properties` and may add `required`. A date is a string in yyyy-mm-dd. Keys start with a letter or underscore, then letters, digits, underscores or hyphens. Types: `any`, `null`, `boolean`, `string`, `number`, `date`, `array`, `object` **Schema** ```json { "type": "object", "properties": { "vendor": { "type": "string" }, "invoiceNumber": { "type": "string" }, "issued": { "type": "date" }, "total": { "type": "number" }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "number" } }, "required": [ "description", "amount" ] } } }, "required": [ "vendor", "invoiceNumber", "total" ] } ``` ## Limits | Limit | Value | | --- | --- | | Root | object | | Date | yyyy-mm-dd | | Depth | 4 levels below the root | | Keys | 100 | | Size | 16,384 bytes | | Key length | 64 characters | | Description | 400 characters, optional | | Name length | 80 characters | | Saved schemas | 10 on Free, 100 on paid plans | ## Endpoints | Method | Path | What it does | | --- | --- | --- | | `GET` | `/api/v1/schemas` | [List schemas](#list_schemas) | | `GET` | `/api/v1/schemas/{slug}` | [Read a schema](#get_schema) | | `POST` | `/api/v1/schemas` | [Create a schema](#create_schema) | | `PATCH` | `/api/v1/schemas/{slug}` | [Update a schema](#update_schema) | ### List schemas `GET /api/v1/schemas` List the extraction schemas saved in this workspace. - There is no request body. - Each item has id, name, slug, keyCount, createdAt, and updatedAt. - Read one schema when you need its definition. - schemas is an empty array when the workspace has none. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/schemas \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "schemas": [ { "id": "cm7schema", "name": "Invoice", "slug": "invoice", "keyCount": 7, "createdAt": "2026-10-26T00:00:00.000Z", "updatedAt": "2026-10-26T00:00:00.000Z" } ] } ``` ### Read a schema `GET /api/v1/schemas/{slug}` Read one saved extraction schema by slug. - The slug is one path segment. URL-encode it. "invoice" is /api/v1/schemas/invoice. - The response adds schema, the definition (JSON key name unchanged). - A missing slug returns 404 with status "error" and message "That schema was not found.". **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/schemas/invoice \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "id": "cm7schema", "name": "Invoice", "slug": "invoice", "keyCount": 7, "createdAt": "2026-10-26T00:00:00.000Z", "updatedAt": "2026-10-26T00:00:00.000Z", "schema": { "type": "object", "properties": { "vendor": { "type": "string" }, "invoiceNumber": { "type": "string" }, "issued": { "type": "date" }, "total": { "type": "number" }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "number" } }, "required": [ "description", "amount" ] } } }, "required": [ "vendor", "invoiceNumber", "total" ] } } ``` ### Create a schema `POST /api/v1/schemas` Save an extraction schema in this workspace. The slug is derived from the display name. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Display name: letters, digits, spaces, underscore, and hyphen, up to 80 characters. The API slug is lowercase with underscores. | | `schema` | object | Yes | The schema definition (JSON key name is schema). See Schema format for the key types and limits. | - Two display names that produce the same slug (case and spacing ignored) are treated as duplicates. - 201 returns the saved schema, including its definition. - A duplicate returns 409 with status "error" and message "A schema with that name already exists in this workspace.". - A Free workspace can save 10 saved schemas. A paid workspace can save 100. Past that, the status is 409. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/schemas \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "name": "Invoice", "schema": { "type": "object", "properties": { "vendor": { "type": "string" }, "invoiceNumber": { "type": "string" }, "issued": { "type": "date" }, "total": { "type": "number" }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "number" } }, "required": [ "description", "amount" ] } } }, "required": [ "vendor", "invoiceNumber", "total" ] } }' ``` **Response** ```json { "status": "ok", "id": "cm7schema", "name": "Invoice", "slug": "invoice", "keyCount": 7, "createdAt": "2026-10-26T00:00:00.000Z", "updatedAt": "2026-10-26T00:00:00.000Z", "schema": { "type": "object", "properties": { "vendor": { "type": "string" }, "invoiceNumber": { "type": "string" }, "issued": { "type": "date" }, "total": { "type": "number" }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "number" } }, "required": [ "description", "amount" ] } } }, "required": [ "vendor", "invoiceNumber", "total" ] } } ``` ### Update a schema `PATCH /api/v1/schemas/{slug}` Change the display name and/or definition. Renaming updates the slug to match. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | One of | New display name, same rules as create. At most 80 characters. | | `schema` | object | One of | The new schema definition (JSON key name is schema). It replaces the old one. | - The path is the current slug, URL-encoded as one segment. - Send name, schema, or both. Sending neither returns 400. - 200 returns the schema after the change. - A duplicate slug returns 409. A missing schema returns 404. **Request** ```bash curl -X PATCH https://doxtract.manoonlabs.com/api/v1/schemas/invoice \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "schema": { "type": "object", "properties": { "total": { "type": "number" } } } }' ``` **Response** ```json { "status": "ok", "id": "cm7schema", "name": "Invoice", "slug": "invoice", "keyCount": 1, "createdAt": "2026-10-26T00:00:00.000Z", "updatedAt": "2026-10-26T00:00:00.000Z", "schema": { "type": "object", "properties": { "total": { "type": "number" } } } } ``` --- # Inboxes > Create, update and delete inboxes, upload, read, download and export their documents, and manage their email and webhook. Page: https://doxtract.manoonlabs.com/docs/api/inboxes | Method | Path | What it does | | --- | --- | --- | | `GET` | `/api/v1/inboxes` | [List inboxes](#list_inboxes) | | `GET` | `/api/v1/inboxes/{inbox_id}` | [Read an inbox and its fields](#get_inbox) | | `POST` | `/api/v1/inboxes/{inbox_id}/documents` | [Upload a document to an inbox](#upload_document) | | `POST` | `/api/v1/inboxes` | [Create an inbox](#create_inbox) | | `POST` | `/api/v1/inboxes/from-schema` | [Create an inbox from a schema](#create_inbox_from_schema) | | `PATCH` | `/api/v1/inboxes/{inbox_id}` | [Update an inbox](#update_inbox) | | `GET` | `/api/v1/inboxes/{inbox_id}/email` | [Read an inbox's email address](#get_inbox_email) | | `PATCH` | `/api/v1/inboxes/{inbox_id}/email` | [Enable or disable inbox email](#set_inbox_email_enabled) | | `PATCH` | `/api/v1/inboxes/{inbox_id}/webhook` | [Set the inbox webhook](#set_inbox_webhook) | | `POST` | `/api/v1/upload/{inbox_id}` | [Upload files to an inbox (multipart)](#upload_multipart) | | `GET` | `/api/v1/inboxes/{inbox_id}/documents` | [List an inbox's documents](#list_documents) | | `GET` | `/api/v1/inboxes/{inbox_id}/documents/{document_id}` | [Read a document and its values](#get_document) | | `GET` | `/api/v1/inboxes/{inbox_id}/documents/{document_id}/file` | [Download a document's file](#download_document) | | `DELETE` | `/api/v1/inboxes/{inbox_id}/documents/{document_id}` | [Delete a document](#delete_document) | | `POST` | `/api/v1/inboxes/{inbox_id}/export` | [Export an inbox](#export_inbox) | | `GET` | `/api/v1/inboxes/{inbox_id}/webhook` | [Read the inbox webhook](#get_inbox_webhook) | | `POST` | `/api/v1/inboxes/{inbox_id}/webhook/secret` | [Rotate the webhook signing secret](#rotate_inbox_webhook_secret) | | `GET` | `/api/v1/inboxes/{inbox_id}/webhook/deliveries` | [List webhook deliveries](#list_webhook_deliveries) | | `POST` | `/api/v1/inboxes/{inbox_id}/documents/{document_id}/webhook` | [Resend a document to the webhook](#resend_document_webhook) | | `DELETE` | `/api/v1/inboxes/{inbox_id}` | [Delete an inbox](#delete_inbox) | ### List inboxes `GET /api/v1/inboxes` List the inboxes this key can see, newest first. Each has its id, name, icon, status, document count and email address. - At most 200 inboxes come back in one call. - A key limited to some inboxes sees only those. - email is null when the server has no email domain configured. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inboxes": [ { "id": "cm7inbox", "name": "March invoices", "icon": "receipt", "status": "ACTIVE", "documentCount": 12, "createdAt": "2026-03-01T09:00:00.000Z", "updatedAt": "2026-03-14T16:20:00.000Z", "email": { "address": "k7q2x9mdpa@in.example.com", "enabled": true } } ] } ``` ### Read an inbox and its fields `GET /api/v1/inboxes/{inbox_id}` Read one inbox with its fields as a JSON schema. The fields show what kind of document the inbox reads, so an agent can pick the right inbox before it uploads. - schema is the inbox's fields in their saved order, or null for a draft with no fields yet. - A key limited to some inboxes gets 403 for other inboxes. A missing inbox returns 404. - email is null when the server has no email domain configured. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox": { "id": "cm7inbox", "name": "March invoices", "icon": "receipt", "status": "ACTIVE", "documentCount": 12, "createdAt": "2026-03-01T09:00:00.000Z", "updatedAt": "2026-03-14T16:20:00.000Z", "email": { "address": "k7q2x9mdpa@in.example.com", "enabled": true }, "schema": { "type": "object", "properties": { "invoice_number": { "type": "string" }, "vendor": { "type": "string" }, "total": { "type": "number" } } } } } ``` ### Upload a document to an inbox `POST /api/v1/inboxes/{inbox_id}/documents` Add one document to an inbox as base64 in a JSON body. It is read with the inbox's fields in the background and costs 1 credit per page. This is the MCP tool for adding documents; from your own code, the multipart upload at /api/v1/upload/{inbox_id} takes several files at once. - Send file_name and file_base64 (a PDF, PNG or JPEG). The type is read from the bytes, not the name. - The size limit is the workspace plan's per-document limit. Anything else is refused with 400. - A key limited to some inboxes gets 403 for other inboxes. A missing inbox returns 404, and a draft inbox that is not active yet is refused. - The 200 lists the new document's id. Its values appear in the inbox when the parse finishes. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/documents \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{"file_name": "invoice.pdf", "file_base64": "'"$(base64 < invoice.pdf | tr -d '\n')"'"}' ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "uploaded": 1, "total": 1, "files": [ { "file_name": "invoice.pdf", "ok": true, "document_id": "cm7doc" } ] } ``` ### Create an inbox `POST /api/v1/inboxes` Create an inbox in this workspace. Send template to start it from a built-in template, as the console does. The response includes its email address. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | The inbox name, up to 80 characters. Unique in the workspace. | | `template` | string | No | A built-in template: invoice, receipt, bank_statement, purchase_order, resume, identity_document, payslip. With it the inbox is ACTIVE with that template's fields. Without it the inbox is a DRAFT. | | `icon` | string | No | A Lucide icon name such as "receipt". Null or omitted keeps the default. | - 201 returns inbox.id, inbox.status and inbox.email.address. - A DRAFT does not parse mail or uploads until its fields are set in the console or with create_inbox_from_schema. - A key limited to some inboxes gets 403. Create the key with access to all inboxes. - Past the plan's inbox limit the status is 403 with code limit_reached. A duplicate name is 409. - An unknown template or icon returns 400. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/inboxes \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "name": "March invoices", "template": "invoice", "icon": "receipt" }' ``` **Response** ```json { "status": "ok", "inbox": { "id": "cm7inbox", "name": "March invoices", "icon": "receipt", "status": "ACTIVE", "email": { "address": "k7q2x9mdpa@in.example.com", "enabled": true } } } ``` ### Create an inbox from a schema `POST /api/v1/inboxes/from-schema` Create an active inbox from a schema you send, in the same format as saved fields. The API and MCP only: the console does not offer this path. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | The inbox name, up to 80 characters. Unique in the workspace. | | `schema` | object | Yes | The fields to read. The inbox is ACTIVE at once. | | `icon` | string | No | A Lucide icon name. Null or omitted keeps the default. | - 201 returns inbox.id, inbox.status (ACTIVE) and inbox.email.address. - An invalid schema returns 400 and no inbox is created. - Same key rules, limits and errors as create_inbox. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/inboxes/from-schema \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "name": "Custom receipts", "schema": { "type": "object", "properties": { "vendor": { "type": "string" }, "invoiceNumber": { "type": "string" }, "issued": { "type": "date" }, "total": { "type": "number" }, "lineItems": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string" }, "amount": { "type": "number" } }, "required": [ "description", "amount" ] } } }, "required": [ "vendor", "invoiceNumber", "total" ] }, "icon": "receipt" }' ``` **Response** ```json { "status": "ok", "inbox": { "id": "cm7inbox", "name": "Custom receipts", "icon": "receipt", "status": "ACTIVE", "email": { "address": "k7q2x9mdpa@in.example.com", "enabled": true } } } ``` ### Update an inbox `PATCH /api/v1/inboxes/{inbox_id}` Change the name, icon and/or fields of an inbox. Renaming does not change its email address. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | One of | New name, up to 80 characters. Unique in the workspace. | | `icon` | string or null | One of | A Lucide icon name. Null goes back to the default icon. | | `schema` | object | One of | The inbox's new fields, in the same format as create_inbox_from_schema. It replaces the old fields of an ACTIVE inbox. | - Send any of name, icon and schema. Sending none returns 400. - New fields apply to documents that arrive from now on. Documents already parsed keep their values until they are re-run in the console. - Only an ACTIVE inbox takes a schema. A draft returns 409 with code not_active: its fields are still being set up in the console. An invalid schema returns 400 and changes nothing. - A duplicate name returns 409. A missing inbox returns 404. **Request** ```bash curl -X PATCH https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "icon": "wallet" }' ``` **Response** ```json { "status": "ok", "inbox": { "id": "cm7inbox", "name": "March invoices", "icon": "wallet", "status": "ACTIVE" } } ``` ### Read an inbox's email address `GET /api/v1/inboxes/{inbox_id}/email` Read the email address of an inbox and whether it accepts mail. The address is created the first time it is read and does not change. - A key limited to some inboxes gets 403 for other inboxes. - A missing inbox returns 404. A server with no email domain returns 503. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/email \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "email": { "address": "k7q2x9mdpa@in.example.com", "enabled": true } } ``` ### Enable or disable inbox email `PATCH /api/v1/inboxes/{inbox_id}/email` Turn mail receiving on or off for an inbox. The address stays the same. Documents already in the inbox are not affected. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | Yes | true accepts mail, false ignores it. | - Mail sent to a disabled address is ignored, not bounced. - 200 returns the address and its enabled value after the change. **Request** ```bash curl -X PATCH https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/email \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "enabled": false }' ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "email": { "address": "k7q2x9mdpa@in.example.com", "enabled": false } } ``` ### Set the inbox webhook `PATCH /api/v1/inboxes/{inbox_id}/webhook` Send each parsed document of an inbox to your URL, including documents that arrive by email or upload, so no polling is needed. Every body is signed with the returned secret. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `url` | string | One of | The https URL to POST to. An empty string turns the webhook off and keeps the other settings. | | `enabled` | boolean | One of | false pauses sending and keeps the URL (the console's Send automatically switch); true sends again. | | `auth_type` | string | No | How your receiver is authenticated: "none" (default), "basic" or "bearer". | | `username` | string | No | Basic auth user name. | | `secret` | string | No | Basic auth password, or the bearer token. | | `headers` | array | No | Up to 10 extra headers, each {name, value}. | - Each request has a Doxtract-Signature header. Check it with the secret before you trust the body. - 200 returns webhook.url and webhook.secret. Store the secret: it is the key to check signatures. - Changing url, auth_type, username, secret or headers needs a key created by the workspace owner. Other keys get 403. enabled alone works with any key that can use the inbox. - auth_type, username, secret and headers are sent with url. 200 also returns webhook.enabled. - An https URL is required in production. A bad URL or auth returns 400 with code invalid_webhook_url. **Request** ```bash curl -X PATCH https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/webhook \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/doxtract", "auth_type": "bearer", "secret": "receiver-token" }' ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "webhook": { "url": "https://example.com/doxtract", "secret": "whsec_sample", "enabled": true } } ``` ### Upload files to an inbox (multipart) `POST /api/v1/upload/{inbox_id}` Add one or more documents to an inbox in one multipart request, so curl can upload with -F. Each file is read with the inbox's fields in the background and costs 1 credit per page. REST only: the MCP tool is upload_document. **Request body (multipart/form-data)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `file` | file | Yes | A PDF, PNG or JPEG. Repeat the field to send several files. The type is read from the bytes, not the name. | | `instructions` | string | No | How to read the values of these files, as the console's upload prompt. Saved as the inbox's prompt for later uploads. | - The 200 lists every file with ok and its new document_id, or ok false with a code and message. One bad file does not stop the others. - The size limit is the workspace plan's per-document limit. - A key limited to some inboxes gets 403 for other inboxes. A missing inbox returns 404, and a draft inbox that is not active yet is refused. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/upload/cm7inbox \ -H "Authorization: Bearer mldxt_..." \ -F file=@invoice-1.pdf \ -F file=@invoice-2.pdf ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "uploaded": 2, "total": 2, "files": [ { "file_name": "invoice-1.pdf", "ok": true, "document_id": "cm7doc1" }, { "file_name": "invoice-2.pdf", "ok": true, "document_id": "cm7doc2" } ] } ``` ### List an inbox's documents `GET /api/v1/inboxes/{inbox_id}/documents` List the documents of an inbox, newest first, with their status and failure reason. Values are not included: read them with get_document. **Query parameters** | Key | Type | Required | Description | | --- | --- | --- | --- | | `page` | integer | No | Page number, from 1. Default 1. | | `page_size` | integer | No | Documents per page, 1 to 100. Default 20. | | `status` | string | No | Only documents with this status: QUEUED, ANALYZING, PARSED, FAILED. | - status is QUEUED (waiting), ANALYZING (being read), PARSED (values ready) or FAILED. A FAILED document has failure.code and failure.message. - has_file is false once the original file is no longer stored. - total is the number of documents that match, across every page. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/documents?status=PARSED&page_size=20 \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "documents": [ { "id": "cm7doc", "inbox_id": "cm7inbox", "file_name": "invoice.pdf", "status": "PARSED", "page_count": 2, "credits_used": 2, "failure": null, "has_file": true, "created_at": "2026-10-26T00:00:00.000Z", "updated_at": "2026-10-26T00:00:00.000Z" } ], "total": 1, "page": 1, "page_size": 20 } ``` ### Read a document and its values `GET /api/v1/inboxes/{inbox_id}/documents/{document_id}` Read one document. Once it is PARSED the response has its values, with any edits made in the console, and its citations. - values and citations are null until the document is PARSED. result_status is ok or partial. - edited lists the value paths someone changed by hand in the console. - A document that is not in this inbox returns 404. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/documents/cm7doc \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "document": { "id": "cm7doc", "inbox_id": "cm7inbox", "file_name": "invoice.pdf", "status": "PARSED", "page_count": 2, "credits_used": 2, "failure": null, "has_file": true, "created_at": "2026-10-26T00:00:00.000Z", "updated_at": "2026-10-26T00:00:00.000Z", "result_status": "ok", "values": { "vendor": "Northwind", "total": 1280.5 }, "citations": null, "edited": [] } } ``` ### Download a document's file `GET /api/v1/inboxes/{inbox_id}/documents/{document_id}/file` Download the file that was uploaded or emailed, as base64 in a JSON body, so it works the same from REST and MCP. - file.content is the file as base64. Decode it and save it as file.file_name. - A file that is no longer stored returns 410 with code file_gone. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/documents/cm7doc/file \ -H "Authorization: Bearer mldxt_..." \ | jq -r .file.content | base64 --decode > invoice.pdf ``` **Response** ```json { "status": "ok", "document_id": "cm7doc", "file": { "file_name": "invoice.pdf", "content_type": "application/pdf", "content": "JVBERi0xLjcK..." } } ``` ### Delete a document `DELETE /api/v1/inboxes/{inbox_id}/documents/{document_id}` Delete one document with its file, its values and its webhook call log. This cannot be undone. - A document still QUEUED or ANALYZING returns 409 with code busy. Try again when it has finished. - The first document of a draft inbox sets up its fields, so it returns 409 with code not_active: delete the inbox instead. - If a stored file could not be deleted, nothing is deleted and the status is 500 with code delete_failed. Try again. **Request** ```bash curl -X DELETE https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/documents/cm7doc \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "document_id": "cm7doc", "deleted": true } ``` ### Export an inbox `POST /api/v1/inboxes/{inbox_id}/export` Build one Excel, CSV or JSON file from an inbox's parsed documents, with the same choices as the console's Export page. **Request body (JSON)** | Key | Type | Required | Description | | --- | --- | --- | --- | | `format` | string | Yes | "xlsx", "csv" or "json". | | `document_ids` | array | No | Only these documents, at most 20000. Ids that are not parsed or not in this inbox are left out. | | `except_ids` | array | No | Every parsed document but these. Send this or document_ids, not both. Neither means every parsed document. | | `columns` | array | No | Field keys to include, in this order. Omit for every field. | - Only PARSED documents whose values are still stored are exported, newest first. - file.content is the file as base64, with file.file_name and file.content_type. - This call reads only. It spends no credits and does not mark anything as exported. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/export \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "format": "xlsx", "columns": [ "vendor", "total" ] }' ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "file": { "file_name": "march-invoices-export.xlsx", "content_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "content": "UEsDBBQAAAAI..." } } ``` ### Read the inbox webhook `GET /api/v1/inboxes/{inbox_id}/webhook` Read an inbox's webhook: its URL, whether documents are sent automatically, the receiver's auth type and the custom header names. - enabled is the console's Send automatically switch. false keeps the URL and sends nothing. - A key created by the workspace owner also gets secret, the signing secret (made the first time it is read). Other keys get null and an empty username. - Header values are never returned, since they may hold credentials. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/webhook \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "webhook": { "url": "https://example.com/doxtract", "enabled": true, "auth_type": "bearer", "username": "", "headers": [ "X-Team" ], "secret": "whsec_sample" } } ``` ### Rotate the webhook signing secret `POST /api/v1/inboxes/{inbox_id}/webhook/secret` Replace the inbox's signing secret with a new one. Calls signed with the old secret stop verifying at once, so update your receiver right after. - There is no request body. 200 returns webhook.secret, the new secret. - Only a key created by the workspace owner can rotate it. Other keys get 403. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/webhook/secret \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "webhook": { "secret": "whsec_new_sample" } } ``` ### List webhook deliveries `GET /api/v1/inboxes/{inbox_id}/webhook/deliveries` Read the inbox's webhook call log, newest first: the same calls the console's Calls page lists. **Query parameters** | Key | Type | Required | Description | | --- | --- | --- | --- | | `limit` | integer | No | How many calls, 1 to 100. Default 20. | - event is document.parsed or document.failed. trigger is auto (sent when a parse ended) or manual (a resend). - http_status is null when the endpoint never answered. response_body holds the first 2,000 characters of its answer. - There is no automatic retry: resend a document with resend_document_webhook. **Request** ```bash curl -X GET https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/webhook/deliveries?limit=20 \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "deliveries": [ { "id": "cm7call", "document_id": "cm7doc", "file_name": "invoice.pdf", "event": "document.parsed", "trigger": "auto", "url": "https://example.com/doxtract", "http_status": 500, "succeeded": false, "error": "The endpoint answered HTTP 500.", "response_body": "Internal Server Error", "attempted_at": "2026-10-26T00:00:00.000Z" } ] } ``` ### Resend a document to the webhook `POST /api/v1/inboxes/{inbox_id}/documents/{document_id}/webhook` Send a parsed document's values to the inbox's webhook again, now. The call is added to the call log as a manual attempt. - There is no request body. 200 returns delivery.succeeded, delivery.http_status and delivery.error. - No URL set returns 409 with code webhook_no_url, a paused webhook webhook_off, and a document that is not PARSED webhook_not_ready. **Request** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox/documents/cm7doc/webhook \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "document_id": "cm7doc", "delivery": { "succeeded": true, "http_status": 200, "error": null } } ``` ### Delete an inbox `DELETE /api/v1/inboxes/{inbox_id}` Delete an inbox with all its documents, their files and values, its fields and its webhook call log. This cannot be undone, and its email address stops receiving mail. - A key limited to some inboxes can delete only those. - If a stored file could not be deleted, nothing is deleted and the status is 500 with code delete_failed. Try again. - A missing inbox returns 404. **Request** ```bash curl -X DELETE https://doxtract.manoonlabs.com/api/v1/inboxes/cm7inbox \ -H "Authorization: Bearer mldxt_..." ``` **Response** ```json { "status": "ok", "inbox_id": "cm7inbox", "deleted": true } ``` ## Webhook events | Event | When | | --- | --- | | `document.parsed` | An inbox document was parsed. Sent to the inbox webhook with the values and citations, by the auto send after a parse and by a resend. | | `document.failed` | An inbox document could not be parsed, or its parse stopped and was given up. Sent once to the inbox webhook with failure.code and failure.message and no values. It is never counted as an export. | | `parse.job.finished` | An async parse that sent X-Webhook-Url ended, succeeded or failed. The body names the job and its result_url (a path on this API), not the values: read them with GET /api/v1/parse/jobs/{job_id}. Signed with the workspace's parse webhook secret. | - Every call is a POST with Content-Type: application/json and a Doxtract-Event header naming the event. - Doxtract-Signature is t=,v1=.">. Compute it with the secret, compare in constant time, and refuse a t more than 5 minutes old. - Inbox events use the inbox's signing secret (get_inbox_webhook). parse.job.finished uses the workspace secret (get_parse_webhook_secret). - Answer with any 2xx within 10 seconds. A redirect, a timeout or another status is a failed call. There is no automatic retry. Inbox calls are in list_webhook_deliveries, and a parsed document can be sent again with resend_document_webhook (document.failed is not resent). A parse job can always be polled. - parse.job.finished is sent when the job ends on the server. A job whose server process stopped is settled by the next GET /api/v1/parse/jobs/{job_id} and calls back then; a job that expired unread never calls back. Asking needs a key made by the workspace owner, and a replay with the same X-Job-Id keeps the first job's X-Webhook-Url. - In production the URL must be https to a public host. **document.parsed** ```json { "event": "document.parsed", "sent_at": "2026-10-26T00:00:00.000Z", "inbox": { "id": "cm7inbox" }, "document": { "id": "cm7doc", "file_name": "invoice.pdf", "page_count": 2 }, "values": { "vendor": "Northwind", "total": 1280.5 }, "citations": null } ``` **document.failed** ```json { "event": "document.failed", "sent_at": "2026-10-26T00:00:00.000Z", "inbox": { "id": "cm7inbox" }, "document": { "id": "cm7doc", "file_name": "scan.pdf", "page_count": 1, "status": "FAILED" }, "failure": { "code": "empty", "message": "Nothing could be read from this document." } } ``` **parse.job.finished** ```json { "event": "parse.job.finished", "sent_at": "2026-10-26T00:00:00.000Z", "job": { "id": "cm7job", "status": "succeeded", "credits_used": 2, "failure_code": null, "finished_at": "2026-10-26T00:00:00.000Z", "result_url": "/api/v1/parse/jobs/cm7job" } } ``` **Check the signature** ```ts import { createHmac, timingSafeEqual } from "node:crypto"; export function verify(secret: string, header: string, rawBody: string) { const parts = Object.fromEntries(header.split(",").map((p) => p.split("="))); const t = Number(parts.t); if (Math.abs(Date.now() / 1000 - t) > 300) return false; const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex"); const given = Buffer.from(parts.v1 ?? ""); return given.length === expected.length && timingSafeEqual(given, Buffer.from(expected)); } ``` --- # Excel and CSV > Get the result as a file in the same response, for no extra credits. Page: https://doxtract.manoonlabs.com/docs/api/export Add `export=xlsx` or `export=csv` to a parse, as a form field or a JSON key. The response is the same JSON plus an `export` object with the file as base64. **Excel** ```bash curl -s -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -F file=@invoice.pdf \ -F schema=invoice \ -F export=xlsx \ | jq -r '.export.content' | base64 -d > invoice.xlsx ``` **CSV** ```bash curl -s -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -F file=@invoice.pdf \ -F schema=invoice \ -F export=csv \ | jq -r '.export.content' | base64 -d > invoice.csv ``` **TypeScript** ```ts import { readFile, writeFile } from "node:fs/promises"; const form = new FormData(); form.append("file", new Blob([await readFile("invoice.pdf")]), "invoice.pdf"); form.append("schema", "invoice"); form.append("export", "xlsx"); const res = await fetch("https://doxtract.manoonlabs.com/api/v1/parse", { method: "POST", headers: { Authorization: `Bearer ${process.env.DOXTRACT_KEY}` }, body: form, }); const body = await res.json(); if (body.status !== "ok") throw new Error(body.message); console.log(body.values.total); // the JSON is still here await writeFile(body.export.filename, Buffer.from(body.export.content, "base64")); ``` **Python** ```python import base64, os, requests with open("invoice.pdf", "rb") as f: res = requests.post( "https://doxtract.manoonlabs.com/api/v1/parse", headers={"Authorization": f"Bearer {os.environ['DOXTRACT_KEY']}"}, files={"file": f}, data={"schema": "invoice", "export": "xlsx"}, ) body = res.json() if body["status"] != "ok": raise RuntimeError(body["message"]) print(body["values"]["total"]) # the JSON is still here with open(body["export"]["filename"], "wb") as out: out.write(base64.b64decode(body["export"]["content"])) ``` **Response** ```json { "status": "ok", "credits_used": 1, "credits_remaining": 59, "values": { "vendor": "Northwind Supply", "invoiceNumber": "INV-1042", "issued": "2026-10-25", "total": 1280.5, "currency": "USD", "lineItems": [ { "description": "Cable", "amount": 1280.5 } ] }, "export": { "format": "xlsx", "filename": "invoice-2026-10-26.xlsx", "contentType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "content": "UEsDBBQABgAIAAAAIQ..." } } ``` **export object** | Key | Type | Required | Description | | --- | --- | --- | --- | | `export.format` | "xlsx" \| "csv" | Always | The export value you sent. | | `export.filename` | string | Always | A suggested name, -. in UTC. The name is the document name (filename, else the uploaded file name), else the saved schema name, else "doxtract". | | `export.contentType` | string | Always | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for xlsx, text/csv; charset=utf-8 for csv. | | `export.content` | string | Always | The file bytes as standard base64. Decode and write them to disk. | ## Excel (.xlsx) - The Document sheet has one row: a document column, then every top-level key. - Nested objects become dotted columns, for example vendor.address.city. - Each list of objects gets its own sheet, named after its path (lineItems, or lineItems.taxes for a list inside a list). Its first columns tie each row back: document, then a row number per level ("lineItems #"). - document is the document name: filename, else the uploaded file name, else 1. - Numbers and dates (yyyy-mm-dd) are real number and date cells. true and false stay booleans. Lists of plain values are joined with "; ". Headers are bold and frozen. ## CSV (.csv) - One row per item of the largest list in the result, usually the line items. Its columns are prefixed with its path, for example lineItems.amount. - Every other key is repeated on each row, so the file stands on its own in a spreadsheet or a database import. - A result with no lists is a single row. Other lists of objects, including lists inside a line item, are written into one cell as JSON. Excel has every list as its own sheet. - UTF-8 with a byte order mark, so Excel shows accents and currency symbols correctly. Lines end with CRLF. Text that starts with =, +, -, or @ gets a leading apostrophe, so it is not run as a formula. ## Sample output **Excel** ```text Document sheet document | vendor | invoiceNumber | issued | total | currency ------------|------------------|---------------|------------|--------|--------- invoice.pdf | Northwind Supply | INV-1042 | 2026-10-25 | 1280.5 | USD lineItems sheet document | lineItems # | description | amount ------------|-------------|-------------|------- invoice.pdf | 1 | Cable | 1280.5 ``` **CSV** ```text vendor,invoiceNumber,issued,total,currency,lineItems.description,lineItems.amount Northwind Supply,INV-1042,2026-10-25,1280.5,USD,Cable,1280.5 ``` ## Notes - The JSON is always in the response. export only adds the file next to it, from the same parse, for the same credits. - A failed parse never has export. Check status first. - If the file cannot be built, the response is the plain JSON without export. The parse itself still counts. - MCP's parse_document returns JSON only. The Playground has a Download menu for Excel and CSV. --- # Citations > See the page and box each value was read from, for no extra credits. Page: https://doxtract.manoonlabs.com/docs/api/citations Add `citations=true` to a parse, as a form field or a JSON key. The response is the same JSON plus a `citations` object keyed by each value's path. Works for PDFs and images. **Upload** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -F file=@invoice.pdf \ -F schema=invoice \ -F citations=true ``` **JSON body** ```bash curl -X POST https://doxtract.manoonlabs.com/api/v1/parse \ -H "Authorization: Bearer mldxt_..." \ -H "Content-Type: application/json" \ -d '{ "file_base64": "", "schema": "invoice", "citations": true }' ``` **Response** ```json { "status": "ok", "credits_used": 1, "credits_remaining": 59, "values": { "vendor": "Northwind Supply", "invoiceNumber": "INV-1042", "issued": "2026-10-25", "total": 1280.5, "currency": "USD", "lineItems": [ { "description": "Cable", "amount": 1280.5 } ] }, "citations": { "vendor": { "page": 1, "text": "Northwind Supply", "bbox": [ 0.08, 0.06, 0.34, 0.09 ], "status": "verified", "source": "text_layer" }, "invoiceNumber": { "page": 1, "text": "Invoice INV-1042", "bbox": [ 0.62, 0.06, 0.92, 0.09 ], "status": "verified", "source": "text_layer" }, "issued": { "page": 1, "text": "Issued 25 Oct 2026", "bbox": [ 0.62, 0.1, 0.92, 0.12 ], "status": "fuzzy", "source": "text_layer" }, "total": { "page": 1, "text": "Total 1,280.50 USD", "bbox": [ 0.62, 0.71, 0.92, 0.74 ], "status": "verified", "source": "text_layer" }, "currency": { "page": 1, "text": "Total 1,280.50 USD", "bbox": [ 0.62, 0.71, 0.92, 0.74 ], "status": "verified", "source": "text_layer" }, "lineItems[0].description": { "page": 1, "text": "Cable", "bbox": [ 0.08, 0.41, 0.2, 0.43 ], "status": "verified", "source": "text_layer" }, "lineItems[0].amount": { "page": 1, "text": "1,280.50", "bbox": [ 0.8, 0.41, 0.92, 0.43 ], "status": "verified", "source": "text_layer" } } } ``` **One citations entry** | Key | Type | Required | Description | | --- | --- | --- | --- | | `page` | number \| null | Always | The page the value was read from, counting from 1. An image is page 1. null for a text document. | | `text` | string | Always | The printed text the value was read from, as it appears on the page. | | `bbox` | [x0, y0, x1, y1] \| null | Always | The box around that text, as fractions of the page width and height from the top left, so it fits any render size. null when no box could be placed, and always null for text documents. | | `status` | string | Always | How well the cited text was checked against the document. See the statuses below. | | `source` | "text_layer" \| "ocr" \| "model" \| null | Always | text_layer when the box was measured from the PDF's own text, ocr when it was measured by reading a scanned page or an image, model when the model estimated it on a page that was not read, null when there is no box. | ## Status | Status | Meaning | | --- | --- | | `verified` | The cited text was found on the page and holds the value. | | `fuzzy` | A close match was found, for example with scan noise or a reflowed line. | | `mismatch` | The text was found, but the value does not appear in it. Worth a human look. | | `other_page` | The text was found, but on a different page than cited. page points to where it was found. | | `unverified` | The text could not be found, either in the document's own text or on a scanned page that was read. A box, if any, is the model's estimate or a value match with no quote to check. | ## Notes - citations is off by default. Send citations: true in a JSON body, or citations=true as a multipart field. MCP parse_document takes the same citations argument. - The Playground always asks for citations, so you can click a value to see its box on the page. - Keys are the path of each value, such as vendor or lineItems[0].amount. A null value, or one that could not be placed, has no entry. - Works for PDFs (digital and scanned) and for PNG and JPEG images. Text documents get the cited text with no page or box. - Same credits as a plain parse. Citations work together with export. --- # MCP server > Connect Cursor, Claude Code, or any MCP client. Page: https://doxtract.manoonlabs.com/docs/mcp ## Endpoint | | | | --- | --- | | URL | `POST https://doxtract.manoonlabs.com/mcp` | | Transport | Streamable HTTP, JSON-RPC 2.0, one JSON body | | Protocol | `2025-06-18` | | Server name | `doxtract` | | Methods | `initialize`, `ping`, `tools/list`, `tools/call` | ## Connect a client - Create a key on [API Keys](https://doxtract.manoonlabs.com/settings/developer) and copy the secret. - Add the config below. Cursor reads `.cursor/mcp.json`. Claude Code registers the server from a terminal. - Call `whoami` to confirm the workspace, then `parse_document`. **Cursor** ```json { "mcpServers": { "doxtract": { "url": "https://doxtract.manoonlabs.com/mcp", "headers": { "Authorization": "Bearer mldxt_..." } } } } ``` **Claude Code** ```bash claude mcp add --transport http doxtract https://doxtract.manoonlabs.com/mcp \ --header "Authorization: Bearer mldxt_..." ``` ## Authentication `initialize`, `ping`, `tools/list` and notifications answer without a key. `tools/call` needs one, sent as `Authorization: Bearer ` or `x-api-key: `. Each parsed page costs 1 credit, the same as REST. ## Tools Arguments are the REST JSON keys. Where REST reads `{slug}` from the path, the argument is `slug`. `parse_document` takes the file as `file_base64` or plain text as `text`. Every tool acts on the workspace that owns the key. | Tool | What it does | Arguments | | --- | --- | --- | | `whoami` | Return the workspace and token for the bearer credential, and the credits left this month. | none | | `parse_document` | Extract structured fields from a PDF, PNG, JPEG, or text file sent as base64 in file_base64, or from plain text sent in text (10 MB and 10 pages on Free, 25 MB on Starter and Pro, 100 MB on Business; pages per document by plan: Starter 50, Pro 200, Business 500). 1 credit per page; an image is 1 page; text is 1 credit per 3,000 characters. The file is deleted after processing. Send exactly one of file_base64 or text. The result has status and values. Set citations to true to also get, for each value, the page, the printed text, and a box where it was read. | `schema`, `file_base64`, `text`, `citations`, `password`, `strict` | | `list_schemas` | List the extraction schemas saved in this workspace. | none | | `get_schema` | Read one saved extraction schema by slug. | `slug` (required) | | `create_schema` | Save an extraction schema in this workspace. The slug (API id) is derived from the display name. A schema is {"type":"object","properties":{...}}. Each property is {"type":T} where T is one of any, null, boolean, string, number, date, array, object. An optional description, at most 400 characters, tells the model how to read that key. An optional required array lists the keys that must be present. A date is a string yyyy-mm-dd. An array adds "items" (one node). An object adds "properties" and may add "required". At most 4 levels below the root, 100 keys, and 16384 bytes. | `name` (required), `schema` (required) | | `update_schema` | Update a saved schema's display name and/or definition. A schema is {"type":"object","properties":{...}}. Each property is {"type":T} where T is one of any, null, boolean, string, number, date, array, object. An optional description, at most 400 characters, tells the model how to read that key. An optional required array lists the keys that must be present. A date is a string yyyy-mm-dd. An array adds "items" (one node). An object adds "properties" and may add "required". At most 4 levels below the root, 100 keys, and 16384 bytes. | `slug` (required), `name`, `schema` | | `list_inboxes` | List the inboxes this key can see, newest first, up to 200. Each has its id, name, icon, status, document count and email address. A key limited to some inboxes sees only those. | none | | `get_inbox` | Read one inbox: its name, icon, status, document count, email address, and its fields as a JSON schema (schema, null for a draft with no fields yet). The fields show what kind of document the inbox reads, so use them to decide which inbox a document belongs in. | `inbox_id` (required) | | `upload_document` | Add one document to an inbox. It is read with the inbox's fields in the background, the same as a document dropped into the inbox in the console, and costs 1 credit per page. Send the file as file_base64 (a PDF, PNG or JPEG) with its file_name. Returns the new document's id. Upload only to the inbox the document belongs in: call get_inbox to read an inbox's fields when you are not sure. | `inbox_id` (required), `file_name` (required), `file_base64` (required) | | `create_inbox` | Create an inbox in this workspace and return its id and email address. Send template (a built-in template slug: invoice, receipt, bank_statement, purchase_order) to make it ACTIVE with that template's fields, the same as creating one in the console. Without a template it is a DRAFT that does not parse yet. | `name` (required), `template`, `icon` | | `create_inbox_from_schema` | Create an active inbox from a schema you send, in the same format as saved fields. The inbox gets its own fields, its email address is returned, and mail and uploads are parsed at once. This path is for the API and MCP only; the console does not offer it. | `name` (required), `schema` (required), `icon` | | `update_inbox` | Change an inbox's name, icon and/or fields. Send any of name, icon and schema. Send icon as null to go back to the default icon. Renaming does not change the email address. A schema replaces an ACTIVE inbox's fields, in the same format as create_inbox_from_schema; documents already parsed keep their values until they are re-run in the console. A draft refuses a schema (409 not_active). | `inbox_id` (required), `name`, `icon`, `schema` | | `get_inbox_email` | Read an inbox's email address and whether it accepts mail. The address is created the first time it is read. | `inbox_id` (required) | | `set_inbox_email_enabled` | Turn mail receiving on or off for one inbox. The address does not change. Documents already in the inbox are not affected. | `inbox_id` (required), `enabled` (required) | | `set_inbox_webhook` | Save where an inbox sends each parsed document, so documents that arrive by email or upload reach your system without a poll. Each body is signed with the returned secret. An empty url turns the webhook off and forgets the URL. Send enabled false to pause sending (the console's Send automatically switch) and keep the URL, true to resume. Changing url, auth or headers needs a key created by the workspace owner; enabled alone does not. | `inbox_id` (required), `url`, `enabled`, `auth_type`, `username`, `secret`, `headers` | | `get_inbox_webhook` | Read an inbox's webhook settings: the URL, whether documents are sent automatically (enabled), the receiver's auth type and the custom header names. A key created by the workspace owner also gets the signing secret; other keys get null. | `inbox_id` (required) | | `rotate_inbox_webhook_secret` | Replace an inbox's webhook signing secret with a new one and return it. Calls signed with the old secret stop verifying at once, so update your receiver right after. Only a key created by the workspace owner can do this. | `inbox_id` (required) | | `list_webhook_deliveries` | List an inbox's webhook calls, newest first, up to 100: the event, the document, the HTTP status, whether it succeeded, the error and the start of the endpoint's answer. The same call log as the console. | `inbox_id` (required), `limit` | | `resend_document_webhook` | Send one parsed document's values to the inbox's webhook again, now. Recorded as a manual attempt in the call log. Returns whether the endpoint accepted it. | `inbox_id` (required), `document_id` (required) | | `delete_inbox` | Delete an inbox with all its documents, their files and values, its fields and its webhook call log. This cannot be undone. Its email address stops working. | `inbox_id` (required) | | `list_documents` | List an inbox's documents, newest first, 20 a page (page_size up to 100). Each has its id, file name, status (QUEUED, ANALYZING, PARSED or FAILED), pages, credits and failure reason. Filter with status. Values are not included: call get_document. | `inbox_id` (required), `page`, `page_size`, `status` | | `get_document` | Read one document of an inbox: its status, file name, pages, credits and failure reason, and once parsed its values (with any edits made in the console) and citations. | `inbox_id` (required), `document_id` (required) | | `download_document` | Download the original file of one document, as base64 in content with its file_name and content_type. A file that is no longer stored returns 410. | `inbox_id` (required), `document_id` (required) | | `delete_document` | Delete one document with its file, its values and its webhook call log. This cannot be undone. A document still queued or being read is refused (409); try again when it has finished. | `inbox_id` (required), `document_id` (required) | | `export_inbox` | Download an inbox's parsed documents as one Excel (xlsx), CSV or JSON file, as the console's Export page does: every parsed document, or only document_ids, or all but except_ids, and optionally only some columns (field keys). Returns the file as base64 in content with its file_name and content_type. | `inbox_id` (required), `format` (required), `document_ids`, `except_ids`, `columns` | ## Messages **tools/call** ```text { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "parse_document", "arguments": { "file_base64": "", "schema": "invoice" } } } ``` **Result** ```json { "jsonrpc": "2.0", "id": 1, "result": { "content": [ { "type": "text", "text": "{\"status\":\"ok\",\"credits_used\":1,\"credits_remaining\":59,\"values\":{\"vendor\":\"Northwind Supply\",\"invoiceNumber\":\"INV-1042\",\"issued\":\"2026-10-25\",\"total\":1280.5,\"currency\":\"USD\",\"lineItems\":[{\"description\":\"Cable\",\"amount\":1280.5}]}}" } ], "isError": false } } ``` **Initialize** ```text { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2025-06-18", "capabilities": { "tools": { "listChanged": false } }, "serverInfo": { "name": "doxtract", "version": "0.1.0" } } } ``` **JSON-RPC error** ```json { "jsonrpc": "2.0", "id": 1, "error": { "code": -32602, "message": "Unexpected key: extra" } } ``` ## Errors | Case | Response | | --- | --- | | Unknown tool, unexpected key or missing key | HTTP 200, JSON-RPC error -32602 | | The operation ran and failed | HTTP 200, `isError` true, `result.content[0].text` is the REST error JSON | | No valid key on a method that needs one | HTTP 401, JSON-RPC error -32001 | | Any method other than POST | HTTP 405 | | Notification with no id | HTTP 202, empty body | --- # Status codes > Every REST status and the error bodies you will see most often. Page: https://doxtract.manoonlabs.com/docs/api/errors | Status | Meaning | | --- | --- | | `200` | The call succeeded. | | `201` | A schema was created. | | `400` | A failed parse returns status "error", message, credits_used, and credits_remaining. That includes an export other than xlsx or csv, and a filename that is not a string, both caught before credits are spent. Schema routes (`/api/v1/schemas`) and whoami return status "error" and message naming the field or rule that failed, with no credit fields because they never spend credits. Their success bodies start with status "ok". | | `401` | The bearer token is missing, unknown, revoked, or expired. The response body is empty, and the call is omitted from Activity. | | `402` | The workspace does not have enough credits for this document. The body includes credits_required, credits_used, credits_remaining, and upgrade. A 402 does not spend. Allotments per plan are on the pricing page. | | `403` | Parsing is paused for this workspace. | | `404` | That schema was not found. | | `405` | The HTTP method does not match the route. The response body is empty. | | `409` | The schema name already exists, or the workspace is at its schema limit. | | `429` | This workspace already parsed in the last second. Limit is 1 parse per second per workspace. The body includes retry_after. REST also sends Retry-After. A 429 does not spend credits. | | `502` | The model could not extract the document. The body has status "error", message, credits_used 0 (the charge is refunded), and credits_remaining. With strict true, a chunk that could not be read also returns 502 with failed_page_ranges, the pages that failed. | | `503` | Storage or the job queue behind the parser could not be reached. The body has status "error", message, failure_code SERVICE_UNAVAILABLE, credits_used 0 (nothing is charged), and credits_remaining. REST also sends Retry-After. Retry the same request after that many seconds; a job id you sent in X-Job-Id can be reused. | | `504` | The parse took longer than 100 seconds (10 minutes with Prefer: respond-async) and was stopped. Same body as 502: the charge is refunded. Try again, or send fewer pages. | ## Error bodies **400** ```json { "status": "error", "message": "Unknown schema: invoice", "credits_used": 0, "credits_remaining": 59 } ``` **402** ```json { "status": "error", "message": "Workspace is out of credits.", "credits_required": 1, "credits_used": 0, "credits_remaining": 0, "upgrade": "/billing" } ``` **429** ```json { "status": "error", "message": "This workspace is limited to 1 parse per second.", "credits_used": 0, "credits_remaining": 59, "retry_after": 1 } ``` **502** ```json { "status": "error", "message": "The model could not extract this document.", "credits_used": 0, "credits_remaining": 59 } ```