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

# AI-assisted SQL refinement

> Uses Claude to refine an existing SQL model based on a natural language instruction.



## OpenAPI

````yaml /api-reference/catalog-api.json post /transformations/refine
openapi: 3.1.0
info:
  title: Strattum Catalog API
  description: Expõe a estrutura do data lake — camadas, conectores e tabelas.
  version: 0.1.0
servers: []
security: []
paths:
  /transformations/refine:
    post:
      tags:
        - transformations
      summary: AI-assisted SQL refinement
      description: >-
        Uses Claude to refine an existing SQL model based on a natural language
        instruction.
      operationId: refine_transformation_transformations_refine_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefineRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefineResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    RefineRequest:
      properties:
        current_sql:
          type: string
          title: Current Sql
        instruction:
          type: string
          title: Instruction
        source_schemas:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Source Schemas
        source_tables:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Source Tables
        available_tables:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Available Tables
      type: object
      required:
        - current_sql
        - instruction
      title: RefineRequest
    RefineResponse:
      properties:
        sql:
          type: string
          title: Sql
        changes:
          type: string
          title: Changes
        reasoning:
          type: string
          title: Reasoning
          default: ''
        question:
          type: string
          title: Question
          default: ''
      type: object
      required:
        - sql
        - changes
      title: RefineResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````