> ## 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.

# Compile a deployment's data model and report compilation errors

Asks the branch's own Cube runtime for `GET /cubejs-api/v1/meta` — the same call the console makes in dev mode — so the verdict is the one that branch's API would give. With neither parameter it validates the deploy branch (production). `branchName` validates a named branch, and `devMode=true` validates the caller's active dev-mode branch; the two are mutually exclusive. Answers 200 with `valid: false` and the compiler's errors when the model doesn't compile — a broken model is a result, not a request error.


## OpenAPI

````yaml /api-reference/api.yaml get /build/api/v1/deployments/{deploymentId}/data-model/validate
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:
  /build/api/v1/deployments/{deploymentId}/data-model/validate:
    get:
      tags:
        - Data Model
      summary: Compile a deployment's data model and report compilation errors
      operationId: validateDataModel
      parameters:
        - in: path
          name: deploymentId
          required: true
          schema:
            type: integer
        - in: query
          name: branchName
          required: false
          schema:
            type: string
        - in: query
          name: devMode
          required: false
          schema:
            type: boolean
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataModelValidationResponse'
          description: ''
components:
  schemas:
    DataModelValidationResponse:
      properties:
        branchName:
          type: string
        cubesCount:
          oneOf:
            - type: integer
            - type: 'null'
        deploymentId:
          type: integer
        errors:
          items:
            $ref: '#/components/schemas/DataModelValidationError'
          type: array
        mode:
          $ref: '#/components/schemas/DataModelValidationResponseMode'
        valid:
          type: boolean
      required:
        - deploymentId
        - branchName
        - mode
        - valid
        - errors
      type: object
    DataModelValidationError:
      properties:
        fileName:
          oneOf:
            - type: string
            - type: 'null'
        message:
          type: string
      required:
        - message
      type: object
    DataModelValidationResponseMode:
      enum:
        - production
        - dev_mode
      type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````