Skip to content
ndStill is in development. These docs describe the v2 API as designed; the SDKs and the hosted MCP server are previews and not generally available.
Docs

Documents API

Receipts, invoices and statements, extracted and linked to payments.

7 endpointsGenerated from the typed registry

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#

POST/v2/documents
Request body DocumentCreate
  • filenamestringrequired
  • kindstring enumrequired
    "invoice""statement""receipt"
  • size_bytesnumber
  • content_typestring
Response Document
  • 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
Errors
  • 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.

Example from the mock backend
Request
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"
  }'
Response 400
{
  "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.

Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

List documents#

GET/v2/documents
Query parameters all optional
  • 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).

Response list of Document

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.

Errors
  • 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.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/documents?limit=2" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "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
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Retrieve a document#

GET/v2/documents/{id}
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response Document

The same Document object as Create a document.

Errors
  • 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.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/documents/doc_01M7WBNRA23X26E2W32SN8QYXE" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "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
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Get the document inbox#

GET/v2/documents/inbox
Response DocumentInbox
  • 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
Errors
  • 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.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/documents/inbox" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "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"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Link a document to a payment#

POST/v2/documents/{id}/link
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Request body JSON
  • intent_idIdrequired
Response Document

The same Document object as Create a document.

Errors
  • 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.

Example from the mock backend
Request
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"
  }'
Response 200
{
  "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"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Review an extracted document#

POST/v2/documents/{id}/review
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Request body DocumentReview
  • 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
Response Document

The same Document object as Create a document.

Errors
  • 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.

Example from the mock backend
Request
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": {}
  }'
Response 200
{
  "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"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Unlink a document#

POST/v2/documents/{id}/unlink
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response Document

The same Document object as Create a document.

Errors
  • 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.

Example from the mock backend
Request
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)"
Response 200
{
  "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"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.