---
title: "Analyse a document stored in Clio · 1 credit (2 in audit mode)"
method: POST
path: "/api/v1/dms/clio/analyze"
tags: ["Integrations"]
---

# Analyse a document stored in Clio · 1 credit (2 in audit mode)

`POST /api/v1/dms/clio/analyze`

## Request

- Base URL: `https://legal.nexusquantum.legal`
- URL: `https://legal.nexusquantum.legal/api/v1/dms/clio/analyze`
- Auth: HTTP bearer

You do not download anything: send the Clio `document_id` and Nexus retrieves the STORED token of the key's owner, downloads the document from the firm's regional Clio instance, extracts the text (respecting the firm's own OCR engine), analyses it and charges. 🔴 `jurisdiction` is REQUIRED and no default is assumed: analysing an English contract under Spanish law because nobody said otherwise is a wrong answer, not a fallback. Max file size 50 MB. Token-safe: the Clio token never appears in the response. Scope: mcp | *.

## Request body

- object
  - `document_id` string, required
  - `jurisdiction` string, required
  - `legal_branch` string
  - `language` string
  - `mode` 'standard' | 'deep' | 'agil' | 'auditoria'
  - `write_back` boolean: File the report back into the matter as a NEW document. Off by default: creating a document in the firm's own DMS is a side effect on THEIR system, so it is asked for, not assumed. 🔴 It is always a new document, never a new version of the lawyer's original — Clio's API allows that and this integration deliberately does not: an analysis is added to a matter, it does not replace the evidence.
  - `matter_id` string: Where to file the report. Required when `write_back` is true.

## Response `200`

{ analysis, jurisdiction, legal_branch, model, file_name, write_back, credits_charged, billing_warning }. `write_back` is null when it was not asked for, `{ok:true,documentId,name}` when the report is in Clio, and `{ok:false,reason}` when it is NOT — the analysis is never withheld because filing failed, and success is never claimed without closing the upload.

## Other responses

- `400`: DOCUMENT_ID_REQUIRED | MISSING_JURISDICTION | MATTER_ID_REQUIRED | INVALID_JSON
- `401`: Invalid key, or CLIO_AUTH_EXPIRED.
- `402`: Not enough credits.
- `404`: DOCUMENT_NOT_FOUND — no such document in the firm's Clio account.
- `413`: FILE_TOO_LARGE — over 50 MB.
- `422`: NO_CLIO_CONNECTION | EXTRACTION_FAILED | EXTRACTED_TEXT_TOO_SHORT
- `502`: CLIO_UNAVAILABLE

---

[API](https://skmtc.dev/nexusquantum/apis/nexus-legal-api.md) · [All operations](https://skmtc.dev/nexusquantum/apis/nexus-legal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/nexusquantum/apis/nexus-legal-api/revisions/4084d8d4eb0b?raw)
