Intelligence — AI negotiation, diff, playbook and relationship analysis.
Every path is on https://app.concord.app.
- GET
/api/v1/intelligence/anomaliesDetect anomalies in one document against portfolio baselines - POST
/api/v1/intelligence/diffDiff a document against its previous version or closest match - POST
/api/v1/intelligence/feedbackRecord risk-flag or summary feedback on a document - GET
/api/v1/intelligence/relationshipsFind the other documents one document refers to - GET
/api/v1/intelligence/renewals-with-spendRenewals with what was paid
GET/api/v1/intelligence/anomalies
Detect anomalies in one document against portfolio baselines
Compares one agreement's extracted money and term values against percentile baselines (p10 / p25 / median / p75 / p90) computed over up to 100 other standard-v3 extractions in the same organization, and returns the fields that fall outside them with a deviation type and a severity. It analyses the one agreement you name, not the portfolio: the rest of the portfolio is only the baseline, and Confidential workspace agreements are excluded from it. Statistical, not generative — no model is called, no AI budget is spent, and nothing is written. An agreement with no standard-v3 extraction yet comes back empty rather than failing.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
agreement_idrequired | query | string | |
contract_type | query | string |
Responses
| Status | Description |
|---|---|
200 | OK |
400 | Malformed request or invalid parameters, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters; VALIDATION: Request payload failed schema validation |
401 | 401 — UNAUTHORIZED: Missing or invalid authentication credentials |
403 | 403 — FORBIDDEN: Authenticated but not authorized for this resource |
404 | 404 — NOT_FOUND: Requested resource does not exist |
405 | 405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource |
406 | 406 — NOT_ACCEPTABLE: Requested representation is not acceptable |
408 | 408 — TIMEOUT: Request timed out |
409 | 409 — CONFLICT: Resource state conflict — concurrent modification or duplicate |
412 | 412 — PRECONDITION_FAILED: Resource state does not allow the requested operation |
413 | 413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size |
415 | 415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported |
422 | 422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable — e.g. file format mismatch |
429 | 429 — TOO_MANY_REQUESTS: Rate limit exceeded — wait retryAfterSeconds before retrying |
499 | 499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished |
500 | 500 — INTERNAL_SERVER_ERROR: Unexpected server error — the request should not be retried |
501 | 501 — NOT_IMPLEMENTED: The requested operation is not implemented |
502 | 502 — BAD_GATEWAY: Invalid response from an upstream dependency |
503 | 503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After |
504 | 504 — GATEWAY_TIMEOUT: Timed out waiting for an upstream dependency |
POST/api/v1/intelligence/diff
Diff a document against its previous version or closest match
Compares an agreement's extracted fields against the previous version — or, when no previous agreement is given, against the closest matching document the service selects itself — and returns a field-by-field diff with a materiality grade. CALLS THE AI ON REQUEST: with use_llm_refinement set and at least one ambiguous administrative change present, the service makes a live LLM call to re-grade those changes, inside the organization's short-term AI allowance. Without that flag, and when there is nothing ambiguous to re-grade, no AI call is made. Nothing is created or changed.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Optional idempotency key. When supplied, a repeat of the same request replays the original response instead of performing the write twice. A retry sent WITHOUT the header is a second write and CAN duplicate its effect — always send one on retries. |
Request body
| Name | Type | Description |
|---|---|---|
current_agreement_idrequired | string | |
previous_agreement_id | string | |
use_llm_refinement | boolean |
Responses
| Status | Description |
|---|---|
200 | OK |
400 | Malformed request or invalid parameters, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters; VALIDATION: Request payload failed schema validation |
401 | 401 — UNAUTHORIZED: Missing or invalid authentication credentials |
403 | 403 — FORBIDDEN: Intelligence analysis is not permitted for this organization (feature disabled or AI processing off) |
404 | 404 — NOT_FOUND: The intelligence record (or a resource it depends on, e.g. document content) was not found |
405 | 405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource |
406 | 406 — NOT_ACCEPTABLE: Requested representation is not acceptable |
408 | 408 — TIMEOUT: Request timed out |
409 | 409 — CONFLICT: Resource state conflict — concurrent modification or duplicate |
412 | 412 — PRECONDITION_FAILED: Resource state does not allow the requested operation |
413 | 413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size |
415 | 415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported |
422 | 422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable — e.g. file format mismatch |
429 | 429 — TOO_MANY_REQUESTS: Rate limit exceeded — wait retryAfterSeconds before retrying |
499 | 499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished |
500 | 500 — INTERNAL_SERVER_ERROR: Unexpected server error — the request should not be retried |
501 | 501 — NOT_IMPLEMENTED: The requested operation is not implemented |
502 | 502 — BAD_GATEWAY: Invalid response from an upstream dependency |
503 | 503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After |
504 | 504 — GATEWAY_TIMEOUT: Timed out waiting for an upstream dependency |
POST/api/v1/intelligence/feedback
Record risk-flag or summary feedback on a document
Appends one AI-quality feedback row to an agreement: a dismissed risk flag, a confirmed risk flag, or an edited AI summary, recording what the AI said next to what the human said. The row is permanent — no API operation edits or deletes it, and only a retention or erasure job removes it. It does NOT feed the extraction-accuracy metrics: those are computed from field-level accept / override / reject corrections, which are recorded by documentManagement.recordFieldFeedback, not here. Size limits, because the row is permanent: fieldName at most 200 characters, aiValue and humanValue at most 10000 each, and metadata must be JSON-serializable and serialize to at most 10000 characters.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string | Optional idempotency key. When supplied, a repeat of the same request replays the original response instead of performing the write twice. A retry sent WITHOUT the header is a second write and CAN duplicate its effect — always send one on retries. |
Request body
| Name | Type | Description |
|---|---|---|
agreement_idrequired | string | |
event_typerequired | one of "risk_flag_dismissed", "risk_flag_confirmed", "summary_edited" | |
field_name | string | |
ai_value | string | When the field is a contract-term amount (a term whose catalog kind is money, such as the total contract value) and the value is a bare number, that number is an integer count of the currency's smallest step, sent as text (e.g. 5000000 = 50,000.00), never with a fraction; a formatted amount ($50,000, USD 50k) and the value of any other field are read as written. |
human_value | string | When the field is a contract-term amount (a term whose catalog kind is money, such as the total contract value) and the value is a bare number, that number is an integer count of the currency's smallest step, sent as text (e.g. 5000000 = 50,000.00), never with a fraction; a formatted amount ($50,000, USD 50k) and the value of any other field are read as written. |
metadata | object |
Responses
| Status | Description |
|---|---|
200 | OK |
400 | Malformed request or invalid parameters, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters; VALIDATION: Request payload failed schema validation |
401 | 401 — UNAUTHORIZED: Missing or invalid authentication credentials |
403 | 403 — FORBIDDEN: Authenticated but not authorized for this resource |
404 | 404 — NOT_FOUND: Requested resource does not exist |
405 | 405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource |
406 | 406 — NOT_ACCEPTABLE: Requested representation is not acceptable |
408 | 408 — TIMEOUT: Request timed out |
409 | 409 — CONFLICT: Resource state conflict — concurrent modification or duplicate |
412 | 412 — PRECONDITION_FAILED: Resource state does not allow the requested operation |
413 | 413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size |
415 | 415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported |
422 | 422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable — e.g. file format mismatch |
429 | 429 — TOO_MANY_REQUESTS: Rate limit exceeded — wait retryAfterSeconds before retrying |
499 | 499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished |
500 | 500 — INTERNAL_SERVER_ERROR: Unexpected server error — the request should not be retried |
501 | 501 — NOT_IMPLEMENTED: The requested operation is not implemented |
502 | 502 — BAD_GATEWAY: Invalid response from an upstream dependency |
503 | 503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After |
504 | 504 — GATEWAY_TIMEOUT: Timed out waiting for an upstream dependency |
GET/api/v1/intelligence/relationships
Find the other documents one document refers to
Scans one agreement's extracted fields for references to other contracts — by title, by date, by type-and-date, or by reference number — and returns each reference that resolved to another agreement in the same organization, with the match type and a confidence score, alongside the total number of references found. Only matches above 0.5 confidence are returned, and at most one per matched agreement (the highest-scoring one), so a reference that matched nothing is visible only in the totalReferencesFound count. Read-only: it follows references outward from the agreement you name and stores no relationship, so it is not a portfolio-wide relationship graph.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
agreement_idrequired | query | string |
Responses
| Status | Description |
|---|---|
200 | OK |
400 | Malformed request or invalid parameters, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters; VALIDATION: Request payload failed schema validation |
401 | 401 — UNAUTHORIZED: Missing or invalid authentication credentials |
403 | 403 — FORBIDDEN: Authenticated but not authorized for this resource |
404 | 404 — NOT_FOUND: Requested resource does not exist |
405 | 405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource |
406 | 406 — NOT_ACCEPTABLE: Requested representation is not acceptable |
408 | 408 — TIMEOUT: Request timed out |
409 | 409 — CONFLICT: Resource state conflict — concurrent modification or duplicate |
412 | 412 — PRECONDITION_FAILED: Resource state does not allow the requested operation |
413 | 413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size |
415 | 415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported |
422 | 422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable — e.g. file format mismatch |
429 | 429 — TOO_MANY_REQUESTS: Rate limit exceeded — wait retryAfterSeconds before retrying |
499 | 499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished |
500 | 500 — INTERNAL_SERVER_ERROR: Unexpected server error — the request should not be retried |
501 | 501 — NOT_IMPLEMENTED: The requested operation is not implemented |
502 | 502 — BAD_GATEWAY: Invalid response from an upstream dependency |
503 | 503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After |
504 | 504 — GATEWAY_TIMEOUT: Timed out waiting for an upstream dependency |
GET/api/v1/intelligence/renewals-with-spend
Renewals with what was paid
Answers 'which vendors renew this quarter and what did we pay them?': the contracts the caller can open whose term ends or renews inside the window (default: this calendar quarter), soonest first, each with what was paid to the vendor in the last 12 months and over the term (from the connected finance system), its standing against the contract value and a renewal brief. Amounts are integer minor units in the row's currency. A row whose spend is not known (no finance system connected and caught up, no payment matched to the contract, or part of its money waiting on a paused or disconnected connection, flagged spendWaiting) carries no brief and says so in its sentence.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
from | query | string | |
to | query | string | |
limit | query | integer |
Responses
| Status | Description |
|---|---|
200 | OK |
400 | Malformed request or invalid parameters for the operation, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters for the operation; VALIDATION: Request payload failed schema validation |
401 | 401 — UNAUTHORIZED: Missing or invalid authentication credentials |
403 | 403 — FORBIDDEN: Authenticated but not authorized for this resource or operation |
404 | 404 — NOT_FOUND: The requested resource (or a resource referenced by the operation) was not found |
405 | 405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource |
406 | 406 — NOT_ACCEPTABLE: Requested representation is not acceptable |
408 | 408 — TIMEOUT: Request timed out |
409 | 409 — CONFLICT: Resource state conflict — concurrent modification or duplicate |
412 | 412 — PRECONDITION_FAILED: Resource state does not allow the requested operation |
413 | 413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size |
415 | 415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported |
422 | 422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable |
429 | 429 — TOO_MANY_REQUESTS: Rate limit or quota exceeded for the operation |
499 | 499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished |
500 | 500 — INTERNAL_SERVER_ERROR: Unexpected server error while processing the operation |
501 | 501 — NOT_IMPLEMENTED: The requested operation is not implemented |
502 | 502 — BAD_GATEWAY: Invalid response from an upstream dependency |
503 | 503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After |
504 | 504 — GATEWAY_TIMEOUT: Timed out waiting for an upstream dependency |