> ## Documentation Index
> Fetch the complete documentation index at: https://microstrate-1133-notifications-prefs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a mapping

> Updates an existing gateway mapping configuration.



## OpenAPI

````yaml /api-reference/endpoint/gateway/openapi.json patch /gateway/{gateway_topic}/mapping/details
openapi: 3.0.3
info:
  title: quiva.ai Gateway
  description: >-
    quiva.ai Gateway API for managing gateway infrastructure and routing API
    requests.
  version: 1.0.0
  contact:
    name: quiva.ai Support
    email: support@quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearer_auth: []
  - api_key_auth: []
tags:
  - name: Gateways
    description: Gateway management endpoints
  - name: Mappings
    description: Gateway Mapping management endpoints
  - name: Mapping Versions
    description: Gateway Mapping Version management endpoints
paths:
  /gateway/{gateway_topic}/mapping/details:
    patch:
      tags:
        - Mappings
      summary: Update a mapping
      description: Updates an existing gateway mapping configuration.
      operationId: patchGatewayMapping
      parameters:
        - $ref: '#/components/parameters/gateway_topic_param'
        - $ref: '#/components/parameters/method_query_param'
        - $ref: '#/components/parameters/path_query_param'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MappingUpdateRequest'
            example:
              path: /api/users/v2
              is_public: false
              timeout: 60000
              limit:
                request: 1000
                time: 1000
      responses:
        '200':
          description: Mapping updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
              example:
                message: success
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    gateway_topic_param:
      name: gateway_topic
      in: path
      description: Unique topic identifier of the gateway
      required: true
      schema:
        type: string
      example: abcdef123456
    method_query_param:
      name: method
      in: query
      description: HTTP method for the mapping in uppercase
      required: true
      schema:
        type: string
        enum:
          - GET
          - POST
          - PUT
          - DELETE
          - PATCH
          - OPTIONS
          - HEAD
      example: GET
    path_query_param:
      name: path
      in: query
      description: URL path for the mapping including the leading slash
      required: true
      schema:
        type: string
      example: /api/users
  schemas:
    MappingUpdateRequest:
      type: object
      properties:
        path:
          type: string
          description: Updated URL path for the mapping
          example: /api/users/v2
        is_public:
          type: boolean
          description: Whether the mapping is publicly accessible
          example: false
        limit:
          $ref: '#/components/schemas/Limit'
        timeout:
          type: integer
          description: Updated timeout in milliseconds for mapping requests
          example: 60000
        traffic_distribution:
          type: object
          description: Updated traffic distribution configuration for A/B testing
          additionalProperties:
            type: integer
          example:
            '1': 80
            '2': 20
    SuccessResponse:
      type: object
      properties:
        message:
          type: string
          example: success
    Limit:
      type: object
      properties:
        request:
          type: integer
          description: Maximum number of requests allowed
          default: 10000
          example: 5000
        time:
          type: integer
          description: Time window for rate limiting in milliseconds
          default: 1000
          example: 1000
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Invalid request parameters
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: The requested resource does not exist
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    api_key_auth:
      type: apiKey
      in: header
      name: X-Api-Key

````