> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cube.dev/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 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: 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
              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.
            - type: 'null'
        deploymentId:
          type: integer
        durationMs:
          oneOf:
            - type: integer
              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.
            - type: 'null'
        errorMessage:
          oneOf:
            - type: string
              description: Why the sync stopped. Present only for a failed run.
            - type: 'null'
        failedPhase:
          oneOf:
            - type: string
              description: The phase that failed, e.g. dbt-compile.
            - type: 'null'
        gitRef:
          oneOf:
            - type: string
              description: The dbt-repository ref this sync was run against, when pinned.
            - type: 'null'
        lastStage:
          oneOf:
            - type: string
              description: The pipeline stage the run reached, e.g. COMPILING_DBT.
            - type: 'null'
        phases:
          oneOf:
            - items:
                $ref: '#/components/schemas/DbtSyncRunPhase'
              type: array
              description: >-
                Per-phase timings, in the order they ran. Absent while the sync
                is running.
            - type: 'null'
        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
              description: The Cube user who started the sync, when a user started it.
            - type: 'null'
      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
              description: How many cubes the sync generated.
            - type: 'null'
        generatedFileCount:
          oneOf:
            - type: integer
              description: How many files the sync wrote to the branch it created.
            - type: 'null'
        macros:
          oneOf:
            - type: integer
              description: dbt macros found in the manifest.
            - type: 'null'
        models:
          oneOf:
            - type: integer
              description: dbt models found in the manifest.
            - type: 'null'
        sources:
          oneOf:
            - type: integer
              description: dbt sources found in the manifest.
            - type: 'null'
      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>`.'

````