Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Nexus Legal Integrations API
version: 1.95.0
description: 'Multi-jurisdictional legal analysis API with a multi-agent architecture and Zero Retention. ## Output language
`language` (and the language implied by the jurisdiction) sets the language the text is written in. For `es` and `en` the delivered text is also measured: when a substantial part of it came back in the other of the two, a block headed `⚠️ LANGUAGE OF THIS REPORT` (`⚠️ IDIOMA DE ESTE INFORME` when `es` was requested) is added at the end of the text. It works the same with any engine, BYO included. - **When there is no block**: it is not a confirmation. Other languages are not measured, and neither is a text too short or too mixed to tell. - **With BYO**: how closely the output follows the request depends on your engine. - **If the output language is essential to your workflow**: check it on your side against the `analysis` string. ## The verdict travels INSIDE the text — read this before you parse a response
Every string this API returns that a lawyer reads — `analysis`, `answer`, `report`, `draft`, `synthesisText`, and the string fields of structured results like `applicableLaw[]` — carries the citation verdict **inline**, not only in the `citationChecks` object beside it. **What you will actually see:**
```
An acknowledgement does not revive a claim already barred: section 29(7) of the
Limitation Act 1980 【✓】. See also [2019] EWHC 3556 (Comm)
【◻ not checked — the reason is in this citation''s note】. ---
DETERMINISTIC CITATION CHECK (against the official corpus)
1 verified · 1 not checked. ◻ **Not checked** — they were not compared against any official corpus…
```
- **Inline marker**: a `【…】` block immediately after each citation, in the response language. The glyph carries the verdict: `✓` verified · `⚠` a warning (e.g. the decision exists but a party you named does not appear in it) · `⛔` broken · `◻` not checked. - **Footer**: a `---` block at the end with the tally and, for anything not clean, the list of citations and why. **Why it is in the text and not only in the JSON.** Whoever copies an answer into an email, a brief or a .docx takes the PROSE. The `citationChecks` object does not travel with it. A verdict that only exists in a field beside the text is a verdict the reader can lose without noticing. **If you parse these strings**: markers are the only `【…】` sequences we emit, so they are safe to strip with a single regex if your pipeline needs the raw prose — but do not strip them from anything a human will read. `citationChecks` remains the machine-readable source of truth for counts and per-citation status; the markers are the same verdict, placed where it cannot get lost. **Idempotent**: annotating an already-annotated text does not duplicate markers or the footer. ## Streaming: `verifiedText` on the `done` event
On SSE routes the client already holds the raw prose by the time the verifier finishes, so the closing `{type:"done"}` event carries `verifiedText`: the same answer with the verdict already in it. **If it is present, render it in place of the concatenated `text_delta` chunks.** It is omitted when there is nothing to annotate, in which case the deltas are already final. The REST wrappers do this for you — `/v1/consulta`, `/v1/chat` and the rest aggregate server-side and hand you the annotated text — so this only concerns you if you consume the SSE stream directly. ## Base capabilities
- **Mode=deep**: the Node A (Claude Opus 4.7) + Node B (DeepSeek V4-Pro) chain audits adversarially. 2 credits. Returns an `audit` object with structured findings (hallucinations, false citations, omissions). - **Direct models**: calls through the providers'' own APIs (Anthropic, DeepSeek) with no proxies — lower latency, better rate limits. - **Stable Stripe-style error format**: `error.type`, `error.code`, `error.request_id`, `error.details` + backward-compat aliases. ## Errors and rate limits
- **Branch on `error.code`.** A code you do not recognise is handled by its `error.type`.'
contact:
name: Nexus Legal
email: support@nexusquantum.legal
url: https://legal.nexusquantum.legal/developers
license:
name: Commercial
url: https://nexusquantum.legal/terms
servers:
- url: https://legal.nexusquantum.legal
description: Production
security:
- ApiKeyAuth: []
tags:
- name: Integrations
description: 'Management of the key owner''s DMS/GCal connections (E7): list DMS connections, aggregate integration status (gcal/dms/inbound/sso), GCal status, file listing for the connected Box, disconnects, deadline event in GCal and watches on DMS folders. Scope mcp|*, 0 credits, ownership by the key, no tokens in responses (tokens live only on the server). Jurisdiction: N/A. 7 endpoints adopt `requireUser` in the internal route + 1 pure loopback (`dms/box/watch`). Curated read-only MCP tools: `nexus_integrations_status`, `nexus_dms_connections`. Deferred (gap, browser-coupled): `dms/box/connect`, `gcal/oauth`, `gcal/resume` (OAuth handshake coupled to a browser session/cookie).'
paths:
/api/v1/dms/connections:
get:
tags:
- Integrations
summary: List the key owner's DMS connections (no tokens) · 0 credits
description: 'Lists the key owner''s document-management (DMS, e.g. Box) connections. The internal select excludes access/refresh tokens — metadata only (provider, account, connected_at, last_used_at, token_expires_at). Thin loopback to `/api/dms/connections` (adopted to `requireUser`, ownership `.eq(user_id, userId)`). No charge. Scope: mcp | *. MCP tool: `nexus_dms_connections`.'
responses:
'200':
description: '{ connections: [{ id, provider, provider_account_name, connected_at, last_used_at, token_expires_at }] }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: getApiV1DmsConnections
x-operation-id-source: derived
/api/v1/integrations/health:
get:
tags:
- Integrations
summary: Aggregate status of your own integrations · 0 credits
description: 'Status of the key owner''s integrations: `{ gcal:{connected,email}, dms:{connected,providers[]}, inbound_email:{configured}, sso:{configured} }`. Flags/status only — zero tokens. Thin loopback to `/api/integrations/health` (adopted to `requireUser`, ownership by the key). No charge. Scope: mcp | *. MCP tool: `nexus_integrations_status`.'
responses:
'200':
description: '{ gcal, dms, inbound_email, sso }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: getApiV1IntegrationsHealth
x-operation-id-source: derived
/api/v1/gcal/status:
get:
tags:
- Integrations
summary: Google Calendar connection status · 0 credits
description: 'Returns `{ connected, email }` for the key owner''s GCal connection (metadata, no token). Thin loopback to `/api/gcal/status` (adopted to `requireUser`). No charge. Scope: mcp | *. Also covered by the MCP tool `nexus_integrations_status`.'
responses:
'200':
description: '{ connected, email }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: getApiV1GcalStatus
x-operation-id-source: derived
/api/v1/dms/box/files:
get:
tags:
- Integrations
summary: List files in the connected Box · 0 credits
description: 'Lists the items in the given folder of the key owner''s connected Box. Operates on the STORED token (`getValidBoxToken(userId)`) — the token NEVER appears in the response. Thin loopback to `/api/dms/box/files` (adopted to `requireUser`). No charge. Scope: mcp | *. API-only (no MCP tool).'
parameters:
- name: folder_id
in: query
required: false
schema:
type: string
description: Box folder id (root by default).
- name: limit
in: query
required: false
schema:
type: integer
description: Maximum number of items.
responses:
'200':
description: '{ items: [...] } (file/folder metadata, no token)'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
'404':
description: NO_BOX_CONNECTION — the key owner has no Box connected.
operationId: getApiV1DmsBoxFiles
x-operation-id-source: derived
/api/v1/dms/box/disconnect:
post:
tags:
- Integrations
summary: Disconnect the key owner's Box · 0 credits
description: 'Disconnects Box: deletes folder watches + Box webhooks + the USER''S OWN `dms_connections` row. Returns `{ ok, deleted }` (no token). Thin loopback to `/api/dms/box/disconnect` (adopted to `requireUser`, `checkSameOrigin` untouched — it passes on loopback). No charge. Scope: mcp | *. API-only (side effect, no MCP tool).'
responses:
'200':
description: '{ ok, deleted }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: postApiV1DmsBoxDisconnect
x-operation-id-source: derived
/api/v1/dms/clio/matters:
get:
tags:
- Integrations
summary: List the key owner's Clio matters · 0 credits
description: 'Lists the firm''s matters from its connected Clio account, newest first. `query` is passed to Clio''s own search rather than filtering what we already fetched: a firm with thousands of matters does not fit in one page, and filtering locally would make anything past the first page look non-existent. Thin loopback to `/api/dms/clio/matters`; operates on the STORED token of the key''s user. Token-safe. No charge. Scope: mcp | *.'
parameters:
- name: query
in: query
required: false
schema:
type: string
description: Passed to Clio's matter search.
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 200
default: 50
responses:
'200':
description: '{ matters: [{ id, displayNumber, description, status, clientName }] }'
'401':
description: Invalid key, or CLIO_AUTH_EXPIRED — Clio rejected the stored credential and the firm must reconnect.
'404':
description: NO_CLIO_CONNECTION — Clio is not connected for this account.
'502':
description: CLIO_UNAVAILABLE — Clio could not be reached.
operationId: getApiV1DmsClioMatters
x-operation-id-source: derived
/api/v1/dms/clio/files:
get:
tags:
- Integrations
summary: List the documents of ONE Clio matter · 0 credits
description: '`matter_id` is REQUIRED. Clio''s own API allows it to be omitted and then returns the documents of the whole firm; this endpoint says it lists the documents of one matter, so it refuses rather than serving something else under that name. `size` may come back `null`, which means Clio did not report it — NOT that the file is empty. Thin loopback to `/api/dms/clio/files`. Token-safe. No charge. Scope: mcp | *.'
parameters:
- name: matter_id
in: query
required: true
schema:
type: string
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
maximum: 200
default: 100
responses:
'200':
description: '{ items: [{ id, name, sizeBytes, updatedAt, contentType }] }'
'400':
description: MATTER_ID_REQUIRED
'401':
description: Invalid key, or CLIO_AUTH_EXPIRED.
'404':
description: NO_CLIO_CONNECTION
'502':
description: CLIO_UNAVAILABLE
operationId: getApiV1DmsClioFiles
x-operation-id-source: derived
/api/v1/dms/clio/analyze:
post:
tags:
- Integrations
summary: Analyse a document stored in Clio · 1 credit (2 in audit mode)
description: '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 | *.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- document_id
- jurisdiction
properties:
document_id:
type: string
jurisdiction:
type: string
example: GB
legal_branch:
type: string
language:
type: string
mode:
type: string
enum:
- standard
- deep
- agil
- auditoria
write_back:
type: boolean
default: false
description: '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:
type: string
description: Where to file the report. Required when `write_back` is true.
responses:
'200':
description: '{ 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.'
'400':
description: DOCUMENT_ID_REQUIRED | MISSING_JURISDICTION | MATTER_ID_REQUIRED | INVALID_JSON
'401':
description: Invalid key, or CLIO_AUTH_EXPIRED.
'402':
description: Not enough credits.
'404':
description: DOCUMENT_NOT_FOUND — no such document in the firm's Clio account.
'413':
description: FILE_TOO_LARGE — over 50 MB.
'422':
description: NO_CLIO_CONNECTION | EXTRACTION_FAILED | EXTRACTED_TEXT_TOO_SHORT
'502':
description: CLIO_UNAVAILABLE
operationId: postApiV1DmsClioAnalyze
x-operation-id-source: derived
/api/v1/dms/clio/disconnect:
post:
tags:
- Integrations
summary: Disconnect the key owner's Clio Manage · 0 credits
description: 'Disconnects Clio: asks Clio to revoke the stored token (`POST /oauth/deauthorize` on the firm''s own regional instance) and then deletes the USER''S OWN `dms_connections` row, leaving a deletion tombstone. Returns `{ ok, deleted, revoked }` and no token. `revoked` is what Clio ANSWERED, not the fact that we called: `false` means the revocation is unconfirmed and the firm should also remove the app from within Clio Manage; `null` means no revocation was attempted (no usable token). Thin loopback to `/api/dms/clio/disconnect`. No charge. Scope: mcp | *. API-only (side effect, no MCP tool). NOTE: connecting Clio is browser-only — it needs the consent screen plus a session that matches the signed `state`, and the firm''s REGION (us|eu|ca|au), because Clio runs separate instances and a token issued in one is not valid against another.'
responses:
'200':
description: '{ ok, deleted, revoked }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
'404':
description: NO_CLIO_CONNECTION — there is no Clio connection to disconnect.
operationId: postApiV1DmsClioDisconnect
x-operation-id-source: derived
/api/v1/gcal/disconnect:
post:
tags:
- Integrations
summary: Disconnect the key owner's Google Calendar · 0 credits
description: 'Disconnects the key owner''s GCal (`deleteConnection(userId)`). Returns `{ ok: true }` (no token). Thin loopback to `/api/gcal/disconnect` (adopted to `requireUser`, `checkSameOrigin` untouched). No charge. Scope: mcp | *. API-only (no MCP tool).'
responses:
'200':
description: '{ ok: true }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: postApiV1GcalDisconnect
x-operation-id-source: derived
/api/v1/gcal/events/plazo:
post:
tags:
- Integrations
summary: Create a deadline event in your own GCal · 0 credits
description: 'Creates an all-day deadline event in the USER''S OWN Google Calendar (`createCalendarEvent(userId, …)`), idempotent on `(user_id, fecha_base, fecha_vencimiento, preset_slug)`. Returns `{ status, google_event_id }` (no token). `502 GCAL_NOT_CONNECTED_OR_FAILED` verbatim if the user has no GCal connected. Thin loopback to `/api/gcal/events/plazo` (adopted to `requireUser`, `checkSameOrigin` untouched). No charge. Scope: mcp | *. API-only (side effect, no MCP tool).'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
preset_slug:
type: string
label:
type: string
fecha_base:
type: string
fecha_vencimiento:
type: string
regla_aplicable:
type: string
case_name:
type: string
responses:
'200':
description: '{ status, google_event_id }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
'502':
description: GCAL_NOT_CONNECTED_OR_FAILED — no GCal connected, or the event could not be created.
operationId: postApiV1GcalEventsPlazo
x-operation-id-source: derived
/api/v1/dms/box/watch:
get:
tags:
- Integrations
summary: List watches on DMS folders · 0 credits
description: 'Lists the key owner''s folder watches on Box folders. Pure loopback to `/api/dms/box/watch` (it already uses `requireUser`+`getUserId`; zero internal change). Watch metadata only, no token. No charge. Scope: mcp | *. API-only (no MCP tool).'
responses:
'200':
description: '{ watches: [...] }'
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: getApiV1DmsBoxWatch
x-operation-id-source: derived
post:
tags:
- Integrations
summary: Create a watch/webhook on a DMS folder · 0 credits
description: 'Creates a watch (Box `FILE.UPLOADED` webhook) on a folder. Pure loopback to `/api/dms/box/watch` (`checkSameOrigin` passes on loopback). Ownership by the key, no token in the response. No charge. Scope: mcp | *. API-only (automation with side effects, no MCP tool).'
requestBody:
required: true
content:
application/json:
schema:
type: object
responses:
'200':
description: Metadata of the created watch.
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: postApiV1DmsBoxWatch
x-operation-id-source: derived
delete:
tags:
- Integrations
summary: Delete a watch on a DMS folder · 0 credits
description: 'Deletes the watch given by `?id=`. Pure loopback to `/api/dms/box/watch`. Ownership by the key. No charge. Scope: mcp | *. API-only (no MCP tool).'
parameters:
- name: id
in: query
required: true
schema:
type: string
description: Id of the watch to delete.
responses:
'200':
description: Watch deleted.
content:
application/json:
schema:
type: object
'401':
description: Invalid or missing API key.
'403':
description: INSUFFICIENT_SCOPE — the key lacks scope mcp | *.
operationId: deleteApiV1DmsBoxWatch
x-operation-id-source: derived
components:
securitySchemes:
ApiKeyAuth:
type: http
scheme: bearer
bearerFormat: nlk_...