APIs & SDKs

Submit a document, receive verified fields with confidence and provenance, and export the audit trail, all through consistent, predictable interfaces. The API is the primary way to build on Staple, and it is designed so that the same field shape comes back everywhere, whether you pulled it, received it on a webhook, or exported it in bulk. This page covers the request and response model, the ingestion channels, the review loop, and the open-source SDK for verifying the trust record.

The Field Object

A field comes back with its value, a confidence score, its provenance, and a label for whether it was extracted, inferred, mapped, or set. That last distinction is a deliberate safety property: an extracted value was read off the document, an inferred value was derived from other data, a mapped value was resolved against your master data, and a set value was written by a rule. Inferred fields carry no confidence score by design, so a judgment is never returned to your code as if it were a fact read off the page. Building against that one shape is what makes the rest of the Connect and Operate API predictable.

Core Operations

• Submit a document, then poll for completion or receive a webhook the moment it is final.

• Retrieve structured fields and line-item tables, cleaned and standardized by the intelligent tables engine.

• Trigger redaction with POST /v2/redaction/document and a follow-up GET to track the redacted output.

• Export audit logs as CSV or JSON, and pull results in bulk rather than one document at a time.

• Manage models and queues programmatically, so a new document type is an API call, not a support ticket.

Ingest Beyond The API

Not every document arrives as an API call, so ingestion is not limited to one. Staple accepts documents over S3, SFTP, email, shared drives, portals, and file sync, in addition to direct API upload, and every route lands in the same processing pipeline and returns the same structured result. A team can therefore keep sending documents the way its business already does while an integration reads the clean output over the API. See the data extraction engine behind that response.

The Review Loop

Any field that lands below the configurable confidence threshold, 0.9 by default, puts the document into review rather than passing it downstream as if it were certain. The API exposes that state, so your integration can see that a document is waiting on a human, and the final webhook fires only once the document is resolved. Your code therefore always knows the difference between data that is still provisional and data that is final, which is the distinction most integrations get wrong when they treat every response as complete.

The Open-Source Verification SDK

The trust record Staple attaches is not a closed format you have to take on faith. The Metastructured Data SDK is open source and published at github.com/msd-protocol. It signs a dictionary or a file into a self-contained, cryptographically signed envelope, or embeds the proof inside the file, and it verifies both offline, with no callback to any server. That means a receiving system can confirm a Staple output has not been altered, and that its source hash and residency are consistent, entirely on its own. The SDK is early stage and described as such on the protocol site, so read the roadmap before taking a hard dependency; the commercial platform is production and audited, and the two are not at parity. The open standard is documented under Open Trust Infrastructure.

Formats And Regions

Results export as structured data, CSV, XLSX, JSON audit logs, UBL or XML for e-invoicing, or redacted PDF. Regional endpoints span Singapore, the EU, the US, and China, with residency enforced at the egress boundary rather than left to a configuration flag, so where your data is processed and held follows the jurisdiction it belongs to. Access is governed by SSO and role-based access control, including who may manage models, webhooks, and exports.

What This Does Not Do

Staple gives you verified data and the interfaces to consume it. The document-processing side is API-first rather than a low-level OCR library you assemble yourself, and the open SDK covers verification of the trust envelope, not the extraction pipeline, which the platform runs for you. You integrate a capability, not a toolkit you maintain.

Proven In Production

A global investment bank integrated Staple over the API with SSO, processing documents in seconds after retiring more than 800 templates. A global insurance and wealth provider ingests through S3 and SFTP with API-driven redaction across millions of documents. Across deployments, Staple runs for Fortune 100 companies and global financial institutions in 60 countries at a 100% deployment success rate.

Read The Docs

See request and response shapes in the developer documentation, or request sandbox access through our team.

Related Topics

See Staple process your documents

Book a 30-minute demo with a document processing specialist.

Book a Demo

Not ready yet?

Take your time to decide.

Read the foodpanda case study