For AI agents
Canonical "how to use this API" reference for automated tools and AI agents. Use the Agent API (/agent/*), it's purpose-built for machine clients: PAT auth, presigned-S3 upload, clean JSON output, and an MCP-compatible tool dispatcher.
Stable machine-readable endpoints
- OpenAPI 3.0:
/api-docs/openapi.json(also at/api-docs/.well-known/openapi.json) - LLM hint file:
/api-docs/llms.txt - MCP tool list:
GET /api/v1/agent/mcp/tools(runtime-discoverable)
Auth + base URL
Generate a PAT in the web UI (Account → API). Tokens look like dcp_<43-char base64url> and are shown once at creation.
BASE="https://www.docuclipper.com/api/v1"
PAT="dcp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# Every request:
Authorization: Bearer $PATCanonical workflow (bank statement)
Production agents should use webhooks. Polling exists for tests and demos, but at scale it wastes compute on both sides and triggers our rate limits.
- One-time setup: subscribe to job events:
POST /agent/webhookswith{ url, events: ["bank_statement.extraction.completed"] }. Save the signing secret returned in the response, it is shown only once and you'll need it to verify each event. - Get a presigned upload URL:
POST /agent/documents/upload-urlwith{ filename, mimetype } - Upload bytes to S3:
PUTthe file to the returnedurl.Content-Typemust equal themimetypeyou sent. - Create a job:
POST /agent/jobswith{ documents: [<id>] }(bank-mode + v2 are defaults). - Receive the result: your webhook fires when the job hits
Succeeded; verify theX-DocuClipper-Signatureheader, thenGET /agent/jobs/<id>/datafor the structured payload (or/transactionsfor the flat per-row view).
Polling fallback (only for dev/tests, never production): GET /agent/jobs/<id>?waitSeconds=40 until status === "Succeeded". Each call returns as soon as the job is done, or after 40 seconds, with stage, progress and etaSeconds; sustained tight polling will be rate-limited.
cURL example (production: webhook-driven)
# 1. ONE-TIME: subscribe to job-completion events
RESP=$(curl -s -X POST "$BASE/agent/webhooks" \
-H "Authorization: Bearer $PAT" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/hook","events":["bank_statement.extraction.completed"]}')
SECRET=$(echo "$RESP" | jq -r .secret) # store this, shown only once
# 2. PER-JOB: get presigned upload URL
RESP=$(curl -s -X POST "$BASE/agent/documents/upload-url" \
-H "Authorization: Bearer $PAT" \
-H "Content-Type: application/json" \
-d '{"filename":"jan.pdf","mimetype":"application/pdf"}')
URL=$(echo "$RESP" | jq -r .url)
DOC_ID=$(echo "$RESP" | jq -r .document.id)
# 3. PUT the file directly to S3
curl -X PUT "$URL" -H "Content-Type: application/pdf" --data-binary @jan.pdf
# 4. Create the job, your webhook fires when it completes
JOB_ID=$(curl -s -X POST "$BASE/agent/jobs" \
-H "Authorization: Bearer $PAT" \
-H "Content-Type: application/json" \
-d "{\"documents\":[$DOC_ID]}" | jq -r .jobId)
# 5. In your webhook handler: verify X-DocuClipper-Signature, then fetch:
curl -s "$BASE/agent/jobs/$JOB_ID/data" -H "Authorization: Bearer $PAT" | jqcURL example (dev/test: polling)
# Use polling only when you can't receive webhooks (local dev, scripts, demos).
# Steps 2-4 same as above, then:
# waitSeconds=40: each call returns as soon as the job is done, or after 40 s.
while true; do
STATUS=$(curl -s "$BASE/agent/jobs/$JOB_ID?waitSeconds=40" -H "Authorization: Bearer $PAT" | jq -r .status)
[[ "$STATUS" == "Succeeded" ]] && break
[[ "$STATUS" == "Failed" || "$STATUS" == "OutOfCredits" ]] && exit 1
done
curl -s "$BASE/agent/jobs/$JOB_ID/data" -H "Authorization: Bearer $PAT" | jqJob types
The Agent API covers bank and credit card statements, check images, invoices, and tax forms. They all use the same flow: create the job with the right jobType, then call GET /agent/documents/<documentId>/data, it auto-dispatches by type.
- Bank statements / check images: defaults, just send
{ documents: [<id>] }. UseGET /agent/jobs/<id>/transactionsfor the flat per-row view (filtered to real transactions; pass?includeRaw=truefor every OCR row), orGET /agent/jobs/<id>/datafor the groupeddocumentId → account → bankMode.transactions[]shape. - Invoices:
{ documents: [<id>], jobType: "Invoice" }, thenGET /agent/jobs/<id>/datareturns the invoice payload keyed by documentId. - Tax forms (W-2, 1099, and similar):
{ documents: [<id>], jobType: "Form" }, thenGET /agent/documents/<documentId>/datareturns the extracted fields. - Other types (generic OCR, custom templates): not in the agent surface, use the web UI or the legacy
POST /protected/jobendpoint.
Finding documents you did not upload
Every endpoint above is keyed by a jobId, and a job id only exists if you created the job. Documents that arrive another way, through a connected Box, Dropbox, Google Drive, or OneDrive folder, an ingestion email address, or a person working in the web UI, have no job id you can guess. Reach those by project.
GET /agent/projects, the projects your token can read, with their parent folder.GET /agent/projects/<projectId>/documents, the documents in a project, newest first, with per-documentstatus,source,transactionCount,isReconciled, and a compactverificationverdict. Pages withlimit(max 200) andoffset.GET /agent/documents/<documentId>, one document and the project it belongs to.GET /agent/documents/<documentId>/transactions, the flat per-row view.?format=csvstreams a CSV download.GET /agent/documents/<documentId>/data, the structured payload for that document.
Prefer these over the job-keyed equivalents. Extracted rows are stored per document, so /agent/documents/<id>/transactions is the direct read. The /agent/jobs/<id>/* endpoints remain supported for existing integrations.
Verification: can you trust these transactions?
Every bank and credit card statement is checked against its own printed balances: for each statement period, the opening balance plus the extracted transactions must arrive at the printed closing balance (for a credit card, the balance owed rises with purchases). Every statement response carries one top-level verification object with the verdict, so an agent can decide what to do without reading the rows. Branch on verification.status:
verified, every statement period was checked and ties out. Use the transactions as they are.needs_review, a period does not tie out, or some periods tie out and others could not be checked (reasonsome_periods_unchecked). Route it to a person withperiodsToReview: each entry names the account, dates,pagesanddifference.unverifiable, no period could be checked. Treat the transactions as unchecked and tell the user why (reasonanduncheckedReasons).
The object also carries message (one sentence to relay to the user), periodsChecked, periodsVerified, periodsNeedingReview, periodsUnchecked and, for a response that covers several documents (for example a file converted in parts), documents with the verdict per document.
{
"documentId": 12,
"verification": {
"status": "needs_review",
"reason": "balances_do_not_match",
"message": "1 statement period of 1 period does not tie out to the printed balances: the opening balance plus the transactions does not equal the printed closing balance. Review the listed periods (pages and difference) before relying on these transactions.",
"periodsChecked": 1, "periodsVerified": 0, "periodsNeedingReview": 1, "periodsUnchecked": 0,
"periodsToReview": [{ "documentId": 12, "account": "****6789", "startDate": "2026-10-01", "endDate": "2026-10-31",
"pages": { "first": 2, "last": 2 }, "difference": 50, "reviewReason": "balances_do_not_match" }]
},
"reconciliation": {
"periods": 1, "reconciled": 0, "unreconciled": 1, "unchecked": 0, "allReconciled": false,
"statementPeriods": [{
"documentId": 12, "account": "****6789", "startDate": "2026-10-01", "endDate": "2026-10-31",
"startBalance": 100, "endBalance": 200, "isReconciled": false,
"verification": "needs_review", "difference": 50, "computedEndBalance": 150,
"pages": { "first": 2, "last": 2 }, "transactionCount": 2, "reviewReason": "balances_do_not_match"
}]
},
"count": 2,
"transactions": [ ... ]
}A statement that ties out, and one that could not be checked:
"verification": { "status": "verified",
"message": "The statement period ties out to the printed opening and closing balances.",
"periodsChecked": 1, "periodsVerified": 1, "periodsNeedingReview": 0, "periodsUnchecked": 0 }
"verification": { "status": "unverifiable", "reason": "no_printed_balances",
"message": "The transactions could not be checked against printed balances: the file prints no opening or closing balance (for example an account-activity list); entering the period start and end balance checks the period.",
"periodsChecked": 0, "periodsVerified": 0, "periodsNeedingReview": 0, "periodsUnchecked": 1,
"uncheckedReasons": ["no_printed_balances"] }Per statement period
Each entry of reconciliation.statementPeriods (and of statementPeriods on GET /agent/documents/<id>) keeps documentId, account, startDate, endDate, startBalance, endBalance and isReconciled, and adds:
verification:verified,needs_revieworunverifiable.difference: the printed closing balance minus the closing balance the transactions arrive at.0when it ties out,nullwhen the period was not checked.computedEndBalance: the closing balance the transactions arrive at.pages:{ first, last }(1-based), the pages the period's transactions are on.transactionCount: the transactions in the period.reviewReason(failed periods):balances_do_not_match,rows_outside_statement_periods(the file holds transactions outside the periods that tie out) orfailed_consistency_check(the transactions add up but another check failed, for example dates after the upload date).uncheckedReason(periods not checked):no_printed_balances(the file prints no balance),pages_missing(statement pages with the balances are not in the upload),balances_unreadable(the balances are printed but could not be read; when only one was not read the verdict message names it; entering the period's start and end balance checks it),pages_excluded(pages were left out of the conversion, so the balances were not read),not_a_statement,still_processing,waiting_for_pages,extraction_failed,no_statement_periods_found,summary_accountornot_checked(documents converted before per-period reasons were added reportnot_checkedwhere they used to reportno_printed_balances).
Where it appears
GET /agent/documents/<id>:verificationandstatementPeriods.GET /agent/documents/<id>/transactions,GET /agent/documents/<id>/dataandGET /agent/jobs/<id>/transactions:verificationandreconciliation(periods,reconciled,unreconciled,unchecked,allReconciled,statementPeriods).GET /agent/jobs/<id>:verificationfor bank and credit card jobs.GET /agent/projects/<id>/documents: a compactverificationon each document (status, reason, message and counts).- Response header
X-DocuClipper-Verification(verified,needs_revieworunverifiable) on the/transactionsand/dataendpoints, so a CSV download, and the documentId-keyed body ofGET /agent/jobs/<id>/data, still carry the verdict. - MCP:
convert_bank_statement,download_transactions/get_transactions,get_document_transactions,get_documentandget_job_statusreturn the fullverification;list_documentsandlist_recent_documentsreturn the compact one per document.
Invoices and receipts have their own subtotal + tax = total consistency check (get_invoices); a document view of an invoice shows verification unverifiable with reason not_a_statement.
RESP=$(curl -s "$BASE/agent/documents/$DOC_ID/transactions" -H "Authorization: Bearer $PAT")
case $(echo "$RESP" | jq -r .verification.status) in
verified) echo "$RESP" | jq .transactions > rows.json ;; # use as is
needs_review) echo "$RESP" | jq .verification.periodsToReview ;; # send to a person
unverifiable) echo "$RESP" | jq -r .verification.message ;; # tell the user why
esacWebhooks (avoid polling)
Subscribe to push notifications instead of polling /agent/jobs/<id>. The signing secret is returned exactly once at creation, store it immediately. We only keep a SHA-256 hash; lost secrets must be rotated via POST /agent/webhooks/<id>/regenerate-secret.
# 1. Discover available event types
curl -H "Authorization: Bearer $PAT" "$BASE/agent/webhooks/events"
# 2. Subscribe (capture the one-time secret)
RESP=$(curl -s -X POST "$BASE/agent/webhooks" \
-H "Authorization: Bearer $PAT" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/hook","events":["bank_statement.extraction.completed"]}')
SECRET=$(echo "$RESP" | jq -r .secret) # store this securely, shown once
# 3. Send a test event to verify your endpoint
WEBHOOK_ID=$(echo "$RESP" | jq -r .id)
curl -X POST "$BASE/agent/webhooks/$WEBHOOK_ID/test" \
-H "Authorization: Bearer $PAT"
# 4. Inspect delivery attempts
curl "$BASE/agent/webhooks/$WEBHOOK_ID/deliveries" \
-H "Authorization: Bearer $PAT"Verify each incoming event with HMAC-SHA256 over the raw request body using your stored secret. The signature is in the X-DocuClipper-Signature header.
MCP (Model Context Protocol)
DocuClipper is a remote MCP server at https://www.docuclipper.com/api/v1/agent/mcp (JSON-RPC 2.0 over Streamable HTTP: initialize, tools/list, tools/call, ping; stateless). There is no package to install. ChatGPT and Claude connect to it as a custom connector with OAuth sign-in (see DocuClipper for ChatGPT and Claude); your own MCP clients and agents send a Personal Access Token as Authorization: Bearer dcp_.... Full reference: Connect DocuClipper to AI agents (MCP).
MCP client config (remote server)
For a client that takes a remote server URL with headers (for example Cursor's .cursor/mcp.json):
{
"mcpServers": {
"docuclipper": {
"url": "https://www.docuclipper.com/api/v1/agent/mcp",
"headers": {
"Authorization": "Bearer dcp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}Available tools
Clients discover tools at runtime (tools/list), so you always get the live set. They include:
convert_bank_statement, one-shot: takes a base64 PDF, uploads, extracts and returns transactions (json or csv) when the file converts within about 35 seconds. A longer one, such as a scanned statement or a long file, returns itsjobIdat once withetaSecondsand anextstep (wait: "full"waits up to 45 seconds instead). The path most agents want.download_transactions, fetch transactions from any completedjobId(json or csv, max 10000 rows).get_transactions, alias ofdownload_transactions.upload_url, async building block: presigned S3 PUT URL.convert_document, async: enqueue an extraction job from already-uploadeddocumentIds.get_job_status, a job's status,stage,progress(pages read of pages total),etaSeconds, transaction count and, for statements, theverificationverdict. PasswaitSeconds: 40to wait for the job to finish instead of calling again right away.list_projects, the projects on the account this token can read. Start here to reach documents that were not uploaded through this API.list_documents, the documents in a project with their extraction status, page count, transaction count, whether the statement reconciled, and a compactverificationverdict.get_document, status and summary for one document, with itsverificationverdict and every statement period.get_document_transactions, the extracted rows for one document (json or csv). Preferred overdownload_transactions, which only reaches jobs this token created.list_recent_documents, the documents you uploaded most recently, newest first.convert_invoiceandget_invoices, invoices, bills and receipts: header fields, line items and the subtotal + tax = total consistency check.get_fraud_report, the 0-100 authenticity score for a converted statement, invoice or pay stub, with each signal and its confidence (Business and Enterprise plans and the free trial).get_upload_link, a DocuClipper upload page for clients that cannot pass files to a tool.
For files larger than ~10MB use the async path: upload_url → PUT → convert_document → get_job_status → download_transactions.
Progress: send params._meta.progressToken on a tools/call with Accept: application/json, text/event-stream and the answer streams notifications/progress while the tool waits on a job (for example "Job 3007982: reading page 2 of 4"), then the result as the last event. Without a token the answer is plain JSON.
Structured output
convert_bank_statement, convert_document, convert_invoice, download_transactions, get_transactions, get_document_transactions, get_document, get_invoices, get_job_status, list_documents and list_recent_documents declare an outputSchema in tools/list and return their result as structuredContent (MCP spec 2025-06-18), the same object as the JSON text block. Read structuredContent.verification.status directly instead of parsing text. The JSON-over-HTTP listing GET /agent/mcp/tools includes the same outputSchema.
Direct HTTP (custom clients / cURL)
If your runtime only makes plain HTTP calls (serverless functions, custom agent runtimes), the same tool registry is available as a JSON-over-HTTP shape. This is the underlying transport the stdio shim talks to.
# List all tools
curl -H "Authorization: Bearer $PAT" "$BASE/agent/mcp/tools"
# Execute a tool (params shape comes from inputSchema)
curl -X POST "$BASE/agent/mcp/tools/convert_bank_statement" \
-H "Authorization: Bearer $PAT" \
-H "Content-Type: application/json" \
-d '{"filename":"jan.pdf","mimetype":"application/pdf","fileBase64":"..."}'Fraud signals
For bank-statement fraud features, use GET /protected/document/<documentId>/fraudSignals after extraction completes. (Fraud endpoints are currently only on the legacy API.)
Legacy /protected/* API
Existing customers continue to use the JWT-authenticated /protected/* endpoints (multipart upload, POST /protected/job, POST /protected/job/<id>/export). Fully supported , but new integrations should use /agent/*.
API changes
- November 2026.
uncheckedReasonis worked out per statement period. New valuespages_missing,balances_unreadableandsummary_account.no_printed_balancesis returned only when the file prints no balance label. Documents converted before this change reportnot_checkedwhere they reportedno_printed_balances; converting them again gives the specific reason. Treat a value you don't recognise asnot_checked.