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

# Solicitar correción

Endpoint para solicitar correcciones en un expediente KYB. Permite aprobar o rechazar secciones específicas, registrar comentarios y notificar al usuario. Si hay rechazos, el documento pasa a estado “Pendiente de Corrección”.

## Método y ruta

* POST `/expedientes/solicitar-correccion`

## Headers requeridos

* `NUFI-API-KEY` (string)
* `X-Workspace` (string UUID)

## Body

* `documentId` (string UUID, requerido)
* `secciones` (array\[object], requerido; 1–50 items)
  * `seccion` (string, requerido)
  * `estatus` (string, requerido; `Aceptada` | `Rechazada`)
  * `comentario` (string, requerido si `estatus = Rechazada`, máx. 500)
  * `entidadId` (string UUID, opcional)
  * `entidadReferencia` (string, opcional)
* `notificarUsuario` (boolean, default true)
* `mensajeGeneral` (string, opcional, máx. 1000)


## OpenAPI

````yaml POST /expedientes/solicitar-correccion
openapi: 3.0.0
info:
  title: KYB API
  version: 1.0.0
servers:
  - url: https://nufi.azure-api.net/kyb
    description: Productivo
  - url: https://nufi.azure-api.net/kyb/dev
    description: Sandbox
  - url: https://nufi-kyb-services-staging-azurefunction.azurewebsites.net/api
    description: Staging
security: []
paths:
  /expedientes/solicitar-correccion:
    post:
      tags:
        - default
      summary: solicitar corrección
      operationId: requestCorrections
      parameters:
        - name: NUFI-API-KEY
          in: header
          required: true
          schema:
            type: string
          example: '{{NUFI_API_KEY}}'
        - name: X-Workspace
          in: header
          required: true
          schema:
            type: string
          example: '{{WORKSPACE_ID}}'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - documentId
                - secciones
              properties:
                documentId:
                  type: string
                  format: uuid
                  description: >-
                    ID único del documento/expediente al que se solicitarán
                    correcciones.
                secciones:
                  type: array
                  minItems: 1
                  maxItems: 50
                  items:
                    type: object
                    required:
                      - seccion
                      - estatus
                    properties:
                      seccion:
                        type: string
                        description: Nombre de la sección a actualizar.
                        example: LegalRepresentative
                      estatus:
                        type: string
                        enum:
                          - Aceptada
                          - Rechazada
                        description: Estado de la sección.
                        example: Rechazada
                      comentario:
                        type: string
                        maxLength: 500
                        description: Comentario obligatorio si estatus es Rechazada.
                        example: >-
                          El documento de identificación está vencido. Por
                          favor, suba una identificación oficial vigente.
                      entidadId:
                        type: string
                        format: uuid
                        description: ID específico de la entidad (representante/sucursal).
                        example: 44ce9ddd-f5db-4684-a1e5-acf145d3e207
                      entidadReferencia:
                        type: string
                        description: Nombre o referencia de la entidad para identificación.
                        example: JUAN CARLOS PEREZ LOPEZ
                notificarUsuario:
                  type: boolean
                  default: true
                  description: >-
                    Si enviar notificación al usuario cuando hay secciones
                    rechazadas.
                mensajeGeneral:
                  type: string
                  maxLength: 1000
                  description: Mensaje general para el usuario.
                  example: Su expediente KYB requiere algunas correcciones menores.
            examples:
              default:
                value:
                  documentId: e735a41f-303b-4c4b-8217-ecc33c4b9e6a
                  secciones:
                    - seccion: LegalRepresentative
                      estatus: Rechazada
                      comentario: >-
                        El INE está vencido, favor de subir identificación
                        vigente
                      entidadReferencia: JUAN CARLOS PEREZ LOPEZ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Corrección solicitada correctamente
                  data:
                    type: object
                    properties:
                      expedienteId:
                        type: string
                        format: uuid
                      seccionesActualizadas:
                        type: integer
                      resumen:
                        type: object
                        properties:
                          aceptadas:
                            type: integer
                          rechazadas:
                            type: integer
                          entidadesAfectadas:
                            type: object
                            properties:
                              representantes:
                                type: integer
                              sucursales:
                                type: integer
                              expediente:
                                type: integer
                      secciones:
                        type: array
                        items:
                          type: object
                          properties:
                            seccion:
                              type: string
                            estatus:
                              type: string
                            comentario:
                              type: string
                            entidadReferencia:
                              type: string
                            entidadesResueltas:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  referencia:
                                    type: string
                                  coincidencia:
                                    type: string
                            fechaActualizacion:
                              type: string
                              format: date-time
                      notificacionEnviada:
                        type: boolean
                      linkCorreccion:
                        type: string
                        format: uri
                  warnings:
                    type: array
                    items:
                      type: object
                      properties:
                        seccion:
                          type: string
                        entidadReferencia:
                          type: string
                        mensaje:
                          type: string
                        entidadesAfectadas:
                          type: array
                          items:
                            type: string
              examples:
                successExactMatch:
                  value:
                    success: true
                    message: Corrección solicitada correctamente
                    data:
                      expedienteId: e735a41f-303b-4c4b-8217-ecc33c4b9e6a
                      seccionesActualizadas: 6
                      resumen:
                        aceptadas: 2
                        rechazadas: 4
                        entidadesAfectadas:
                          representantes: 3
                          sucursales: 1
                          expediente: 2
                      secciones:
                        - seccion: LegalRepresentative
                          estatus: Rechazada
                          comentario: El documento de identificación está vencido...
                          entidadReferencia: JUAN CARLOS PEREZ LOPEZ
                          entidadesResueltas:
                            - id: 44ce9ddd-f5db-4684-a1e5-acf145d3e207
                              referencia: JUAN CARLOS PEREZ LOPEZ
                              coincidencia: exacta
                          fechaActualizacion: '2025-10-27T15:30:00.000Z'
                        - seccion: ArticleIncorporation
                          estatus: Aceptada
                          entidadesResueltas:
                            - id: e735a41f-303b-4c4b-8217-ecc33c4b9e6a
                              referencia: Expediente
                              coincidencia: expediente
                          fechaActualizacion: '2025-10-27T15:30:00.000Z'
                      notificacionEnviada: true
                      linkCorreccion: >-
                        https://kyb.empresa.com/correcciones/e735a41f-303b-4c4b-8217-ecc33c4b9e6a
                    warnings: []
                successWithWarnings:
                  value:
                    success: true
                    message: Corrección solicitada con advertencias
                    data:
                      expedienteId: e735a41f-303b-4c4b-8217-ecc33c4b9e6a
                      seccionesActualizadas: 1
                      resumen:
                        aceptadas: 0
                        rechazadas: 1
                        entidadesAfectadas:
                          representantes: 2
                          sucursales: 0
                          expediente: 0
                      secciones:
                        - seccion: LegalRepresentative
                          estatus: Rechazada
                          comentario: Actualizar información de contacto
                          entidadReferencia: GARCIA
                          entidadesResueltas:
                            - id: 8504d100-3686-4eb7-9011-f0b25aba141f
                              referencia: MARIA FERNANDA GARCIA MARTINEZ
                              coincidencia: parcial
                            - id: a1234567-89ab-cdef-0123-456789abcdef
                              referencia: CARLOS GARCIA LOPEZ
                              coincidencia: parcial
                          fechaActualizacion: '2025-10-27T15:30:00.000Z'
                      notificacionEnviada: true
                      linkCorreccion: >-
                        https://kyb.empresa.com/correcciones/e735a41f-303b-4c4b-8217-ecc33c4b9e6a
                    warnings:
                      - seccion: LegalRepresentative
                        entidadReferencia: GARCIA
                        mensaje: >-
                          Se encontraron múltiples coincidencias, se aplicó a
                          todas las entidades que contienen 'GARCIA'
                        entidadesAfectadas:
                          - MARIA FERNANDA GARCIA MARTINEZ
                          - CARLOS GARCIA LOPEZ
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  Code:
                    type: integer
                    example: 400
                  Status:
                    type: string
                    example: bad_request
                  Message:
                    type: string
                    example: Error de validacion
                  Data:
                    type: array
                    items:
                      type: string
                    nullable: true
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  Code:
                    type: integer
                    example: 401
                  Status:
                    type: string
                    example: forbidden
                  Message:
                    type: string
                    example: No autorizado - Workspace inválido o API Key incorrecta
                  Data:
                    oneOf:
                      - type: object
                      - type: array
                        items:
                          type: string
                    nullable: true
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  Code:
                    type: integer
                    example: 404
                  Status:
                    type: string
                    example: not_found
                  Message:
                    type: string
                    example: Documento no encontrado
                  Data:
                    oneOf:
                      - type: object
                      - type: array
                        items:
                          type: string
                    nullable: true
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  Code:
                    type: integer
                    example: 422
                  Status:
                    type: string
                    example: unprocessable_entity
                  Message:
                    type: string
                    example: Error de validación de negocio
                  Data:
                    type: array
                    items:
                      type: string
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  Code:
                    type: integer
                    example: 500
                  Status:
                    type: string
                    example: error
                  Message:
                    type: string
                    example: Error interno del servidor
                  Data:
                    oneOf:
                      - type: object
                      - type: array
                        items:
                          type: string
                    nullable: true

````