> ## 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.

# Update transaction limit

> Modify transaction limits for an account. Specify the period type (DAILY, NIGHTLY, MONTHLY, YEARLY)
and limit type (DEBIT for outgoing or CREDIT for incoming) to update the corresponding limit amount.




## OpenAPI

````yaml en/openapi/v3-current/pix.yaml PATCH /v1/limits
openapi: 3.0.3
info:
  title: Plugin BR Pix Direct - Complete API
  description: |
    Complete API for Brazilian Pix instant payment system including
    Pix key dictionary operations, QR code generation/decoding, transactions and
    transaction limits.
  version: 1.0.0
servers:
  - url: https://plugin-pix-direct.api.lerian.net
  - url: https://plugin-pix-direct-qrcode.api.lerian.net
security:
  - bearerAuth: []
paths:
  /v1/limits:
    patch:
      tags:
        - Transaction Limits API
      summary: Update transaction limit
      description: >
        Modify transaction limits for an account. Specify the period type
        (DAILY, NIGHTLY, MONTHLY, YEARLY)

        and limit type (DEBIT for outgoing or CREDIT for incoming) to update the
        corresponding limit amount.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLimitRequest'
            examples:
              daily_debit_limit:
                summary: Update daily debit/outgoing limit
                value:
                  accountId: 019c96a0-0c0c-7221-8cf3-13313fb60081
                  amount: 10000
                  periodType: DAILY
                  limitType: DEBIT
              monthly_credit_limit:
                summary: Update monthly credit/incoming limit
                value:
                  accountId: 019c96a0-0c0c-7221-8cf3-13313fb60081
                  amount: 50000
                  periodType: MONTHLY
                  limitType: CREDIT
              nightly_debit_limit:
                summary: Update nightly debit limit (8 PM - 6 AM)
                value:
                  accountId: 019c96a0-0c0c-7221-8cf3-13313fb60081
                  amount: 1000
                  periodType: NIGHTLY
                  limitType: DEBIT
      responses:
        '200':
          description: Limit updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionLimit'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    UpdateLimitRequest:
      type: object
      required:
        - accountId
        - amount
        - periodType
        - limitType
      properties:
        accountId:
          type: string
          description: Account identifier for which the limit is being set.
          format: uuid
          example: 019c96a0-0c0c-7221-8cf3-13313fb60081
        amount:
          type: number
          description: New limit amount.
          format: double
          example: 10000
        periodType:
          $ref: '#/components/schemas/PeriodTypeEnum'
        limitType:
          $ref: '#/components/schemas/LimitTypeEnum'
    TransactionLimit:
      type: object
      required:
        - id
        - accountId
        - transactionType
        - periodType
        - limitType
        - amount
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          description: Unique limit identifier.
          example: limit_123
        accountId:
          type: string
          description: Account identifier associated with the limit.
          example: acc_123456789
        transactionType:
          type: string
          description: 'Transaction type string: TED, DOC, Pix, etc.'
          example: Pix
        periodType:
          $ref: '#/components/schemas/PeriodTypeEnum'
        limitType:
          $ref: '#/components/schemas/LimitTypeEnum'
        amount:
          type: number
          description: Limit amount.
          format: double
          example: 5000
        createdAt:
          type: string
          description: Limit creation timestamp.
          format: date-time
          example: '2023-06-01T00:00:00Z'
        updatedAt:
          type: string
          description: Limit last update timestamp.
          format: date-time
          example: '2023-06-01T00:00:00Z'
    PeriodTypeEnum:
      type: string
      description: >
        Transaction limit period type. String values defining the time period
        for which transaction limits apply.


        **Valid values:**

        - `DAILY` = Daily limit (resets every day at midnight)

        - `NIGHTLY` = Nightly period limit (typically 8 PM to 6 AM per Brazilian
        banking regulations)

        - `MONTHLY` = Monthly limit (resets on the first day of each month)

        - `YEARLY` = Yearly limit (resets on January 1st each year)
      enum:
        - DAILY
        - NIGHTLY
        - MONTHLY
        - YEARLY
      example: DAILY
    LimitTypeEnum:
      type: string
      description: >
        Transaction limit direction type. String values specifying whether the
        limit applies to incoming or outgoing transactions.


        **Valid values:**

        - `DEBIT` = Outgoing transaction limit (money leaving the account)

        - `CREDIT` = Incoming transaction limit (money entering the account)
      enum:
        - DEBIT
        - CREDIT
      example: DEBIT
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
        message:
          type: string
          description: Error message
        details:
          type: array
          items:
            type: string
          description: Additional error details
  responses:
    BadRequest:
      description: Bad Request - Invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalid_key_type:
              summary: Invalid key type
              value:
                code: INVALID_KEY_TYPE
                message: Key type must be between 0 and 4
                details:
                  - 'keyType: must be one of [0, 1, 2, 3, 4]'
            missing_required_field:
              summary: Missing required field
              value:
                code: VALIDATION_ERROR
                message: Required field is missing
                details:
                  - 'accountId: field is required'
            invalid_document_format:
              summary: Invalid document format
              value:
                code: INVALID_DOCUMENT
                message: Document must be valid CPF (11 digits) or CNPJ (14 digits)
                details:
                  - 'document: must match pattern ^\d{11}$|^\d{14}$'
            invalid_phone_format:
              summary: Invalid phone format
              value:
                code: INVALID_PHONE
                message: Phone must be in Brazilian format
                details:
                  - 'phone: must match pattern ^\+55\d{2}\d{8,9}$'
    Unauthorized:
      description: Unauthorized - Invalid or missing authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missing_token:
              summary: Missing authentication token
              value:
                code: MISSING_TOKEN
                message: Authorization header is required
                details: []
            invalid_token:
              summary: Invalid token
              value:
                code: INVALID_TOKEN
                message: Invalid or expired access token
                details: []
            expired_token:
              summary: Expired token
              value:
                code: TOKEN_EXPIRED
                message: Access token has expired. Please obtain a new token.
                details: []
    InternalServerError:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            generic_error:
              summary: Generic internal error
              value:
                code: INTERNAL_ERROR
                message: An internal error occurred. Please try again later.
                details: []
            database_error:
              summary: Database error
              value:
                code: DATABASE_ERROR
                message: Database operation failed
                details: []
            external_service_error:
              summary: External service error
              value:
                code: EXTERNAL_SERVICE_ERROR
                message: External service (JD Pix) is temporarily unavailable
                details: []
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        JWT Bearer token authentication. Obtain token from
        `/v1/login/oauth/access_token` endpoint

        using client credentials (clientId and clientSecret).


        Include token in Authorization header:

        `Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...`


        Token expires after 3600 seconds (1 hour).

````