DKBSignDocs

Core concepts

AI

Upload a PDF, then analyze it, review risk, summarize it, detect signature zones, or chat about the file.

Ingest

POST /api/ai/documents accepts multipart (file, optional external_id) or JSON (filename + content_base64 or storage_path). The 201 response includes document_id, status (often pending), and a job_id. Poll GET /api/ai/documents/{id}/status until ready or failed (pending → extracting → indexing).

Capabilities

CallBody / queryWhat you get
POST .../analyzeasync=true → 202doc_type, parties, dates, amounts, clauses, obligations
POST .../risk-reviewoptional reference_model_idrisk_score 0–100, risk_level (faible|moyen|eleve)
POST .../summarylength = court|standard|detailleresume, points_cles, alertes
POST .../validator-summaryrequired step and roleShorter summary for a workflow validator
POST .../signature-zonesmode = rules_only|rules_then_vision|vision_onlyBoxes with page, x0,y0,x1,y1, confidence

Async jobs return 202 { "job_id": "…", "status": "queued" }. Poll GET /api/ai/jobs/{job_id} (queued → running → done / failed). When done, result is the full analysis payload.

Document chat

Start a conversation with ingested document ids — not a free-form first message:

json
POST /api/ai/conversations
{ "type": "document", "document_ids": ["3fa85f64-5717-4562-b3fc-2c963f66afa6"] }

→ 201 { "conversation_id": "…" }

Then POST /api/ai/conversations/{id}/messages with { "content": "What is the termination clause?" } (1–2000 characters). The response is answer plus citations[] (document_id, page, extrait).

Jobs and quotas

Usage is GET /api/ai/usage/me and GET /api/ai/usage/company (company-admin) with from, to (YYYY-MM-DD), and granularity (day|month). The company payload includes quota.tokens_allocated, tokens_used, and a per-member breakdown. Super-admin model configuration is not on this gateway.