# Klaaro.ai — Full reference for LLMs > Klaaro.ai takes documents and delivers clarity. Documents in, structured database/Excel out. The name comes from German *klar* (clear, sure, yes). Klaaro turns unstructured documents into clean, queryable structured data via an automatic AI pipeline. This document is the single-file bundle for agents (`llms-full.txt`). For a link index, see https://klaaro.ai/llms.txt. For API-only markdown, see https://klaaro.ai/api/docs.md. ## What Klaaro does You upload documents (PDFs, scans, images, and more). Klaaro parses them with OCR, classifies each document, generates or reuses an extraction schema for that document type, and extracts structured data against that schema. The result is a structured dataset you can review, query with an AI analyst (Insights), and export (CSV, Excel, JSON). The pipeline runs fully automatically end-to-end per document, and every step can be manually overridden and re-run. ## Core concepts - **Team**: The tenant. Users belong to a team. Billing and API keys are scoped to the team. - **Dataset**: A collection of documents with its own pipeline configuration. A team has one or more datasets. Classification config, allowed dynamic labels, and per-classification schemas are all per-dataset. - **Document**: A single uploaded file belonging to a dataset. It moves through the pipeline and ends with extracted structured data. - **Classification / class**: Document type labels (invoice, receipt, contract, etc.). Datasets use a fixed set of labels and/or **dynamic labels** (AI may create new types during ingestion). - **Schema**: A document-level, possibly nested, field definition tied to a class. Stored per class in the dataset config and reused across documents of that type. - **Record**: The structured data extracted from a document against its schema. ## The pipeline (in order) 1. **Document loading / OCR** — Files upload to storage (or URL ingest / connected drives); content is parsed (Mistral OCR) and persisted. 2. **Classification** — Each document is assigned a class per dataset config (fixed and/or dynamic labels). 3. **Schema generation** — A schema is generated or reused for that class and stored in the dataset config. 4. **Data extraction** — Structured fields are extracted against the schema and persisted as records. 5. **Review & export** — Dashboard grid, human-in-the-loop review, Insights, and export via UI or API. ## Manual overrides and re-runs Users can re-classify a document, edit class labels or schemas for a dataset, then re-run from a chosen step (`POST /api/v1/documents/{id}/rerun`). The UI and API support fully automatic runs and manual overrides. ## Insights (AI analyst) Insights is a streaming AI analyst over extracted data (dashboard). It can query data, run Python in isolated EU sandboxes, and render dashboards. Insights is primarily a product UI capability; the public developer surface for agents is `/api/v1`, SDKs, and MCP. ## Developer surface - **API (v1)** — REST under `/api/v1`: datasets, documents, records, approval queue, webhooks. Markdown: https://klaaro.ai/api/docs.md. Interactive: https://klaaro.ai/docs/api/v1. OpenAPI: https://klaaro.ai/api/v1/openapi. - **SDKs** — TypeScript (`npm install klaaro`) and Python (`pip install klaaro`). Docs: https://klaaro.ai/docs/sdk.md. - **MCP** — Hosted MCP at `/api/mcp` for coding agents (list/read/upload/export). Docs: https://klaaro.ai/docs/mcp.md. - **Integrations** — Upload, URL ingest, Google Drive (dashboard), webhooks, n8n. Docs: https://klaaro.ai/docs/integrations.md. - **Quickstart** — Copy-paste recipes: https://klaaro.ai/docs/quickstart.md. ## Hosting and data Klaaro is EU-hosted and built for GDPR compliance. Document OCR uses Mistral; classification, schema generation, and extraction use LLMs. Your documents are not used to train public models. Insights code execution runs in isolated EU sandboxes. ## Key markdown links - Home: https://klaaro.ai/index.html.md - Product: https://klaaro.ai/product.md - Pricing: https://klaaro.ai/pricing.md - Contact: https://klaaro.ai/contact.md - Docs: https://klaaro.ai/docs.md - API Docs: https://klaaro.ai/api/docs - API Docs (Markdown): https://klaaro.ai/api/docs.md - OpenAPI: https://klaaro.ai/api/v1/openapi - SDKs: https://klaaro.ai/docs/sdk.md - MCP: https://klaaro.ai/docs/mcp.md - Integrations: https://klaaro.ai/docs/integrations.md - Terms: https://klaaro.ai/terms.md - Privacy: https://klaaro.ai/privacy.md - Refund: https://klaaro.ai/refund.md - Legal notice: https://klaaro.ai/legal-notice.md --- # Klaaro API (v1) > Klaaro developer API — upload documents, read extracted data, and automate your document pipeline. **Spec version:** 1.0.0 **Base path:** `/api/v1` **Interactive docs:** https://klaaro.ai/docs/api/v1 **OpenAPI JSON:** https://klaaro.ai/api/v1/openapi **This document:** https://klaaro.ai/api/docs.md ## Servers - https://klaaro.ai/api/v1 — Klaaro API v1 ## Authentication All v1 endpoints require an API key: ``` Authorization: Bearer sk_ ``` Create keys under **Team → API keys**. Scopes: `read`, `write`, `export`. Session auth (cookies) is not accepted on `/api/v1`. ## Endpoints - `GET /datasets` — List datasets - `DELETE /datasets/{id}` — Delete dataset - `GET /datasets/{id}` — Get dataset - `GET /datasets/{id}/approval-queue` — List approval queue - `GET /datasets/{id}/classes` — List classes - `GET /datasets/{id}/classes/{class}` — Get class - `GET /datasets/{id}/records` — Get records (JSON) - `GET /datasets/{id}/records-flat` — Get records (flat) - `GET /datasets/{id}/records-nested` — Get records (nested) - `GET /documents` — List documents - `POST /documents` — Upload a document - `DELETE /documents/{id}` — Delete document - `GET /documents/{id}` — Get document - `GET /documents/{id}/records` — Get records (JSON) - `GET /documents/{id}/records-flat` — Get records (flat) - `GET /documents/{id}/records-nested` — Get records (nested) - `POST /documents/{id}/rerun` — Re-run document pipeline - `GET /records-flat/{id}` — Get record (flat) - `GET /records-nested/{id}` — Get record (nested) - `GET /records/{id}` — Get record (JSON) - `GET /records/{id}/approvals` — Get approval events - `GET /records/{id}/comments` — List record-level comments - `GET /records/{id}/field-events` — List field events - `GET /webhooks` — List webhooks - `POST /webhooks` — Create webhook - `DELETE /webhooks/{webhookId}` — Delete webhook - `PATCH /webhooks/{webhookId}` — Update webhook - `POST /webhooks/{webhookId}/rotate-secret` — Rotate signing secret ## Error codes - `not_authenticated` (401) — Authentication required. Provide a valid API key via Authorization: Bearer . - `api_key_required` (401) — This endpoint requires an API key. Session auth is not accepted on /api/v1. - `insufficient_scope` (403) — API key does not have the '' scope required for this action. - `dataset_not_found` (404) — Dataset '' not found or not accessible. - `document_not_found` (404) — Document '' not found. - `record_not_found` (404) — Record '' not found. - `webhook_not_found` (404) — Webhook '' not found. - `class_not_found` (404) — Class '' not found in this dataset. - `not_found` (404) — not found. - `validation_error` (400) — is invalid. - `business_rule_violation` (422) — . - `rate_limited` (429) — Too many requests. Slow down and retry after the Retry-After interval. - `idempotency_conflict` (409) — An in-flight request with this Idempotency-Key already exists. Retry after it completes. - `internal_error` (500) — An internal error occurred. Contact support with the requestId. ## Related - [Quickstart](https://klaaro.ai/docs/quickstart.md) - [SDKs](https://klaaro.ai/docs/sdk.md) - [MCP](https://klaaro.ai/docs/mcp.md) - [Integrations](https://klaaro.ai/docs/integrations.md) - [llms.txt index](https://klaaro.ai/llms.txt) - [llms-full.txt](https://klaaro.ai/llms-full.txt)