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

# UpdateDatasetSchemaAPI updates a dataset's schema (add/remove/rename columns,


> alter types) and/or its class ('table' or 'scratch' via the \`class\` field).




## OpenAPI

````yaml /api/openapi.json post /v1/datasets/{datasetSlug}/schema
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, and experiments. Authenticate with
    a Bearer API key (erdo_api_...) or scoped token (erdo_token_...).
  version: '2026-07-25'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/datasets/{datasetSlug}/schema:
    post:
      summary: >
        UpdateDatasetSchemaAPI updates a dataset's schema (add/remove/rename
        columns,
      description: >
        alter types) and/or its class ('table' or 'scratch' via the \`class\`
        field).
      operationId: POST:mcp.UpdateDatasetSchemaAPI
      parameters:
        - allowEmptyValue: true
          explode: false
          in: path
          name: datasetSlug
          required: true
          schema:
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              properties:
                class:
                  description: >
                    (analysis by-product, hidden from listings by default). Omit
                    to leave the class unchanged. Use this to promote a durable
                    table that was mistakenly filed as scratch, or to demote
                    one. A class-only update needs no operations.
                  title: >
                    Class optionally reclassifies the dataset: 'table' (durable)
                    or 'scratch'
                  type: string
                dataset_slug:
                  type: string
                operations:
                  items:
                    $ref: '#/components/schemas/mcp.UpdateSchemaOperation'
                  type: array
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  class:
                    description: >
                      'scratch'; empty for an unclassified legacy row left
                      unchanged).
                    title: >
                      Class is the dataset's structural class after the update
                      ('table' or
                    type: string
                  columns_added:
                    format: int64
                    type: integer
                  columns_removed:
                    format: int64
                    type: integer
                  columns_renamed:
                    format: int64
                    type: integer
                  columns_retyped:
                    format: int64
                    type: integer
                  current_columns:
                    items:
                      type: string
                    type: array
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    mcp.UpdateSchemaOperation:
      properties:
        column:
          type: string
        column_type:
          type: string
        columns:
          description: >
            replaces any existing contract wholesale — the columns the write
            path will then enforce on this table-class dataset.
          items:
            $ref: '#/components/schemas/mcp.DeclaredSchemaColumn'
          title: >
            Columns is the full declared-schema contract for a declare_schema
            op. It
          type: array
        new_name:
          type: string
        type:
          type: string
      title: |
        UpdateSchemaOperation describes a single schema modification.
      type: object
    mcp.DeclaredSchemaColumn:
      properties:
        description:
          type: string
        name:
          type: string
        required:
          type: boolean
        type:
          type: string
      title: |
        DeclaredSchemaColumn is one column in a declare_schema contract.
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````