> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lightdash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update dbt source

> Update an additional dbt source's name or connection.



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json patch /api/v1/projects/{projectUuid}/dbt-sources/{projectDbtSourceUuid}
openapi: 3.0.0
info:
  title: Lightdash API
  version: 0.3277.1
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Before you get started, you might need to create a Personal
    Access Token to authenticate via the API. You can create a token by
    following this guide: https://docs.lightdash.com/references/personal_tokens
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v1/projects/{projectUuid}/dbt-sources/{projectDbtSourceUuid}:
    patch:
      tags:
        - Projects
      summary: Update dbt source
      description: Update an additional dbt source's name or connection.
      operationId: UpdateProjectDbtSource
      parameters:
        - in: path
          name: projectUuid
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
        - in: path
          name: projectDbtSourceUuid
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiUpdateProjectDbtSource'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiProjectDbtSourceResponse'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    UUID:
      type: string
      format: uuid
      description: |-
        Stringified UUIDv4.
        See [RFC 4112](https://tools.ietf.org/html/rfc4122)
      pattern: >-
        [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
    ApiUpdateProjectDbtSource:
      properties:
        dbtConnection:
          $ref: '#/components/schemas/DbtProjectConfig'
        name:
          type: string
      type: object
    ApiProjectDbtSourceResponse:
      properties:
        results:
          $ref: '#/components/schemas/ProjectDbtSourceSummary'
        status:
          type: string
          enum:
            - ok
          nullable: false
      required:
        - results
        - status
      type: object
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
      description: |-
        The Error object is returned from the api any time there is an error.
        The message contains
    DbtProjectConfig:
      anyOf:
        - $ref: '#/components/schemas/DbtLocalProjectConfig'
        - $ref: '#/components/schemas/DbtCloudIDEProjectConfig'
        - $ref: '#/components/schemas/DbtGithubProjectConfig'
        - $ref: '#/components/schemas/DbtBitBucketProjectConfig'
        - $ref: '#/components/schemas/DbtGitlabProjectConfig'
        - $ref: '#/components/schemas/DbtAzureDevOpsProjectConfig'
        - $ref: '#/components/schemas/DbtNoneProjectConfig'
        - $ref: '#/components/schemas/DbtManifestProjectConfig'
    ProjectDbtSourceSummary:
      properties:
        hasCredentialError:
          type: boolean
        projectSubPath:
          type: string
          nullable: true
        branch:
          type: string
          nullable: true
        repository:
          type: string
          nullable: true
        type:
          allOf:
            - $ref: '#/components/schemas/DbtProjectType'
          nullable: true
        precedence:
          type: number
          format: double
        isPrimary:
          type: boolean
        name:
          type: string
        projectDbtSourceUuid:
          type: string
      required:
        - hasCredentialError
        - projectSubPath
        - branch
        - repository
        - type
        - precedence
        - isPrimary
        - name
        - projectDbtSourceUuid
      type: object
      description: >-
        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.
    AnyType:
      description: |-
        This AnyType is an alias for any
        The goal is to make it easier to identify any type in the codebase
        without having to eslint-disable all the time
        These are only used on legacy `any` types, don't use it for new types.
        This is added on a separate file to avoid circular dependencies.
    DbtLocalProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.DBT'
        target:
          type: string
        environment:
          items:
            $ref: '#/components/schemas/DbtProjectEnvironmentVariable'
          type: array
        selector:
          type: string
        profiles_dir:
          type: string
        project_dir:
          type: string
      required:
        - type
      type: object
      additionalProperties: true
    DbtCloudIDEProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.DBT_CLOUD_IDE'
        api_key:
          type: string
        environment_id:
          type: string
        discovery_api_endpoint:
          type: string
        tags:
          items:
            type: string
          type: array
        webhook_hmac_secret:
          type: string
      required:
        - type
        - api_key
        - environment_id
      type: object
      additionalProperties: true
    DbtGithubProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.GITHUB'
        target:
          type: string
        environment:
          items:
            $ref: '#/components/schemas/DbtProjectEnvironmentVariable'
          type: array
        selector:
          type: string
        authorization_method:
          type: string
          enum:
            - personal_access_token
            - installation_id
        personal_access_token:
          type: string
        installation_id:
          type: string
        repository:
          type: string
        branch:
          type: string
        project_sub_path:
          type: string
        host_domain:
          type: string
      required:
        - type
        - authorization_method
        - repository
        - branch
        - project_sub_path
      type: object
      additionalProperties: true
    DbtBitBucketProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.BITBUCKET'
        target:
          type: string
        environment:
          items:
            $ref: '#/components/schemas/DbtProjectEnvironmentVariable'
          type: array
        selector:
          type: string
        username:
          type: string
        personal_access_token:
          type: string
        repository:
          type: string
        branch:
          type: string
        project_sub_path:
          type: string
        host_domain:
          type: string
      required:
        - type
        - username
        - personal_access_token
        - repository
        - branch
        - project_sub_path
      type: object
      additionalProperties: true
    DbtGitlabProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.GITLAB'
        target:
          type: string
        environment:
          items:
            $ref: '#/components/schemas/DbtProjectEnvironmentVariable'
          type: array
        selector:
          type: string
        personal_access_token:
          type: string
        repository:
          type: string
        branch:
          type: string
        project_sub_path:
          type: string
        host_domain:
          type: string
      required:
        - type
        - personal_access_token
        - repository
        - branch
        - project_sub_path
      type: object
      additionalProperties: true
    DbtAzureDevOpsProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.AZURE_DEVOPS'
        target:
          type: string
        environment:
          items:
            $ref: '#/components/schemas/DbtProjectEnvironmentVariable'
          type: array
        selector:
          type: string
        personal_access_token:
          type: string
        organization:
          type: string
        project:
          type: string
        repository:
          type: string
        branch:
          type: string
        project_sub_path:
          type: string
      required:
        - type
        - personal_access_token
        - organization
        - project
        - repository
        - branch
        - project_sub_path
      type: object
      additionalProperties: true
    DbtNoneProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.NONE'
        target:
          type: string
        environment:
          items:
            $ref: '#/components/schemas/DbtProjectEnvironmentVariable'
          type: array
        selector:
          type: string
        hideRefreshButton:
          type: boolean
      required:
        - type
      type: object
      additionalProperties: true
    DbtManifestProjectConfig:
      properties:
        type:
          $ref: '#/components/schemas/DbtProjectType.MANIFEST'
        manifest:
          type: string
        hideRefreshButton:
          type: boolean
      required:
        - type
        - manifest
        - hideRefreshButton
      type: object
      additionalProperties: true
    DbtProjectType:
      enum:
        - dbt
        - dbt_cloud_ide
        - github
        - gitlab
        - bitbucket
        - azure_devops
        - none
        - manifest
      type: string
    DbtProjectType.DBT:
      enum:
        - dbt
      type: string
    DbtProjectEnvironmentVariable:
      properties:
        value:
          type: string
        key:
          type: string
      required:
        - value
        - key
      type: object
    DbtProjectType.DBT_CLOUD_IDE:
      enum:
        - dbt_cloud_ide
      type: string
    DbtProjectType.GITHUB:
      enum:
        - github
      type: string
    DbtProjectType.BITBUCKET:
      enum:
        - bitbucket
      type: string
    DbtProjectType.GITLAB:
      enum:
        - gitlab
      type: string
    DbtProjectType.AZURE_DEVOPS:
      enum:
        - azure_devops
      type: string
    DbtProjectType.NONE:
      enum:
        - none
      type: string
    DbtProjectType.MANIFEST:
      enum:
        - manifest
      type: string

````