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

Exports API

Scheduled and one-off exports for month-end close and auditors.

6 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 an export#

POST/v2/exports
Request body ExportCreate
  • namestring
  • kindstring enumrequired
    "audit""receipts""month_close""spend""journal"
  • formatstring enumrequired
    "pdf""json""csv""xlsx"
  • periodobjectrequired
    2 fields
    • fromDateOnlyrequired
    • toDateOnlyrequired
  • schedulestring enum
    "none""weekly""monthly"
Response Export
  • idId
  • object"export"
  • org_idId
  • created_atTimestamp
  • updated_atTimestampoptional
  • test_modebooleanoptional

    True for test-mode objects (simulations, sandbox).

  • namestring
  • kindstring enum
    "audit""receipts""month_close""spend""journal"
  • formatstring enum
    "pdf""json""csv""xlsx"
  • periodobject
    2 fields
    • fromDateOnly
    • toDateOnly
  • schedulestring enum
    "none""weekly""monthly"
  • statusstring enum
    "failed""building""ready""queued"
  • rowsnumber | null
  • urlstring | null
  • requested_byRef

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • next_run_atTimestamp | nulloptional

    Scheduled exports: when the next one runs.

  • size_bytesnumber | nulloptional
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/exports" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Docs month-end",
    "kind": "journal",
    "format": "csv",
    "period": "last_month"
  }'
Response 400
{
  "object": "error",
  "type": "invalid_request",
  "code": "invalid_request",
  "message": "Some fields need fixing.",
  "request_id": "req_40defe565777c6dfe1fa",
  "fields": {
    "period": "Pick a period."
  }
}

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 exports#

GET/v2/exports
Query parameters all optional
  • kindstring enum
    "audit""receipts""month_close""spend""journal"
  • 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 Export

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 Export object as Create an export.

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/exports?limit=2" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "object": "list",
  "data": [
    {
      "id": "exp_01M7XRX8ME2GV2KV0RZYQWJ2RR",
      "object": "export",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-11-21T00:43:11.374Z",
      "name": "Receipts archive",
      "kind": "receipts",
      "format": "json",
      "period": {
        "from": "2026-10-22",
        "to": "2026-11-21"
      },
      "schedule": "none",
      "status": "ready",
      "rows": 3997,
      "url": "/demo/exports/receipts.json",
      "requested_by": {
        "id": "usr_01KBNZCZMEJ4J4XDKT3YA99REX",
        "name": "Elena Petrova"
      },
      "next_run_at": null,
      "size_bytes": 471646
    },
    {
      "id": "exp_01M7KFACME9WGK6A4Q2BRKXJ46",
      "object": "export",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-11-17T00:43:11.374Z",
      "name": "Spend by agent",
      "kind": "spend",
      "format": "csv",
      "period": {
        "from": "2026-10-18",
        "to": "2026-11-17"
      },
      "schedule": "weekly",
      "status": "ready",
      "rows": 1573,
      "url": "/demo/exports/spend.csv",
      "requested_by": {
        "id": "usr_01KBNZCZMEJ4J4XDKT3YA99REX",
        "name": "Elena Petrova"
      },
      "next_run_at": "2026-11-30T06:00:00.000Z",
      "size_bytes": 185614
    }
  ],
  "has_more": true,
  "next_cursor": "Mg==",
  "total": 5
}
Try it

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

Retrieve an export#

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

    A prefixed ID from this org.

Response Export

The same Export object as Create an export.

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/exports/exp_01M7XRX8ME2GV2KV0RZYQWJ2RR" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "id": "exp_01M7XRX8ME2GV2KV0RZYQWJ2RR",
  "object": "export",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-21T00:43:11.374Z",
  "name": "Receipts archive",
  "kind": "receipts",
  "format": "json",
  "period": {
    "from": "2026-10-22",
    "to": "2026-11-21"
  },
  "schedule": "none",
  "status": "ready",
  "rows": 3997,
  "url": "/demo/exports/receipts.json",
  "requested_by": {
    "id": "usr_01KBNZCZMEJ4J4XDKT3YA99REX",
    "name": "Elena Petrova"
  },
  "next_run_at": null,
  "size_bytes": 471646
}
Try it

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

Download an export#

GET/v2/exports/{id}/file
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response ExportFile
  • object"export_file"
  • filenamestring
  • content_typestring
  • contentstring
  • notestring | null

    Anything the person should know about the file (e.g. demo format substitution).

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/exports/exp_01M7XRX8ME2GV2KV0RZYQWJ2RR/file" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "object": "export_file",
  "filename": "receipts-archive-2026-10-22-to-2026-11-21.json",
  "content_type": "application/json",
  "content": "[\n  {\n    \"Receipt\": \"rcpt_01M80008ZSNVTYASMM4FFHVWD5\",\n    \"Payment\": \"pi_01M80008ZSNVTYASMM4FFHVWD5\",\n    \"Seller\": \"Anthropic\",\n    \"Agent\": \"Model router\",\n    \"Amount\": \"62.43\",\n    \"Asset\": \"USD\",\n    \"Rail\": \"ai\",\n    \"At\": \"2026-11-21T21:25:38.937Z\"\n  },\n  {\n    \"Receipt\": \"rcpt_01M7ZRQPKNGZBHCZR14E48T3FE\",\n    \"Payment\": \"pi_01M7ZRQPKNGZBHCZR14E48T3FE\",\n    \"Seller\": \"Anthropic\",\n    \"Age…",
  "note": null
}
Try it

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

Run an export again#

POST/v2/exports/{id}/rerun
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response Export

The same Export object as Create an export.

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/exports/exp_01M7XRX8ME2GV2KV0RZYQWJ2RR/rerun" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200
{
  "id": "exp_01M82XPRT7E4941759PGJ20SXM",
  "object": "export",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-23T00:43:13.607Z",
  "name": "Receipts archive",
  "kind": "receipts",
  "format": "json",
  "period": {
    "from": "2026-10-22",
    "to": "2026-11-21"
  },
  "schedule": "none",
  "status": "queued",
  "rows": null,
  "url": null,
  "requested_by": {
    "id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
    "name": "Dana Whitfield"
  },
  "next_run_at": null,
  "size_bytes": null
}
Try it

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

Schedule an export#

POST/v2/exports/{id}/schedule
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Request body JSON
  • schedulestring enumrequired
    "none""weekly""monthly"
Response Export

The same Export object as Create an export.

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/exports/exp_01M7XRX8ME2GV2KV0RZYQWJ2RR/schedule" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "schedule": "none"
  }'
Response 200
{
  "id": "exp_01M7XRX8ME2GV2KV0RZYQWJ2RR",
  "object": "export",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-21T00:43:11.374Z",
  "name": "Receipts archive",
  "kind": "receipts",
  "format": "json",
  "period": {
    "from": "2026-10-22",
    "to": "2026-11-21"
  },
  "schedule": "none",
  "status": "ready",
  "rows": 3997,
  "url": "/demo/exports/receipts.json",
  "requested_by": {
    "id": "usr_01KBNZCZMEJ4J4XDKT3YA99REX",
    "name": "Elena Petrova"
  },
  "next_run_at": null,
  "size_bytes": 471646,
  "updated_at": "2026-11-23T00:43:13.605Z"
}
Try it

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