Documents

Upload a document

post/documents

Request

  • Base URL: https://klaaro.ai/api/v1
  • URL: https://klaaro.ai/api/v1/documents
  • Auth: HTTP bearer

Headers

Idempotency-Keystring uuid

Client-generated UUID. If a request with this key was already processed within 24 h, the original response is returned without re-processing. Response includes Idempotency-Replay: true header when served from cache.

Request body

datasetIdstring uuid required

Dataset UUID (from GET /datasets).

urlstring uri required

Public URL to fetch and ingest.

fixedClassstring

Lock class to this slug (e.g. invoice). Skips the classification step.

Response

Document created

idstring uuid required
datasetIdstring uuid required

UUID of the dataset this document belongs to

datasetSlugstring required

Slug of the dataset this document belongs to

filenamestring required
fileTypestring required
fileSizeinteger required
status'queued' | 'processing' | 'completed' | 'failed' | 'cancelled' required
currentStep'ocr' | 'classify' | 'defineClass' | 'extract' | 'validate' | 'approve' required

Pipeline step identifier — used in currentStep (document state) and fromStep (re-run trigger).

errorstring nullable
ingestSourceDisplaystring nullable
createdAtstring date-time required
updatedAtstring date-time required

Example response

{
  "id": "b6d2a7f6-0f44-44c8-8cc2-1d2e2bd7a5d5",
  "datasetId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "datasetSlug": "invoices-2026",
  "filename": "invoice_2026-0001.pdf",
  "fileType": "application/pdf",
  "fileSize": 248312,
  "status": "completed",
  "currentStep": "extract",
  "class": {
    "slug": "invoice",
    "name": "Invoice"
  },
  "error": null,
  "ingestSourceDisplay": "Upload",
  "pipeline": {
    "lastRunId": null,
    "lastFinishedAt": null,
    "fromStep": null
  },
  "createdAt": "2026-05-22T12:58:00Z",
  "updatedAt": "2026-05-22T13:00:00Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.