Skip to main content
POST
/
gateway
/
{gateway_topic}
/
mapping
Create a new mapping for a gateway
curl --request POST \
  --url https://api.quiva.ai/gateway/{gateway_topic}/mapping \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "path": "/api/users",
  "method": "GET",
  "is_public": true,
  "timeout": 30000,
  "limit": {
    "request": 5000,
    "time": 1000
  }
}
'
{
  "body": {
    "subject": "ms.gateway.abcdef123456.mapping.get.api.users",
    "path": "/api/users",
    "method": "GET",
    "is_public": true,
    "timeout": 30000,
    "limit": {
      "request": 5000,
      "time": 1000
    },
    "traffic_distribution": {
      "1": 100
    },
    "modified": 1713531894,
    "type": "created"
  },
  "metadata": {
    "subject": "ms.gateway.abcdef123456.mapping.get.api.users"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

gateway_topic
string
required

Unique topic identifier of the gateway

Body

application/json
path
string
required

URL path for the mapping

Example:

"/api/users"

method
enum<string>
default:POST

HTTP method for the mapping

Available options:
GET,
POST,
PUT,
DELETE,
PATCH,
OPTIONS,
HEAD
Example:

"GET"

is_public
boolean
default:false

Whether the mapping is publicly accessible

Example:

true

limit
object
timeout
integer
default:30000

Timeout in milliseconds for mapping requests

Example:

30000

traffic_distribution
object

Traffic distribution configuration for A/B testing

Example:
{ "1": 100 }

Response

Mapping created successfully

body
object
metadata
object