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

# Actualiza mapeo/correcciones y re-valida (08 §Paso 2 y 3)



## OpenAPI

````yaml /openapi/v1.json patch /v1/imports/{id}
openapi: 3.0.0
info:
  title: Finzaria API
  description: >-
    API REST de Finzaria — finanzas personales para México, dev-first y
    agent-first. Autentícate con tu API key bxm_ (o un token OAuth).
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.finzaria.com/v1
    description: Producción
security: []
tags: []
paths:
  /v1/imports/{id}:
    patch:
      tags:
        - imports
      summary: Actualiza mapeo/correcciones y re-valida (08 §Paso 2 y 3)
      operationId: ImportsController_patch
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchImportDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImportViewDto'
      security:
        - bearer: []
components:
  schemas:
    PatchImportDto:
      type: object
      properties:
        mapping:
          type: object
          additionalProperties: true
          description: Mapeo de columnas y opciones.
        options:
          type: object
          additionalProperties: true
        corrections:
          type: object
          additionalProperties: true
          description: >-
            Correcciones/exclusiones por fila: { rowIndex: { description?,
            amount?, date?, category?, excluded?, included? } }
        categoryRenames:
          type: object
          additionalProperties: true
          description: >-
            Renombres/mapeos de categorías: { "texto del archivo": "ruta de
            categoría" } o { "origen": null } para dejar sin categoría.
    ImportViewDto:
      type: object
      properties:
        id:
          type: string
        accountId:
          type: string
        filename:
          type: string
        status:
          type: string
          enum:
            - draft
            - committed
            - undone
        mapping:
          type: object
          additionalProperties: true
        columns:
          type: array
          items:
            $ref: '#/components/schemas/ImportColumnDto'
        rows:
          type: array
          items:
            type: object
            additionalProperties: true
        newCategories:
          type: array
          items:
            $ref: '#/components/schemas/ImportNewCategoryDto'
        stats:
          $ref: '#/components/schemas/ImportStatsDto'
        detected:
          type: object
          description: Encoding/delimitador detectados y filas de preámbulo saltadas.
          additionalProperties: true
      required:
        - id
        - accountId
        - filename
        - status
        - mapping
        - columns
        - rows
        - newCategories
        - stats
        - detected
    ImportColumnDto:
      type: object
      properties:
        index:
          type: number
        header:
          type: string
        samples:
          description: Primeros valores de la columna (muestra).
          type: array
          items:
            type: string
        field:
          type: string
          description: Campo destino sugerido/confirmado.
      required:
        - index
        - header
        - samples
        - field
    ImportNewCategoryDto:
      type: object
      properties:
        name:
          type: string
        count:
          type: number
      required:
        - name
        - count
    ImportStatsDto:
      type: object
      properties:
        total:
          type: number
        ready:
          type: number
        errors:
          type: number
        duplicates:
          type: number
        excluded:
          type: number
      required:
        - total
        - ready
        - errors
        - duplicates
        - excluded
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT (Supabase Auth)
      type: http

````