> ## Documentation Index
> Fetch the complete documentation index at: https://cubed3-mikhail-cub-3599-rebuild-driver-on-config-change.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List dbt syncs for a deployment



## OpenAPI

````yaml /api-reference/api.yaml get /api/v1/deployments/{deploymentId}/dbt-sync
openapi: 3.1.0
info:
  title: Cube Platform API
  version: 1.0.0
  description: >-
    Programmatically manage Cube: deployments and everything scoped to them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
    Data-model

    authoring, dev mode, branches, and uploads live under /build/api/v1 — same
    host and

    token, routed to the build pods.
servers:
  - url: https://{tenant}.cubecloud.dev
    description: Your tenant host. Replace the whole host if you use a custom domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Deployment Creation
  - name: Environments
  - name: Env Variables
  - name: Regions
  - name: Data Model
  - name: Data Model Uploads
  - name: GitHub
  - name: GitHub Connection
  - name: dbt Sync
  - name: Folders
  - name: Reports
  - name: Workbooks
  - name: Notifications
  - name: Workspace
  - name: Users
  - name: Users Admin
  - name: User Attributes
  - name: User Attribute Values
  - name: Tenant Settings
  - name: OAuth Integrations
  - name: User OAuth Tokens
  - name: OIDC Token Configs
  - name: App Theme
  - name: Embed
  - name: Embed Tenants
  - name: Dashboard Embed Access
  - name: Usage Analytics
  - name: OpenAPI Spec
paths:
  /api/v1/deployments/{deploymentId}/dbt-sync:
    get:
      tags:
        - dbt Sync
      summary: List dbt syncs for a deployment
      operationId: listDbtSyncs
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: integer
        - in: query
          name: status
          schema:
            oneOf:
              - $ref: '#/components/schemas/DbtSyncRunsQueryStatus'
              - type: 'null'
        - in: query
          name: trigger
          schema:
            oneOf:
              - $ref: '#/components/schemas/DbtSyncRunsQueryTrigger'
              - type: 'null'
        - in: query
          name: after
          schema:
            type: string
        - in: query
          name: first
          schema:
            minimum: 1
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DbtSyncRunListResponse'
          description: ''
components:
  schemas:
    DbtSyncRunsQueryStatus:
      enum:
        - RUNNING
        - COMPLETED
        - FAILED
        - CANCELLED
        - UNKNOWN
      type: string
    DbtSyncRunsQueryTrigger:
      enum:
        - manual
        - api
        - webhook
        - agent
        - unknown
      type: string
    DbtSyncRunListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/DbtSyncRun'
          type: array
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
      required:
        - items
        - pageInfo
      type: object
    DbtSyncRun:
      properties:
        branchName:
          description: The Cube branch this sync wrote its generated cubes to.
          type: string
        completedAt:
          oneOf:
            - type: string
            - type: 'null'
          description: >-
            When the sync finished, as an ISO 8601 timestamp, or null while it
            is still running. This is stamped by the process that ran the sync
            whereas startedAt is stamped by the process that launched it — two
            different clocks — so for a run that failed moments after starting,
            completedAt can even precede startedAt. Use durationMs to show how
            long a run took rather than subtracting these.
        deploymentId:
          type: integer
        durationMs:
          oneOf:
            - type: integer
            - type: 'null'
          description: >-
            How long the sync took, in milliseconds, and the value to use when
            showing a duration. Measured from a single clock, so it is never
            negative — prefer it over subtracting startedAt from completedAt,
            which can disagree with it by a small skew.
        errorMessage:
          oneOf:
            - type: string
            - type: 'null'
          description: Why the sync stopped. Present only for a failed run.
        failedPhase:
          oneOf:
            - type: string
            - type: 'null'
          description: The phase that failed, e.g. dbt-compile.
        gitRef:
          oneOf:
            - type: string
            - type: 'null'
          description: The dbt-repository ref this sync was run against, when pinned.
        lastStage:
          oneOf:
            - type: string
            - type: 'null'
          description: The pipeline stage the run reached, e.g. COMPILING_DBT.
        phases:
          oneOf:
            - items:
                $ref: '#/components/schemas/DbtSyncRunPhase'
              type: array
            - type: 'null'
          description: >-
            Per-phase timings, in the order they ran. Absent while the sync is
            running.
        startedAt:
          description: >-
            When the sync started, as an ISO 8601 timestamp. See completedAt
            before comparing the two.
          type: string
        stats:
          oneOf:
            - $ref: '#/components/schemas/DbtSyncRunStats'
            - type: 'null'
        status:
          description: >-
            RUNNING, COMPLETED, FAILED, CANCELLED or UNKNOWN. UNKNOWN means the
            outcome could not be established (the run’s record was lost and the
            workflow engine no longer knows the workflow) and is deliberately
            distinct from FAILED. Treat an unrecognized value as non-terminal.
          type: string
        syncJobId:
          type: string
        trigger:
          description: >-
            What started the sync: manual (the Cube Cloud UI), api (this REST
            API), webhook (a push to the dbt repository), agent (Cube AI), or
            unknown.
          type: string
        triggerContext:
          oneOf:
            - $ref: '#/components/schemas/DbtSyncRunTriggerContext'
            - type: 'null'
        userId:
          oneOf:
            - type: integer
            - type: 'null'
          description: The Cube user who started the sync, when a user started it.
      required:
        - syncJobId
        - deploymentId
        - status
        - trigger
        - branchName
        - startedAt
      type: object
    PageInfo:
      properties:
        endCursor:
          oneOf:
            - type: string
            - type: 'null'
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          oneOf:
            - type: string
            - type: 'null'
      required:
        - hasNextPage
        - hasPreviousPage
      type: object
    DbtSyncRunPhase:
      properties:
        durationMs:
          description: How long the phase took, in milliseconds.
          type: integer
        outcome:
          description: ok or failed.
          type: string
        phase:
          description: Phase token, e.g. repo-clone, dbt-deps, dbt-compile.
          type: string
        startedOffsetMs:
          description: When the phase began, in milliseconds after the sync started.
          type: integer
      required:
        - phase
        - startedOffsetMs
        - durationMs
        - outcome
      type: object
    DbtSyncRunStats:
      properties:
        cubeCount:
          oneOf:
            - type: integer
            - type: 'null'
          description: How many cubes the sync generated.
        generatedFileCount:
          oneOf:
            - type: integer
            - type: 'null'
          description: How many files the sync wrote to the branch it created.
        macros:
          oneOf:
            - type: integer
            - type: 'null'
          description: dbt macros found in the manifest.
        models:
          oneOf:
            - type: integer
            - type: 'null'
          description: dbt models found in the manifest.
        sources:
          oneOf:
            - type: integer
            - type: 'null'
          description: dbt sources found in the manifest.
      type: object
    DbtSyncRunTriggerContext:
      properties:
        headSha:
          oneOf:
            - type: string
            - type: 'null'
        pushedBranch:
          oneOf:
            - type: string
            - type: 'null'
        targetBranch:
          oneOf:
            - type: string
            - type: 'null'
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````