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

# Update card limit

> Update the spending limit for the authenticated user's primary card.

<Note>
  Requires `Authorization: Bearer <user-access-token>` — the token from [Verify login code](/api-reference/users/verify-otp).
</Note>

<Tip>
  Pass `x-idempotency-key` with a unique UUID per request. Without it, duplicate-request detection is skipped and a retried call may submit the update twice.
</Tip>

Supported frequencies are `per24HourPeriod`, `per7DayPeriod`, `per30DayPeriod`, `perYearPeriod`, `perAuthorization`, and `allTime`.


## OpenAPI

````yaml api-reference/openapi.json PATCH /api/v1/cards/limit
openapi: 3.1.0
info:
  title: QASH API
  description: >-
    QASH endpoints for exchange rates, cards, and partner-facing financial
    workflows.
  version: 1.0.0
servers:
  - url: https://api.qash.ai
    description: Partner API (Production)
  - url: https://staging.qash.ai
    description: Staging
  - url: https://app.qash.ai
    description: Production
security: []
tags:
  - name: Exchange rates
    description: Public endpoints for supported assets and TRM-based quotes.
  - name: Cards
    description: >-
      Authenticated partner endpoints for card state, controls, limits, and
      balances.
  - name: Users
    description: Admin endpoints for user provisioning and account management.
paths:
  /api/v1/cards/limit:
    patch:
      tags:
        - Cards
      summary: Update card limit
      description: Updates the spending limit for the authenticated user's primary card.
      operationId: updateCardLimit
      parameters:
        - $ref: '#/components/parameters/IdempotencyKeyHeader'
      requestBody:
        description: New spending limit settings.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCardLimitRequest'
            examples:
              default:
                summary: Daily limit
                value:
                  amount: 500
                  frequency: per24HourPeriod
      responses:
        '200':
          description: Card limit updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCardLimitResponse'
              examples:
                default:
                  summary: Updated card limit
                  value:
                    id: 3c90c3cc-0d44-4b50-8888-8dd25736052a
                    limit:
                      amount: 500
                      frequency: per24HourPeriod
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/CardNotFound'
        '409':
          $ref: '#/components/responses/DuplicateIdempotencyKey'
      security:
        - bearerAuth: []
components:
  parameters:
    IdempotencyKeyHeader:
      name: x-idempotency-key
      in: header
      required: true
      description: >-
        Unique idempotency key for the operation. Use a UUID to prevent
        duplicate processing.
      schema:
        type: string
        format: uuid
  schemas:
    UpdateCardLimitRequest:
      type: object
      properties:
        amount:
          type: number
          minimum: 0
        frequency:
          $ref: '#/components/schemas/LimitFrequency'
      required:
        - amount
        - frequency
    UpdateCardLimitResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
        limit:
          $ref: '#/components/schemas/CardLimit'
      required:
        - id
        - limit
    LimitFrequency:
      type: string
      enum:
        - per24HourPeriod
        - perWeek
        - perMonth
        - allTime
    CardLimit:
      type: object
      properties:
        amount:
          type: number
        frequency:
          $ref: '#/components/schemas/LimitFrequency'
      required:
        - amount
        - frequency
  responses:
    Unauthorized:
      description: Invalid or expired JWT.
    CardNotFound:
      description: The authenticated user does not have a registered card.
    DuplicateIdempotencyKey:
      description: The provided idempotency key has already been used.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````