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

# Apply destination column types

> Applies column types to an all-string destination. Destination-first: if data has already landed the table is migrated before the config changes — postgres retypes in place, snowflake/databricks validate every landed value with TRY_CAST and then swap the table. Any landed value that will not cast fails the whole apply with the column named and nothing changed. On success the pipeline definition is updated as a new version. The migration locks or replaces the table — do not apply while a run is in flight.



## OpenAPI

````yaml /openapi.yaml post /api/v1/pipeline/dest-types
openapi: 3.0.3
info:
  title: Datris API
  description: >
    REST API for the Datris AI Data Platform. Ingest, validate, transform,
    store, and retrieve data.


    For AI agent integration, use the [MCP
    Server](https://docs.datris.ai/mcp-server) instead.
  version: 1.28.0
  contact:
    name: Datris
    url: https://datris.ai
  license:
    name: Apache 2.0
servers:
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/pipeline/dest-types:
    post:
      tags:
        - Pipelines
      summary: Apply destination column types
      description: >-
        Applies column types to an all-string destination. Destination-first: if
        data has already landed the table is migrated before the config changes
        — postgres retypes in place, snowflake/databricks validate every landed
        value with TRY_CAST and then swap the table. Any landed value that will
        not cast fails the whole apply with the column named and nothing
        changed. On success the pipeline definition is updated as a new version.
        The migration locks or replaces the table — do not apply while a run is
        in flight.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - pipeline
                - fields
              properties:
                pipeline:
                  type: string
                fields:
                  type: array
                  description: >-
                    Every destination column with its intended type (keep a
                    column as-is with type string).
                  items:
                    type: object
                    required:
                      - name
                      - type
                    properties:
                      name:
                        type: string
                      type:
                        type: string
                        enum:
                          - string
                          - boolean
                          - int
                          - bigint
                          - float
                          - double
                          - date
                          - timestamp
      responses:
        '200':
          description: What was applied
          content:
            application/json:
              schema:
                type: object
                properties:
                  pipeline:
                    type: string
                  migrated:
                    type: boolean
                    description: True when a landed table was retyped (vs. config-only).
                  version:
                    type: integer
                  fields:
                    type: array
                    items:
                      type: object
        '400':
          description: >-
            Unsupported destination, already typed, invalid fields, or a landed
            value would not cast
        '500':
          description: Error
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Optional API key for authentication (enabled via application.yaml)

````