Skip to content
concord.app
Book a demo
esc
concord.app
Book a demo

API reference

Analytics. 5 operations.

The Analytics operations of the concord.app REST API, each with its parameters, body fields and responses.

Every path is on https://app.concord.app.

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

NameInTypeDescription
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

NameTypeDescription
dataSource
required
string
dimensions
required
array of string
measures
required
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

StatusDescription
200OK
400Analytics query failed validation, Request payload failed schema validation; BAD_REQUEST: Analytics query failed validation; VALIDATION: Request payload failed schema validation
401401 — UNAUTHORIZED: Missing or invalid authentication credentials
403403 — FORBIDDEN: The credential lacks the data scope of a source or field the query reads
404404 — NOT_FOUND: Requested resource does not exist
405405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource
406406 — NOT_ACCEPTABLE: Requested representation is not acceptable
408408 — TIMEOUT: Request timed out
409409 — CONFLICT: Resource state conflict — concurrent modification or duplicate
412412 — PRECONDITION_FAILED: Resource state does not allow the requested operation
413413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size
415415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported
422422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable — e.g. file format mismatch
429429 — TOO_MANY_REQUESTS: Rate limit exceeded — wait retryAfterSeconds before retrying
499499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished
500500 — INTERNAL_SERVER_ERROR: Unexpected server error — the request should not be retried
501501 — NOT_IMPLEMENTED: The requested operation is not implemented
502502 — BAD_GATEWAY: Invalid response from an upstream dependency
503503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After
504504 — 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

NameInTypeDescription
reportId query string
descriptions query boolean

Responses

StatusDescription
200OK
400Malformed request or invalid parameters, Request payload failed schema validation; BAD_REQUEST: Malformed request or invalid parameters; VALIDATION: Request payload failed schema validation
401401 — UNAUTHORIZED: Missing or invalid authentication credentials
403403 — FORBIDDEN: Authenticated but not authorized for this resource
404404 — NOT_FOUND: Requested resource does not exist
405405 — METHOD_NOT_SUPPORTED: HTTP method not supported for this resource
406406 — NOT_ACCEPTABLE: Requested representation is not acceptable
408408 — TIMEOUT: Request timed out
409409 — CONFLICT: Resource state conflict — concurrent modification or duplicate
412412 — PRECONDITION_FAILED: Resource state does not allow the requested operation
413413 — PAYLOAD_TOO_LARGE: Request payload exceeds the allowed size
415415 — UNSUPPORTED_MEDIA_TYPE: Request media type is not supported
422422 — UNPROCESSABLE_CONTENT: Request semantically valid but unprocessable — e.g. file format mismatch
429429 — TOO_MANY_REQUESTS: Rate limit exceeded — wait retryAfterSeconds before retrying
499499 — CLIENT_CLOSED_REQUEST: Client closed the request before the server finished
500500 — INTERNAL_SERVER_ERROR: Unexpected server error — the request should not be retried
501501 — NOT_IMPLEMENTED: The requested operation is not implemented
502502 — BAD_GATEWAY: Invalid response from an upstream dependency
503503 — SERVICE_UNAVAILABLE: Service temporarily unavailable — may be retried after Retry-After
504504 — 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

NameInTypeDescription
limit query integer
starting_after query string

Responses

StatusDescription
200Cursor-paginated list of reports
400Invalid request — see error.code for the specific failure mode
401Missing or invalid Bearer token
403Authenticated but not permitted to perform this action
404Resource not found
429Rate 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

NameInTypeDescription
id
required
path string

Responses

StatusDescription
200The requested report
400Invalid request — see error.code for the specific failure mode
401Missing or invalid Bearer token
403Authenticated but not permitted to perform this action
404Resource not found
429Rate 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

NameInTypeDescription
id
required
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

NameTypeDescription
format
required
one of "pdf", "png"

Responses

StatusDescription
200Binary PDF or PNG export
400Invalid request — see error.code for the specific failure mode
401Missing or invalid Bearer token
403Authenticated but not permitted to perform this action
404Resource not found
429Rate limit exceeded — see Retry-After and RateLimit-* headers

See it on your contracts.

Book a demo

Trusted by teams at

  • 4M+ documents signed since 2014