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

# Actualizar un Limite

> Use este endpoint para actualizar parcialmente un limite de gasto. Solo los campos proporcionados son actualizados. limitType y currency son inmutables y no pueden ser cambiados.



## OpenAPI

````yaml es/openapi/v3-current/tracer.yaml patch /v1/limits/{id}
openapi: 3.1.0
info:
  title: API de Tracer
  description: >-
    Referencia completa de la API para los servicios de Tracer, incluyendo
    validacion de transacciones, gestion de reglas, limites de gasto y eventos
    de auditoria para cumplimiento SOX/GLBA.
  version: 1.0.1
servers:
  - url: https://tracer.sandbox.lerian.net
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Health API
    description: >-
      Endpoints de verificacion de salud para sondas de vida y preparacion.
      Estos endpoints no requieren autenticacion.
  - name: Validations API
    description: >-
      Endpoints de validación de transacciones. El objetivo de rendimiento es
      inferior a 80ms (p99). Las validaciones son idempotentes por `requestId` —
      una solicitud duplicada devuelve el resultado en caché con HTTP 200,
      mientras que una solicitud nueva devuelve HTTP 201. No se requiere
      encabezado de idempotencia.
  - name: Rules API
    description: >-
      Endpoints de gestion de reglas de validacion. Las reglas utilizan
      expresiones CEL (Common Expression Language).
  - name: Limits API
    description: >-
      Endpoints de gestion de limites de gasto. Los limites controlan los montos
      de transacciones por alcance y periodo.
  - name: Reservations API
    description: >-
      Endpoints de reserva de capacidad de transacción en dos fases. Una reserva
      retiene capacidad frente a los límites de gasto; una confirmación la
      consolida y una liberación la devuelve. Confirmar y liberar son
      idempotentes.
  - name: Audit Events API
    description: >-
      Endpoints de rastro de auditoria para cumplimiento SOX/GLBA. Todas las
      decisiones de validacion y cambios de configuracion son registrados.
paths:
  /v1/limits/{id}:
    patch:
      tags:
        - Limits API
      summary: Actualizar un Limite
      description: >-
        Use este endpoint para actualizar parcialmente un limite de gasto. Solo
        los campos proporcionados son actualizados. limitType y currency son
        inmutables y no pueden ser cambiados.
      operationId: updateLimit
      parameters:
        - $ref: '#/components/parameters/LimitId'
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/XApiKey'
        - $ref: '#/components/parameters/XRequestId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLimitInput'
            example:
              maxAmount: '75000.00'
      responses:
        '200':
          description: Indica que el limite fue actualizado exitosamente.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Limit'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0001:
                  $ref: '#/components/examples/Error0001'
                Error0002:
                  $ref: '#/components/examples/Error0002'
                Error0003:
                  $ref: '#/components/examples/Error0003'
                Error0007:
                  $ref: '#/components/examples/Error0007'
                Error0123:
                  $ref: '#/components/examples/Error0123'
                Error0124:
                  $ref: '#/components/examples/Error0124'
                Error0125:
                  $ref: '#/components/examples/Error0125'
                Error0126:
                  $ref: '#/components/examples/Error0126'
                Error0127:
                  $ref: '#/components/examples/Error0127'
                Error0129:
                  $ref: '#/components/examples/Error0129'
                Error0130:
                  $ref: '#/components/examples/Error0130'
                Error0131:
                  $ref: '#/components/examples/Error0131'
        '401':
          description: No autorizado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                ErrorUnauthenticated:
                  $ref: '#/components/examples/ErrorUnauthenticated'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0120:
                  $ref: '#/components/examples/Error0120'
        '409':
          description: Conflicto de nombre de límite
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0304:
                  $ref: '#/components/examples/Error0304'
        '500':
          description: Error Interno del Servidor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorFormat'
              examples:
                Error0004:
                  $ref: '#/components/examples/Error0004'
components:
  parameters:
    LimitId:
      name: id
      in: path
      description: >-
        El identificador unico del limite que desea recuperar, actualizar o
        eliminar.
      required: true
      example: 019c96a0-0c0d-7915-84b9-e497bfee9916
      schema:
        type: string
        format: uuid
    ContentType:
      name: Content-Type
      in: header
      description: El tipo de medio del recurso. Debe ser `application/json`.
      required: true
      example: application/json
      schema:
        type: string
    XApiKey:
      name: X-API-Key
      in: header
      description: >-
        La clave API para autenticacion. **Este encabezado es requerido para
        todos los endpoints excepto verificaciones de salud**.
      required: true
      schema:
        type: string
    XRequestId:
      name: X-Request-Id
      in: header
      description: Un identificador unico usado para rastrear y seguir cada solicitud.
      required: false
      example: 019c96a0-10ce-75fc-a273-dc799079a99c
      schema:
        type: string
        format: uuid
  schemas:
    UpdateLimitInput:
      type: object
      description: >-
        Entrada para actualizar un limite. Al menos un campo debe ser
        proporcionado. limitType y currency son inmutables.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
        description:
          type: string
          maxLength: 1000
        maxAmount:
          type: string
          pattern: ^(?:[1-9]\d*(?:\.\d{1,2})?|0\.(?:0[1-9]|[1-9]\d))$
          example: '1000.00'
          description: Nuevo monto decimal maximo.
        scopes:
          type: array
          minItems: 1
          maxItems: 100
          items:
            $ref: '#/components/schemas/Scope'
        activeTimeStart:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          example: '09:00'
          description: Nuevo inicio de la ventana diaria activa en formato HH:mm.
        activeTimeEnd:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          example: '17:00'
          description: Nuevo fin de la ventana diaria activa en formato HH:mm.
        customStartDate:
          type: string
          format: date-time
          description: Nueva fecha inicial para limites CUSTOM.
        customEndDate:
          type: string
          format: date-time
          description: Nueva fecha final para limites CUSTOM.
    Limit:
      type: object
      description: Limite de gasto.
      properties:
        limitId:
          type: string
          format: uuid
          description: Identificador unico del limite.
        name:
          type: string
          description: Nombre de limite legible para humanos.
          maxLength: 255
        description:
          type: string
          maxLength: 1000
          description: Proposito y explicacion de uso del limite.
        limitType:
          type: string
          enum:
            - DAILY
            - WEEKLY
            - MONTHLY
            - CUSTOM
            - PER_TRANSACTION
          description: Tipo de limite (inmutable despues de la creacion).
        maxAmount:
          type: string
          pattern: ^(?:[1-9]\d*(?:\.\d{1,2})?|0\.(?:0[1-9]|[1-9]\d))$
          example: '1000.00'
          description: Monto decimal maximo.
        currency:
          type: string
          minLength: 3
          maxLength: 3
          description: Codigo de moneda ISO 4217 (inmutable despues de la creacion).
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/Scope'
          description: Alcances que determinan a que transacciones aplica este limite.
        status:
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - INACTIVE
            - DELETED
          description: Estado del ciclo de vida del limite.
        activeTimeStart:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          example: '09:00'
          description: >-
            Inicio de la ventana diaria activa en formato HH:mm. Omitido cuando
            el limite esta activo todo el dia.
        activeTimeEnd:
          type: string
          pattern: ^([01]\d|2[0-3]):[0-5]\d$
          example: '17:00'
          description: >-
            Fin de la ventana diaria activa en formato HH:mm. Omitido cuando el
            limite esta activo todo el dia.
        customStartDate:
          type: string
          format: date-time
          description: Fecha inicial para limites CUSTOM.
        customEndDate:
          type: string
          format: date-time
          description: Fecha final para limites CUSTOM.
        resetAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            Cuando el contador del limite se reinicia. Null para limites
            PER_TRANSACTION.
        createdAt:
          type: string
          format: date-time
          description: Cuando se creo el limite.
        updatedAt:
          type: string
          format: date-time
          description: Cuando se modifico el limite por ultima vez.
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: Cuando se elimino el limite (null si no fue eliminado).
    ErrorFormat:
      type: object
      description: El mensaje de error de respuesta.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: Un identificador unico y estable para el error.
        title:
          type: string
          description: Un breve resumen del problema.
        message:
          type: string
          description: Orientacion detallada para resolver el error.
        fields:
          type: object
          additionalProperties: true
          description: Informacion adicional sobre los campos que causaron el error.
    Scope:
      type: object
      description: >-
        Definicion de alcance para reglas y limites. Al menos un campo debe ser
        establecido.
      properties:
        segmentId:
          type: string
          format: uuid
          description: Aplicar a transacciones de este segmento.
        portfolioId:
          type: string
          format: uuid
          description: Aplicar a transacciones de este portafolio.
        accountId:
          type: string
          format: uuid
          description: Aplicar a transacciones de esta cuenta especifica.
        merchantId:
          type: string
          format: uuid
          description: Aplicar a transacciones a este comerciante especifico.
        transactionType:
          type: string
          enum:
            - CARD
            - WIRE
            - PIX
            - CRYPTO
          description: Aplicar solo a este tipo de transaccion.
        subType:
          type: string
          maxLength: 50
          description: Aplicar solo a este subTipo de transaccion.
  examples:
    Error0001:
      summary: Generic Validation Error
      value:
        code: TRC-0001
        title: Validation Error
        message: >-
          Field validation failed. Please verify the provided data and try
          again.
    Error0002:
      summary: At Least One Field Required
      value:
        code: TRC-0002
        title: At Least One Field Required
        message: >-
          At least one field must be provided for update. Please include at
          least one field and try again.
    Error0003:
      summary: Invalid Request Body
      value:
        code: TRC-0003
        title: Invalid Request Body
        message: >-
          The request body is invalid or malformed. Please verify the JSON
          format and try again.
    Error0007:
      summary: Invalid Path Parameter
      value:
        code: TRC-0007
        title: Invalid Path Parameter
        message: >-
          The provided ID is not a valid UUID format. Please verify the ID and
          try again.
    Error0123:
      summary: Amount Must Be Positive
      value:
        code: TRC-0123
        title: Invalid Amount
        message: >-
          The maxAmount must be a positive decimal string. Please provide a
          valid decimal amount.
    Error0124:
      summary: Invalid Currency Code
      value:
        code: TRC-0124
        title: Invalid Currency Code
        message: >-
          The currency must be a valid 3-letter ISO 4217 code (e.g., BRL, USD).
          Please provide a valid currency code.
    Error0125:
      summary: Scopes Required
      value:
        code: TRC-0125
        title: Missing Required Field
        message: >-
          At least one scope is required for limits. Please provide at least one
          scope and try again.
    Error0126:
      summary: Limit Name Required
      value:
        code: TRC-0126
        title: Missing Required Field
        message: >-
          The name field is required. Please provide a name for the limit and
          try again.
    Error0127:
      summary: Limit Name Exceeds Maximum Length
      value:
        code: TRC-0127
        title: Name Too Long
        message: >-
          The limit name exceeds the maximum allowed length. Please reduce the
          name size.
    Error0129:
      summary: Name Contains Invalid Characters
      value:
        code: TRC-0129
        title: Invalid Name
        message: >-
          The name contains invalid characters. Please use only allowed
          characters.
    Error0130:
      summary: Description Contains Invalid Characters
      value:
        code: TRC-0130
        title: Invalid Description
        message: >-
          The description contains invalid characters. Please use only allowed
          characters.
    Error0131:
      summary: Immutable Field
      value:
        code: TRC-0131
        title: Immutable Field
        message: >-
          The limitType and currency fields cannot be modified after creation.
          Please create a new limit if you need different values.
    ErrorUnauthenticated:
      summary: Unauthorized
      value:
        code: Unauthenticated
        title: Unauthorized
        message: >-
          API Key missing or invalid. Provide a valid API Key in the X-API-Key
          header.
    Error0120:
      summary: Limit Not Found
      value:
        code: TRC-0120
        title: Limit Not Found
        message: >-
          The requested limit does not exist. Please verify the limit ID and try
          again.
    Error0304:
      summary: Limit Name Conflict
      value:
        code: TRC-0304
        title: Limit Name Conflict
        message: A limit with this name already exists. Please choose a different name.
    Error0004:
      summary: Internal Server Error
      value:
        code: TRC-0004
        title: Internal Server Error
        message: >-
          An unexpected error occurred. Please try again later or contact
          support if the issue persists.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Autenticación por API Key. Utilizada por los despliegues de inquilino
        único (`MULTI_TENANT_ENABLED=false`). Se envía en cada solicitud
        `/v1/*`.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Autenticación JWT bearer. Utilizada por los despliegues multiinquilino
        (`MULTI_TENANT_ENABLED=true`). El JWT es emitido por Access Manager y
        debe incluir el claim `tenantId` — Tracer resuelve el inquilino a partir
        del token, no de ningún encabezado o campo del cuerpo.

````