Every path is on https://app.concord.app.
- POST
/api/v1/analytics/queryRun an analytics query - GET
/api/v1/analytics/schemaDescribe the analytics data sources - GET
/api/v1/reportsList reports - GET
/api/v1/reports/{id}Retrieve a report - POST
/api/v1/reports/{id}/exportExport a report as PDF or PNG
POST/api/v1/analytics/query
Run an analytics query
Runs one analytics query, computed as the caller over the contracts they can read: measures over a data source, grouped by dimensions, with filters, a time range, sort and limit. Optional comparison, rollingAverageWindow and cumulative add period-over-period figures; an optional compareTo window is compared with the timeRange window, per group and measure (timeIntelligence.windows); an optional reportId runs the query under that report's own access. Each data source and field also needs its own data scope (for example read:agreements for contract fields, read:obligations for obligations): a credential without one is refused 403, naming each field and the scope it needs. A refused query answers 400 invalid_request with the engine's message; a query past its time bound answers 504.
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 |
|---|---|---|
dataSourcerequired | string | |
dimensionsrequired | array of string | |
measuresrequired | array of object | |
filters | array of object | |
related | array of object | |
timeRange | object | |
sort | array of object | |
having | array of object | Keep only groups whose measure passes (ANDed): e.g. [{measure:'count_all', operator:'gt', value:5}]. |
limit | integer | |
comparison | one of "MoM", "QoQ", "YoY" | |
rollingAverageWindow | integer | |
cumulative | boolean | |
compareTo | object | |
topN | integer | |
otherBucket | boolean | |
tiesUpTo | integer | Set by the server from the chart; never write it. |
timezone | string | |
scope | object | |
currencyMode | one of "split", "converted" | |
anyOf | array of array of object | |
reportId | string | |
widgetId | string | |
reportScope | object | |
reportFollow | object | |
valueFields | array of string |
Responses
| Status | Description |
|---|---|
200 | OK |
400 | Analytics query failed validation, Request payload failed schema validation; BAD_REQUEST: Analytics query failed validation; VALIDATION: Request payload failed schema validation |
401 | 401 — UNAUTHORIZED: Missing or invalid authentication credentials |
403 | 403 — FORBIDDEN: The credential lacks the data scope of a source or field the query reads |
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: Analytics query ran past its time bound |
GET/api/v1/analytics/schema
Describe the analytics data sources
Every analytics data source a query may name, with its dimensions (and what each one means), its measures and the aggregate functions each measure admits, and the date axes a time range may use. The catalogue is the caller's organization's: the contracts source also lists the organization's own company fields, each with its label, options and how a value is picked. Each source is computed from the caller's own contracts when it is queried. An optional reportId reads the catalogue for that report, under the report's own access. An API key or OAuth token is listed only the sources and fields its scopes allow it to query.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
reportId | query | string | |
descriptions | query | 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: 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/reports
List reports
Cursor-paginated list of analytics reports scoped to the authenticated organization. Reports are dashboard-backed (a report is a dashboard in display_mode 'report'): id carries the dashboard public id (dsh_… — legacy rpt_… ids retired 2026-08 and return 404), type is derived from the report's widget shape (table when a widget is a table, otherwise chart), and tags is always null (dashboards carry no tags).
Parameters
| Name | In | Type | Description |
|---|---|---|---|
limit | query | integer | |
starting_after | query | string |
Responses
| Status | Description |
|---|---|
200 | Cursor-paginated list of reports |
400 | Invalid request — see error.code for the specific failure mode |
401 | Missing or invalid Bearer token |
403 | Authenticated but not permitted to perform this action |
404 | Resource not found |
429 | Rate limit exceeded — see Retry-After and RateLimit-* headers |
GET/api/v1/reports/{id}
Retrieve a report
Returns a single report. Reports are dashboard-backed: pass the dashboard public id (dsh_…) of a display_mode 'report' dashboard — legacy rpt_… ids return 404. type is derived (table/chart); tags, query_config, visualization_config, and parameter_config are always null — the widget query and visualization payload live on the dashboard's widgets and are not exposed under the legacy keys.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string |
Responses
| Status | Description |
|---|---|
200 | The requested report |
400 | Invalid request — see error.code for the specific failure mode |
401 | Missing or invalid Bearer token |
403 | Authenticated but not permitted to perform this action |
404 | Resource not found |
429 | Rate limit exceeded — see Retry-After and RateLimit-* headers |
POST/api/v1/reports/{id}/export
Export a report as PDF or PNG
Renders the report via headless browser and returns the rendered PDF or PNG synchronously. 50-point cost. Reports are dashboard-backed: pass the dashboard public id (dsh_…) of a display_mode 'report' dashboard — legacy rpt_… ids return 404. The render is gated on a content sentinel: a failed render (error card) answers export_failed, never error bytes.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
idrequired | path | string | |
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 |
|---|---|---|
formatrequired | one of "pdf", "png" |
Responses
| Status | Description |
|---|---|
200 | Binary PDF or PNG export |
400 | Invalid request — see error.code for the specific failure mode |
401 | Missing or invalid Bearer token |
403 | Authenticated but not permitted to perform this action |
404 | Resource not found |
429 | Rate limit exceeded — see Retry-After and RateLimit-* headers |