Developer docs
Contracts, the REST API, the MCP server, freshness and governance, in one page. For the full deployment guide, ask us.
Quick start
- Connect a source (Databricks, Snowflake, Postgres, SQL Server or another) under Sources. Indexing profiles tables and aligns your glossary.
- Run Discover, or write a question. Build an insight or a data API from it and check it in Try it.
- Publish it as a context: parameters, row scope, masking, freshness, example phrasings. A curator approves the publish.
- Mint a key under Users → API keys and grant it the contexts it may call.
- Call it over REST, or connect an agent to
/mcpfrom the Connect an agent panel.
Contract reference
A contract (the definition behind every context and data API) is JSON or YAML loaded into a registry. Fields:
| Field | Type | Meaning |
|---|---|---|
key | string | Dotted lower-case address, e.g. uw.book.open_submissions. Never reused for a different answer. |
version | int | Bumped when meaning or shape changes; callers may pin one. |
title, description, owner, domain, tags | string | Catalog metadata. |
status | draft | published | retired | Only published contracts run for consumers. |
source | string | Which executor (connection) runs it. Default default. |
sql | string | One read-only statement with :name placeholders. |
params[] | object | name, type, required, default, multi, min, max, values, label, description, example. |
columns[] | object | name, type, label, unit (money | pct | count | date | text), pii, description. |
row_scope | object | owner_column, org_column, or public: true. One is required. |
rollup | object | by, sum, count_as, order: totals over the caller's rows after scope. |
freshness | object | cadence (live | hourly | nightly | weekly | static), sla_minutes, description. |
cache_ttl_s, cache_stale_s | int | Seconds an answer is kept, and served stale while one refresh runs. |
pii | none | internal | personal | sensitive | Sensitive requires allowed_roles. |
allowed_roles, clearance_roles | string[] | Who may call it; who sees masked columns unmasked. |
masking | object | column: redact | hash | last4 | null. |
max_rows, timeout_s | int | Row cap (1 to 50,000, default 500) and timeout (1 to 300 s, default 15). |
questions[] | string | Example phrasings for matching a question to this contract. |
chart, enrich[] | object | How a tile draws it; named steps run over the rows after the query. |
{
"key": "sales.book.renewals_due",
"version": 3,
"title": "Renewals due in my book",
"source": "snowflake_sales",
"sql": "SELECT account_id, account_name, owner_id, org_id, renewal_date, arr_usd, health
FROM gold.renewals
WHERE renewal_date <= CURRENT_DATE + :days_ahead
AND region IN (:regions)",
"params": [
{"name": "days_ahead", "type": "integer", "default": 90, "min": 1, "max": 365},
{"name": "regions", "type": "string", "multi": true, "values": ["NA", "EMEA", "APAC"]}
],
"columns": [
{"name": "arr_usd", "label": "Annual value", "unit": "money"},
{"name": "account_name", "label": "Account", "pii": false}
],
"row_scope": {"owner_column": "owner_id", "org_column": "org_id"},
"freshness": {"cadence": "live", "sla_minutes": 15},
"cache_ttl_s": 300,
"pii": "internal",
"masking": {"contact_email": "hash"},
"max_rows": 500,
"timeout_s": 15,
"questions": ["which renewals are due in my book", "accounts renewing next quarter"]
}
The same shape for an insurance book: renewals scoped to the underwriter who asks, with the insured contact masked for anyone without the uw_manager clearance.
{
"key": "uw.book.renewals_due",
"version": 1,
"title": "Renewals due in my book",
"source": "databricks_pnc",
"sql": "SELECT policy_id, insured_name, lob, renewal_date, written_premium,
loss_ratio, open_claims, contact_email, underwriter_id, org_id
FROM gold.policy_renewals
WHERE renewal_date <= CURRENT_DATE + :days_ahead
AND (:lob IS NULL OR lob = :lob)",
"params": [
{"name": "days_ahead", "type": "integer", "default": 90, "min": 1, "max": 365},
{"name": "lob", "type": "string", "values": ["GL", "PROP", "WC", "AUTO", "UMB", "CYBER"]}
],
"columns": [
{"name": "written_premium", "label": "Written premium", "unit": "money"},
{"name": "loss_ratio", "label": "Incurred loss ratio", "unit": "pct"},
{"name": "open_claims", "label": "Open claims", "unit": "count"},
{"name": "contact_email", "label": "Insured contact", "pii": true}
],
"row_scope": {"owner_column": "underwriter_id", "org_column": "org_id"},
"freshness": {"cadence": "live", "sla_minutes": 15},
"cache_ttl_s": 120,
"pii": "personal",
"masking": {"contact_email": "redact"},
"clearance_roles": ["uw_manager"],
"max_rows": 500,
"timeout_s": 15,
"questions": ["which renewals are due in my book", "renewals in the next 90 days with their loss ratio"]
}
REST API
| Call | Does |
|---|---|
GET /api/dataapi/contracts | List contracts the caller may see, with summary, parameters, columns and seven-day usage. |
GET /api/dataapi/contracts/<key> | One contract's summary and usage. |
POST /api/dataapi/<key>/query | Run it. Body: params, optional version, max_rows, refresh (admins). |
GET /api/dataapi/usage | Calls, callers and failures over 1 to 90 days. |
/api/v1/… | Published insights, dashboards, collections, search and home pages by slug and version, with OpenAPI. |
curl -X POST https://compose.your-company.com/api/dataapi/sales.book.renewals_due/query \
-H "Authorization: Bearer $INSIGHTCOMPOSE_KEY" -H "Content-Type: application/json" \
-d '{"params": {"days_ahead": 60, "regions": ["NA"]}}'
# 200 OK X-DataAPI-Cache: HIT Age: 42
{ "status": "SUCCESS",
"data": { "key": "sales.book.renewals_due", "version": 3,
"columns": [{"name": "arr_usd", "label": "Annual value", "unit": "money"}, ...],
"rows": [...], "row_count": 37, "truncated": false, "masked": true,
"as_of": "2026-11-23T09:14:05+00:00",
"freshness": {"cadence": "live", "sla_minutes": 15},
"scope": {"book": 1, "org": true, "public": false} } }
MCP server
Published contexts are served as tools at /mcp over Streamable HTTP (stateless) and over stdio for local clients. Authenticate with a bearer API key or OAuth 2.1; the server publishes protected-resource metadata so OAuth clients can discover the issuer. Each tool's input schema comes from the context's parameters.
# Streamable HTTP, bearer key claude mcp add --transport http insightcompose \ https://compose.your-company.com/mcp \ --header "Authorization: Bearer $INSIGHTCOMPOSE_KEY"
{
"mcpServers": {
"insightcompose": {
"type": "http",
"url": "https://compose.your-company.com/mcp",
"headers": {
"Authorization": "Bearer ${INSIGHTCOMPOSE_KEY}"
}
}
}
}
Freshness & cache
Each contract declares a cadence and SLA. Answers may be cached for cache_ttl_s and served stale for cache_stale_s while one refresh runs; concurrent misses share one call. Cache keys include the normalized parameters, the caller's scope, masking and the data version; bumping the version after a load retires older answers. Responses carry as_of and freshness, and the X-DataAPI-Cache and Age headers.
Industry packs
An industry pack gives the engine an industry: a domain pack (vocabulary, measures, value families, KPI templates, date bases, conventions, glossaries), a gold set of curated questions and a content pack of persona home pages. Eight ship: insurance (the default), banking, retail, cpg, manufacturing, healthcare, saas and finance-hr. See Industries for what each holds.
| Setting or call | Does |
|---|---|
COMPOSE_DOMAIN_PACK | The deployment default: one or more pack keys, comma-separated, merged in order, e.g. retail,finance-hr. Default insurance; an empty value turns pack mapping off. |
GET /api/discovery/domain-packs | The shipped packs with their counts, and the gold set and content packs for each. |
GET /api/discovery/sources/{guid}/domain-packs | One source’s packs: {packs, chosen, default, mapped}. |
PUT /api/discovery/sources/{guid}/domain-packs | Choose packs for a source (admin). Body {"packs": ["retail", "finance-hr"], "remap": true}; [] turns mapping off for the source, null follows the deployment default. remap re-maps now in the background with read-only probes; otherwise at the next index. |
The same choice is on Prepare → Industry packs. Choosing a pack for a source seeds its gold set straight away. Content packs install from Personas → Packs, or with POST /api/personas/packs/install {"key": "retail-personas", "source": "<source guid>"}; installing never overwrites an object a curator edited.
Scope, masking, audit
Row scope is resolved from the caller and wrapped around the statement. An execution policy permits one read-only statement over allowed schemas; values are bound; the database runs it read-only with a statement timeout; at most max_rows return. Masked columns are masked for callers without a clearance role. Each call writes an audit row with the caller, contract, version, outcome and timing; parameter values are hashed.
Deployment
InsightCompose runs in your AWS, Google Cloud or Azure account or on-prem, as one container stack: Postgres for its own state, the API, and nginx serving the UI and proxying /api. It uses your identity provider (Okta, Entra ID or any OpenID Connect provider) and your language model endpoint. Runs in your environment. The only outside calls are to the model endpoint you choose and, if you turn it on, a public-data lookup that must cite its source. Ask us for the deployment guide and security documentation.
Security controls
What reaches the model: table and column names with their descriptions and a few sample values, your definitions and glossary, the question, and, when a story is narrated, the result rows it describes. Calling a published context uses no model at all.
| Control | How it works |
|---|---|
| Where it runs | Your AWS, Google Cloud or Azure account, or on-prem, as one container stack (Postgres, the API, nginx serving the UI). |
| What leaves | Calls to the model endpoint you choose and, only if turned on, a public-data lookup that must cite its source. |
| Sign-in | Okta, Entra ID or any OpenID Connect provider; directory groups map to roles. |
| Who may call what | Bearer keys or OAuth 2.1; a grant per key or directory group names the contexts and scopes. No grant, no calls. |
| Whose rows | Row scope resolved from the caller (book owner or organization) and wrapped around the statement. |
| Personal data | Masking per column: redact, hash, last four or null, unless the caller has a clearance role. |
| Execution | One read-only statement over allowed schemas, bound values, a statement timeout and a row cap. |
| Change control | Drafts, publish requests a curator approves, versions callers can pin, breaking changes refused unless declared. |
| Audit | A ledger row per call: caller, context, version, outcome, timing; parameter values hashed. Every definition change kept with its author. |
| Limits | Rate limits per key and a size cap on every answer. |
More in the CIO FAQ and on Governance & security.
See your own context layer, on your data
Bring one source and three questions your agents or apps need answered. We will stand up governed contexts over them in your environment and connect an agent to them in a working session.
We reply within one business day. Next comes a 45-minute executive briefing for your CIO or CDO, then, if it fits, a 12-week Innovation POD in your environment.