Documents API
Receipts, invoices and statements, extracted and linked to payments.
Base URL https://api.ndstill.com/v2. Send Authorization: Bearer with a key, Ndstill-Version: 2026-11-01, and an Idempotency-Key on every POST. Conventions, scopes and errors are in the API overview and Errors and decline reasons. Examples come from the mock backend; the shapes are the TypeScript types in packages/api.
Create a document#
/v2/documents- filenamestringrequired
- kindstring enumrequired
"invoice""statement""receipt" - size_bytesnumber
- content_typestring
- idId
- object"document"
- org_idId
- created_atTimestamp
- updated_atTimestampoptional
- test_modebooleanoptional
True for test-mode objects (simulations, sandbox).
- kindstring enum
"invoice""statement""receipt" - sourcestring enum
"email""upload""accept""provider" - filenamestring
- extractedobject
4 fields
- vendorstring | null
- totalMoney | null
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- dateDateOnly | null
- invoice_numberstring | null
- confidencenumber
Overall extraction confidence, 0–1.
- field_confidenceobjectoptional
Confidence per extracted field, 0–1 (missing = not found).
4 fields
- totalnumberoptional
- vendornumberoptional
- datenumberoptional
- invoice_numbernumberoptional
- intent_idId | null
- statusstring enum
"processing""linked""unlinked""needs_review" - size_bytesnumberoptional
- content_typestringoptional
- emailobject | nulloptional
Email-in only: who sent it and the subject line.
2 fields
- fromstring
- subjectstring
- suggested_intentobject | nulloptional
A payment that looks like this document (not linked yet).
5 fields
- idId
- labelstring
- amountMoney
An amount: integer minor units + asset.
Money: 2 fields
- amountnumber
- assetAssetCode
"USD""USDC""EUR""GBP"
- confidencenumber
- reasonsstring[]
- reviewed_byRef | nulloptional
Who confirmed the extracted fields.
Ref: 2 fields
- idId
- namestring
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/documents" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"filename": "example",
"kind": "invoice"
}'{
"object": "error",
"type": "invalid_request",
"code": "invalid_request",
"message": "example isn't a PDF, image or email file.",
"request_id": "req_9ee139169f1f29b31a0e",
"fields": {
"filename": "Use PDF, PNG, JPG, HEIC or EML"
}
}The mock answered this sample with an error; its message says why. Adjust the request in Try it below.
Runs against the in-browser mock with a test key. Nothing leaves your browser.
List documents#
/v2/documents- kindstring enum
"invoice""statement""receipt" - statusstring enum
"processing""linked""unlinked""needs_review" - cursorstring
- limitnumber
1–200, default 50.
- qstring
Free-text search over names, ids and descriptors.
- sortstring
Sort field, prefix "-" for descending ("-created_at" is the default).
- created_gteTimestamp
created_at >= (ISO).
- created_lteTimestamp
created_at <= (ISO).
Returns a list envelope: object "list", data[], has_more, next_cursor (pass it back as cursor) and total when cheap to count. Items:
The same Document object as Create a document.
- 400invalid_request
A query parameter is invalid.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/documents?limit=2" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"{
"object": "list",
"data": [
{
"id": "doc_01M7WBNRA23X26E2W32SN8QYXE",
"object": "document",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-20T11:32:39.362Z",
"kind": "receipt",
"source": "provider",
"filename": "United-Airlines-receipt-9.pdf",
"extracted": {
"vendor": "United Airlines",
"total": {
"amount": 74166,
"asset": "USD"
},
"date": "2026-11-19",
"invoice_number": null
},
"confidence": 0.86,
"intent_id": "pi_01M7SS91A22HD2N9DHBFWQGAD0",
"status": "linked",
"field_confidence": {
"vendor": 0.94,
"total": 0.92,
"date": 0.94
},
"size_bytes": 683532,
"content_type": "application/pdf",
"email": null,
"reviewed_by": null,
"suggested_intent": null
},
{
"id": "doc_01M7SNX82NSY8SAZVX16YNWQZE",
"object": "document",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-19T16:33:47.349Z",
"kind": "receipt",
"source": "accept",
"filename": "Google-Ads-receipt-5.pdf",
"extracted": {
"vendor": "Google Ads",
"total": {
"amount": 121710,
"asset": "USD"
},
"date": "2026-11-18",
"invoice_number": null
},
"confidence": 0.87,
"intent_id": "pi_01M7Q3GH2N8T9CZWME9W4GB2K0",
"status": "linked",
"field_confidence": {
"vendor": 0.99,
"total": 0.84,
"date": 0.87
},
"size_bytes": 219613,
"content_type": "application/pdf",
"email": null,
"reviewed_by": null,
"suggested_intent": null
}
],
"has_more": true,
"next_cursor": "Mg==",
"total": 42
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Retrieve a document#
/v2/documents/{id}- idIdrequired
A prefixed ID from this org.
The same Document object as Create a document.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/documents/doc_01M7WBNRA23X26E2W32SN8QYXE" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"{
"id": "doc_01M7WBNRA23X26E2W32SN8QYXE",
"object": "document",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-20T11:32:39.362Z",
"kind": "receipt",
"source": "provider",
"filename": "United-Airlines-receipt-9.pdf",
"extracted": {
"vendor": "United Airlines",
"total": {
"amount": 74166,
"asset": "USD"
},
"date": "2026-11-19",
"invoice_number": null
},
"confidence": 0.86,
"intent_id": "pi_01M7SS91A22HD2N9DHBFWQGAD0",
"status": "linked",
"field_confidence": {
"vendor": 0.94,
"total": 0.92,
"date": 0.94
},
"size_bytes": 683532,
"content_type": "application/pdf",
"email": null,
"reviewed_by": null,
"suggested_intent": null
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Get the document inbox#
/v2/documents/inbox- object"document_inbox"
- addressstring
- allowed_sendersstring[]
Senders whose mail is accepted; empty = anyone at the org's domains.
- received_30dnumber
- auto_linked_ratenumber
Share of received documents linked to a payment without a person, 0–1.
- last_received_atTimestamp | null
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X GET "https://api.ndstill.com/v2/documents/inbox" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01"{
"object": "document_inbox",
"address": "receipts+acme-robotics@in.ndstill.example",
"allowed_senders": [
"*@acme-robotics.example"
],
"received_30d": 5,
"auto_linked_rate": 0.6,
"last_received_at": "2026-11-11T01:59:29.652Z"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Link a document to a payment#
/v2/documents/{id}/link- idIdrequired
A prefixed ID from this org.
- intent_idIdrequired
The same Document object as Create a document.
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/documents/doc_01M7WBNRA23X26E2W32SN8QYXE/link" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"intent_id": "pi_01M82XPRNF89TFZB3MJVVT4NCF"
}'{
"id": "doc_01M7WBNRA23X26E2W32SN8QYXE",
"object": "document",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-20T11:32:39.362Z",
"kind": "receipt",
"source": "provider",
"filename": "United-Airlines-receipt-9.pdf",
"extracted": {
"vendor": "United Airlines",
"total": {
"amount": 74166,
"asset": "USD"
},
"date": "2026-11-19",
"invoice_number": null
},
"confidence": 0.86,
"intent_id": "pi_01M82XPRNF89TFZB3MJVVT4NCF",
"status": "linked",
"field_confidence": {
"vendor": 0.94,
"total": 0.92,
"date": 0.94
},
"size_bytes": 683532,
"content_type": "application/pdf",
"email": null,
"reviewed_by": null,
"suggested_intent": null,
"updated_at": "2026-11-23T00:43:13.588Z"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Review an extracted document#
/v2/documents/{id}/review- idIdrequired
A prefixed ID from this org.
- extractedobjectrequired
4 fields
- vendorstring | null
- totalMoney | null
An amount: integer minor units + asset.
Money: 2 fields
- amountnumberrequired
- assetAssetCoderequired
"USD""USDC""EUR""GBP"
- dateDateOnly | null
- invoice_numberstring | null
The same Document object as Create a document.
- 400invalid_request
A field is missing or invalid; fields names each one.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/documents/doc_01M7WBNRA23X26E2W32SN8QYXE/review" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"extracted": {}
}'{
"id": "doc_01M7WBNRA23X26E2W32SN8QYXE",
"object": "document",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-20T11:32:39.362Z",
"kind": "receipt",
"source": "provider",
"filename": "United-Airlines-receipt-9.pdf",
"extracted": {
"vendor": "United Airlines",
"total": {
"amount": 74166,
"asset": "USD"
},
"date": "2026-11-19",
"invoice_number": null
},
"confidence": 1,
"intent_id": "pi_01M82XPRNF89TFZB3MJVVT4NCF",
"status": "linked",
"field_confidence": {
"vendor": 0.94,
"total": 0.92,
"date": 0.94
},
"size_bytes": 683532,
"content_type": "application/pdf",
"email": null,
"reviewed_by": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"suggested_intent": null,
"updated_at": "2026-11-23T00:43:13.594Z"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.
Unlink a document#
/v2/documents/{id}/unlink- idIdrequired
A prefixed ID from this org.
The same Document object as Create a document.
- 401authentication
The key or token is missing, expired or revoked.
- 403permission
The key's scopes or the person's role don't allow this.
- 404not_found
No object with that id in this org.
- 409conflict
The object changed or already exists, or the Idempotency-Key was reused with a different body.
- 429rate_limited
Slow down; retry after the Retry-After header.
curl -X POST "https://api.ndstill.com/v2/documents/doc_01M7WBNRA23X26E2W32SN8QYXE/unlink" \
-H "Authorization: Bearer $NDSTILL_API_KEY" \
-H "Ndstill-Version: 2026-11-01" \
-H "Idempotency-Key: $(uuidgen)"{
"id": "doc_01M7WBNRA23X26E2W32SN8QYXE",
"object": "document",
"org_id": "org_A99F918124609C9DAAACB209D8",
"created_at": "2026-11-20T11:32:39.362Z",
"kind": "receipt",
"source": "provider",
"filename": "United-Airlines-receipt-9.pdf",
"extracted": {
"vendor": "United Airlines",
"total": {
"amount": 74166,
"asset": "USD"
},
"date": "2026-11-19",
"invoice_number": null
},
"confidence": 1,
"intent_id": null,
"status": "unlinked",
"field_confidence": {
"vendor": 0.94,
"total": 0.92,
"date": 0.94
},
"size_bytes": 683532,
"content_type": "application/pdf",
"email": null,
"reviewed_by": {
"id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
"name": "Dana Whitfield"
},
"suggested_intent": null,
"updated_at": "2026-11-23T00:43:13.596Z"
}Runs against the in-browser mock with a test key. Nothing leaves your browser.