Skip to content

Download artifacts from a Job Run

This is a guideline on how to download manifest.json and catalog.json from a Job Run by using dbt CLoud Administrative API, under the Retrieve Run Artifact endpoint. Therefore, we don't need to run dbt docs generate locally anymore.

In order to support dbt Cloud users, dbterd is now having multiple CLI options starting with --dbt-cloud to let us configure the connection to the complete dbt Cloud Job Run.


  • You have a dbt Cloud account with Team and Enterprise plans 💰
  • You have a job or go create a new job with a single step 🏃

    dbt docs generate
  • Make sure that you have at least 1 successful run ✅

1. Prepare the environment variables

Behind the scene, the API Endpoint will look like:


And the dbt Cloud's Job Rub will have the URL constructed as:


In the above:

URL Part Environment Variable CLI Option Description
host_url DBTERD_DBT_CLOUD_HOST_URL --dbt-cloud-host-url Host URL, also known as Access URL (Default to
account_id DBTERD_DBT_CLOUD_ACCOUNT_ID --dbt-cloud-account-id dbt Cloud Account ID
run_id DBTERD_DBT_CLOUD_RUN_ID --dbt-cloud-run-id dbt Cloud successful job run ID
api_version DBTERD_DBT_CLOUD_API_VERSION --dbt-cloud-api-version dbt Cloud API version (Default to v2)
path N/A N/A Artifact relative file path. You don't need to care about this part as dbterd managed it already

Besides, we need another one which is very important, the service token:

  • Go to Account settings / Service tokens. Click + New token
  • Enter Service token name e.g. "ST_dbterd"
  • Click Add and select Job Admin permission. Optionally, select the right project or all by default
  • Click Save
  • Copy token & Pass it to the Environment Variable (DBTERD_DBT_CLOUD_SERVICE_TOKEN) or the CLI Option (--dbt-cloud-service-token)

Finally, fill in your_value and execute the (Linux or Macos) command below:

export DBTERD_DBT_CLOUD_RUN_ID=your_value
export DBTERD_DBT_CLOUD_HOST_URL=your_value # optional, default =
export DBTERD_DBT_CLOUD_API_VERSION=your_value # optional, default = v2

Or in Powershell:

$env:DBTERD_DBT_CLOUD_HOST_URL="your_value" # optional, default =
$env:DBTERD_DBT_CLOUD_API_VERSION="your_value" # optional, default = v2

2. Generate ERD file

We're going to use --dbt-cloud option to tell dbterd to use dbt Cloud API with all above variables.

The command will be looks like:

dbterd run --dbt-cloud [-s <dbterd selection>]


You can not use --dbt option together with --dbt-cloud

and then, here is the sample console log:

dbterd - INFO - Run with dbterd==1.0.0 (
dbterd - INFO - Using dbt project dir at: C:\Sources\dbterd (
dbterd - INFO - Downloading...[URL: https://hidden/api/v2/accounts/hidden/runs/hidden/artifacts/manifest.json] (
dbterd - INFO - Completed [status: 200] (
dbterd - INFO - Downloading...[URL: https://hidden/api/v2/accounts/hidden/runs/hidden/artifacts/catalog.json] (
dbterd - INFO - Completed [status: 200] (
dbterd - INFO - Using dbt artifact dir at: hidden (
dbterd - INFO - Collected 4 table(s) and 3 relationship(s) (
dbterd - INFO - C:\Sources\dbterd\target/output.dbml (

Voila! Happy ERD 🎉!