Skip to main content
Prerequisites:
  • Your API keys must have the Discovery API Viewer capability.
  • Discovery metadata is populated from your Bolt runs. An environment must have at least one completed run before the API returns data for it.
The Discovery API lets you query the metadata Paradime collects every time Bolt runs your dbt project: the project structure from the manifest, run results, test outcomes, source freshness, and warehouse catalog information. Use it to power data quality monitoring, lineage tooling, cost and performance analysis, data catalogs, and audit workflows. Every query starts from the environment field, identified by the environment slug (for example production). Each environment exposes two states:
  • definition: the project as declared in code, parsed from the latest manifest.
  • applied: the definition joined with the latest execution state, including run status, timing, test results, source freshness, and catalog metadata.
The examples below authenticate with an account API key: pass Authorization: Bearer <token> and X-Paradime-Workspace: <workspace_uid> (the account key starts with prdm_cmp_). Legacy workspace API keys are still supported: send X-API-KEY and X-API-SECRET headers instead. See API Keys.

Use cases

Running queries

Send every query as a POST to your API endpoint. The first example is shown in full; the remaining examples show only the GraphQL document and variables, which you can drop into the same request shape.
Connection fields (models, sources, tests, and so on) are cursor-paginated. Pass first to limit page size and after with the previous page’s pageInfo.endCursor to fetch the next page. Every connection also exposes totalCount.

Performance

Identify inefficiencies in pipeline execution to reduce infrastructure costs and improve timeliness. Query the latest applied state across the DAG with environment { applied { models } }, or the run history of a single node with environment { applied { modelHistoricalRuns } }.

How long did each model take to run?

Understand how long it takes to build each model. Longer build times result in higher infrastructure costs and fresher data arriving later to stakeholders. Get a list of executed models and their execution time:
Then drill into the run history of the longest-running model with modelHistoricalRuns. You can look it up by uniqueId or by identifier (the model’s alias):
runId values returned by the Discovery API are Paradime Bolt schedule_run IDs. You can pass them to the Bolt API (for example boltRunStatus) to inspect the full run.

What’s the latest state of each model?

Retrieve the applied state of your models and how they arrived in that state: the status, timing, and error of the most recent run, plus the most recent successful run.
Use lastRunStatus to determine whether a run failed. lastRunError carries the warehouse adapter’s response message for the last execution, so it can be populated (for example with CREATE VIEW (0 processed)) even when the run succeeded.

What’s changed since the last run?

Determine whether a model actually needs to be rebuilt. A view with no code change, or a table whose code and upstream source data are both unchanged, does not need to run again. Unnecessary runs waste warehouse spend. Compare the rawCode in the applied state (what last ran) against the definition state (what is currently in your repository), and collect the model’s upstream sources:
If the code matches, check whether the upstream source data has been loaded since the model last ran by passing the ancestor uniqueId values into a sources query and comparing freshness.maxLoadedAt with the model’s executeCompletedAt:

Quality

Monitor data source freshness and test results to diagnose and resolve issues and drive trust in data. Combined with webhooks, these queries help you detect, investigate, and alert on incidents.

Which models and tests failed to run?

Filter on the latest status to get the models that failed to build and the tests that failed during their most recent execution. Helpful when diagnosing issues that result in delayed or incorrect data.
To review the historical failure rate of a given model, fetch its recent run history:

When was the data my model uses last refreshed?

Gauge the freshness of everything feeding a given model. First fetch the model’s transitive upstream nodes:
Then fetch the execution or load time for each ancestor type in a single follow-up query, passing the uniqueId values from the first result:

Are my data sources fresh?

Check source freshness to ensure the data loaded into your warehouse complies with expectations. The API returns the latest freshness check result alongside the declared freshness criteria.
You can also filter by outcome with filter: { freshnessStatus: "error" } (accepted values: pass, warn, error) to alert only on stale sources.

What’s the test coverage and status?

Data tests ensure stakeholders work with high-quality data. The Discovery API returns complete test results for an environment, with each test linked to the nodes it runs against via parents.

How is this model contracted and versioned?

Contracts enforce the shape of a model, and versions track discrete stages in its evolution. Retrieve the contract, constraints, version, and column schema of your public models:

Discovery

Find and understand relevant datasets with rich context and metadata. Query the latest applied or definition state, often in the downstream part of the DAG (for example, mart models).

What does this dataset and its columns mean?

Map a table or view in your warehouse back to the model in your dbt project and retrieve its meaning: the description, tags, and meta from your YAML files, plus per-column metadata from the warehouse catalog.

What’s the full data lineage at a model level?

Retrieve any model’s upstream dependencies. Unlike dbt Cloud’s Discovery API, ancestors, parents, and children return a single concrete node type, so no inline fragments are needed:
To reconstruct the entire DAG in one call, use the flat lineage feed instead. It returns every node with its direct parent edges:

Which metrics are available?

Query the metrics defined in your project for documentation purposes (for example, a data catalog) or to drive downstream tooling.
The definition state also exposes semanticModels, savedQueries, macros, and functions connections with the same query shape.

Governance

Audit data development and facilitate collaboration within and between teams.

Who is responsible for this model?

Groups associate models with an owner. Fetch a model’s groupName and access, then look up the owner details on the group:
You can also list every model owned by a team by filtering on the group directly:

Who can use this model?

The access field specifies the level of access for a given model: public, protected, or private. Public models function like APIs that other teams can build on. Retrieve the access level of every model:
Or retrieve only the public models:

Development

Understand dataset changes and usage and gauge impacts to inform project development.

How is this model used in downstream tools?

Exposures define how models are used in dashboards, notebooks, and other downstream tools. Query an exposure to see which nodes feed it, plus Paradime’s computed health rollup across all of its ancestors: worst source freshness, worst run status, and worst test result.
Filter by tool type with filter: { exposureType: "dashboard" } (accepted values: dashboard, notebook, analysis, ml, application).

How has this model changed over time?

View how a model evolved across recent runs, including the compiled SQL and the column schema and table stats captured for each execution. Pass withCatalog: true to include catalog data where it was generated for that run.

Which nodes depend on this data source?

Lineage begins with your data sources. For a given source, children returns the nodes that directly depend on it:
children returns direct dependents (one generation). To walk the full downstream tree, either iterate on each child’s children, or fetch the whole DAG once with the lineage feed and traverse parentIds in your own code.

Refresh the catalog

Warehouse catalog metadata (row counts, sizes, column types) is collected periodically. Trigger an on-demand refresh with the refreshCatalog mutation. This mutation requires the Catalog Admin capability on your API key.