---
title: "Add dbt source"
method: POST
path: "/api/v1/projects/{projectUuid}/dbt-sources"
tags: ["Projects"]
---

# Add dbt source

`POST /api/v1/projects/{projectUuid}/dbt-sources`

Add an additional dbt source to a project.

## Path parameters

- `projectUuid` string, uuid, required — Stringified UUIDv4. See [RFC 4112](https://tools.ietf.org/html/rfc4122)

## Request body

- ApiCreateProjectDbtSource
  - `dbtConnection` union, required
    - DbtLocalProjectConfig
      - `type` 'dbt', required
      - `target` string
      - `environment` DbtProjectEnvironmentVariable[]
        - `value` string, required
        - `key` string, required
      - `selector` string
      - `profiles_dir` string
      - `project_dir` string
    - DbtCloudIDEProjectConfig
      - `type` 'dbt_cloud_ide', required
      - `api_key` string, required
      - `environment_id` string, required
      - `discovery_api_endpoint` string
      - `tags` string[]
      - `webhook_hmac_secret` string
    - DbtGithubProjectConfig
      - `type` 'github', required
      - `target` string
      - `environment` DbtProjectEnvironmentVariable[]
        - `value` string, required
        - `key` string, required
      - `selector` string
      - `authorization_method` 'personal_access_token' | 'installation_id', required
      - `personal_access_token` string
      - `installation_id` string
      - `repository` string, required
      - `branch` string, required
      - `project_sub_path` string, required
      - `host_domain` string
    - DbtBitBucketProjectConfig
      - `type` 'bitbucket', required
      - `target` string
      - `environment` DbtProjectEnvironmentVariable[]
        - `value` string, required
        - `key` string, required
      - `selector` string
      - `username` string, required
      - `personal_access_token` string, required
      - `repository` string, required
      - `branch` string, required
      - `project_sub_path` string, required
      - `host_domain` string
    - DbtGitlabProjectConfig
      - `type` 'gitlab', required
      - `target` string
      - `environment` DbtProjectEnvironmentVariable[]
        - `value` string, required
        - `key` string, required
      - `selector` string
      - `personal_access_token` string, required
      - `repository` string, required
      - `branch` string, required
      - `project_sub_path` string, required
      - `host_domain` string
    - DbtAzureDevOpsProjectConfig
      - `type` 'azure_devops', required
      - `target` string
      - `environment` DbtProjectEnvironmentVariable[]
        - `value` string, required
        - `key` string, required
      - `selector` string
      - `personal_access_token` string, required
      - `organization` string, required
      - `project` string, required
      - `repository` string, required
      - `branch` string, required
      - `project_sub_path` string, required
    - DbtNoneProjectConfig
      - `type` 'none', required
      - `target` string
      - `environment` DbtProjectEnvironmentVariable[]
        - `value` string, required
        - `key` string, required
      - `selector` string
      - `hideRefreshButton` boolean
    - DbtManifestProjectConfig
      - `type` 'manifest', required
      - `manifest` string, required
      - `hideRefreshButton` boolean, required
  - `name` string, required

## Response `201`

Created

- ApiProjectDbtSourceResponse
  - `results` ProjectDbtSourceSummary, required — Non-sensitive view of a dbt source for API responses — never includes the decrypted connection (which holds credentials). The primary source is synthesised from the project's own dbt_connection. `repository`, `branch` and `projectSubPath` are the git-backed source's identity (null for non-git connections); they are safe to expose — only secrets are stripped. `hasCredentialError` is always `false` for the synthesised primary source. See `ProjectDbtSource` for what it means on an additional source.
    - `hasCredentialError` boolean, required
    - `projectSubPath` string, nullable, required
    - `branch` string, nullable, required
    - `repository` string, nullable, required
    - `type` 'dbt' | 'dbt_cloud_ide' | 'github' | 'gitlab' | 'bitbucket' | 'azure_devops' | 'none' | 'manifest', required
    - `precedence` number, double, required
    - `isPrimary` boolean, required
    - `name` string, required
    - `projectDbtSourceUuid` string, required
  - `status` 'ok', required

## Other responses

- `default` — Error

---

[API](https://skmtc.net/lightdash/apis/lightdash-api.md) · [All operations](https://skmtc.net/lightdash/apis/lightdash-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lightdash/lightdash-api/versions/40c933755c9a/schema)
