---
title: "Create a new mapping version"
method: POST
path: "/gateway/{gateway_topic}/mapping/version"
tags: ["Mapping Versions"]
---

# Create a new mapping version

`POST /gateway/{gateway_topic}/mapping/version`

Creates a new version for an existing mapping.

## Path parameters

- `gateway_topic` string, required

## Query parameters

- `method` 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD', required
- `path` string, required

## Request body

- MappingVersionCreateRequest
  - `resource_type` string, required — Type of resource that will handle requests
  - `resource` string, required — Resource identifier that will handle requests
  - `resource_version` string — Version of the resource
  - `active` boolean — Whether the mapping version is active
  - `description` string — Description of the mapping version
  - `middleware` Middleware[] — List of middleware to be applied to the mapping version
    - `order` integer — Execution order of the middleware
    - `resource` string — Resource identifier for the middleware function
    - `resource_type` 'function' | 'service' — Type of resource the middleware points to
    - `resource_version` string — Version of the middleware resource to use
    - `type` 'pre-request' | 'post-request' — When the middleware should execute
  - `exact_match` boolean — Whether the path should be matched exactly
  - `attributes` string[] — Attributes for the mapping version
  - `boolean_logic` string — Boolean logic expression for request routing
  - `invocation_type` string — Type of invocation for the resource

## Response `200`

Mapping version created successfully

- MappingVersionResponseWrapper
  - `body` MappingVersionResponse
    - `subject` string — Subject identifier of the mapping version
    - `resource_type` string — Type of resource that handles requests
    - `resource` string — Resource identifier that handles requests
    - `resource_version` string — Version of the resource
    - `active` boolean — Whether the mapping version is active
    - `description` string — Description of the mapping version
    - `middleware` Middleware[] — List of middleware applied to the mapping version
      - `order` integer — Execution order of the middleware
      - `resource` string — Resource identifier for the middleware function
      - `resource_type` 'function' | 'service' — Type of resource the middleware points to
      - `resource_version` string — Version of the middleware resource to use
      - `type` 'pre-request' | 'post-request' — When the middleware should execute
    - `exact_match` boolean — Whether the path is matched exactly
    - `attributes` string[] — Attributes for the mapping version
    - `boolean_logic` string — Boolean logic expression for request routing
    - `invocation_type` string — Type of invocation for the resource
    - `version` integer — Version number
    - `modified` integer — Unix timestamp of when the mapping version was last modified
    - `type` string — Type of the mapping version record
  - `metadata` Metadata
    - `subject` string — Subject identifier for the resource

## Other responses

- `400` — Bad request
- `404` — Resource not found

---

[API](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-4.md) · [All operations](https://skmtc.net/quivaworks/apis/quiva-ai-gateway-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/quivaworks/quiva-ai-gateway-4/versions/c040b7174eb9/schema)
