{ "openapi": "3.0.3", "info": { "title": "quiva.ai Gateways API", "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" } ], "tags": [ { "name": "Gateways", "description": "Gateway management endpoints" }, { "name": "Mappings", "description": "Gateway Mapping management endpoints" }, { "name": "Mapping Versions", "description": "Gateway Mapping Version management endpoints" }, { "name": "DNS Zones", "description": "Custom domain zones managed on the gateway" }, { "name": "DNS Records", "description": "Records inside a DNS zone, and the domains a gateway answers on" }, { "name": "Certificates", "description": "TLS certificates for a DNS record" } ], "security": [ { "bearerAuth": [] }, { "apiKeyAuth": [] } ], "paths": { "/gateway": { "post": { "tags": [ "Gateways" ], "summary": "Create a new gateway", "description": "Creates a new gateway with a unique topic and URL.", "operationId": "postGateway", "x-resource-type": "service", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayCreateRequest" }, "examples": { "basic_gateway": { "value": { "name": "My API Gateway", "description": "Gateway for my service APIs", "active": true } } } } } }, "responses": { "200": { "description": "Gateway created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayResponseWrapper" }, "example": { "body": { "name": "My API Gateway", "description": "Gateway for my service APIs", "url": "https://abc123.quiva.ai", "subject": "ms.gateway.abcdef123456.gateway", "active": true, "timeout": 30000, "limit": { "request": 10000, "time": 1000 }, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.gateway" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/gateway/{gateway_topic}": { "get": { "tags": [ "Gateways" ], "summary": "Get a specific gateway", "description": "Retrieves details about a specific gateway.", "operationId": "getGateway", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "responses": { "200": { "description": "Gateway details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayResponseWrapper" }, "example": { "body": { "name": "My API Gateway", "description": "Gateway for my service APIs", "url": "https://abc123.quiva.ai", "subject": "ms.gateway.abcdef123456.gateway", "active": true, "timeout": 30000, "limit": { "request": 10000, "time": 1000 }, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.gateway" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": [ "Gateways" ], "summary": "Update a gateway", "description": "Updates an existing gateway's configuration.", "operationId": "patchGateway", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayUpdateRequest" }, "example": { "name": "Updated Gateway Name", "description": "Updated description for my gateway", "active": true, "timeout": 60000, "limit": { "request": 5000, "time": 1000 } } } } }, "responses": { "200": { "description": "Gateway updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "tags": [ "Gateways" ], "summary": "Delete a gateway", "description": "Marks a gateway as deleted (poison-pilled).", "operationId": "deleteGateway", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "responses": { "200": { "description": "Gateway marked as deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/all": { "get": { "tags": [ "Gateways" ], "summary": "Get all gateways", "description": "Retrieves a list of all available gateways.", "operationId": "getAllGateways", "x-resource-type": "service", "responses": { "200": { "description": "List of gateways retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GatewayListResponseWrapper" }, "example": { "body": { "results": [ { "name": "Gateway 1", "description": "First gateway", "subject": "ms.gateway.abc123.gateway", "active": true, "timeout": 30000, "limit": { "request": 10000, "time": 1000 }, "modified": 1713531894, "type": "created" }, { "name": "Gateway 2", "description": "Second gateway", "subject": "ms.gateway.def456.gateway", "active": true, "timeout": 60000, "limit": { "request": 5000, "time": 1000 }, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "gateway.*.gateway.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/gateway/{gateway_topic}/mapping": { "post": { "tags": [ "Mappings" ], "summary": "Create a new mapping for a gateway", "description": "Creates a new path mapping within the specified gateway.", "operationId": "postGatewayMapping", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingCreateRequest" }, "example": { "path": "/api/users", "method": "GET", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 } } } } }, "responses": { "200": { "description": "Mapping created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingResponseWrapper" }, "example": { "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" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "get": { "tags": [ "Mappings" ], "summary": "Get all mappings for a gateway", "description": "Retrieves all mappings defined for the specified gateway.", "operationId": "getGatewayMappings", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" } ], "responses": { "200": { "description": "List of mappings retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingListResponseWrapper" }, "example": { "body": { "results": [ { "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" }, { "subject": "ms.gateway.abcdef123456.mapping.post.api.users", "path": "/api/users", "method": "POST", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": {}, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/{gateway_topic}/mapping/details": { "get": { "tags": [ "Mappings" ], "summary": "Get a specific mapping", "description": "Retrieves information about a specific gateway mapping.", "operationId": "getGatewayMapping", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingResponseWrapper" }, "example": { "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" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": [ "Mappings" ], "summary": "Update a mapping", "description": "Updates an existing gateway mapping configuration.", "operationId": "patchGatewayMapping", "x-resource-type": "service", "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" } } }, "delete": { "tags": [ "Mappings" ], "summary": "Delete a mapping", "description": "Marks a gateway mapping as deleted (poison-pilled).", "operationId": "deleteMapping", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping marked as deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/mapping/all": { "get": { "tags": [ "Mappings" ], "summary": "Get all mappings", "description": "Retrieves a list of all available gateway mappings.", "operationId": "getAllGatewayMappings", "x-resource-type": "service", "responses": { "200": { "description": "List of mappings retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingListResponseWrapper" }, "example": { "body": { "results": [ { "subject": "ms.gateway.abc123.mapping.get.api.users", "path": "/api/users", "method": "GET", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": {}, "modified": 1713531894, "type": "created" }, { "subject": "ms.gateway.def456.mapping.post.api.products", "path": "/api/products", "method": "POST", "is_public": true, "timeout": 30000, "limit": { "request": 5000, "time": 1000 }, "traffic_distribution": {}, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "gateway.*.mapping.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/gateway/{gateway_topic}/mapping/version": { "post": { "tags": [ "Mapping Versions" ], "summary": "Create a new mapping version", "description": "Creates a new version for an existing mapping.", "operationId": "postGatewayMappingVersion", "x-resource-type": "service", "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/MappingVersionCreateRequest" }, "example": { "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Gets all users with pagination" } } } }, "responses": { "200": { "description": "Mapping version created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionResponseWrapper" }, "example": { "body": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Gets all users with pagination", "version": 1, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "get": { "tags": [ "Mapping Versions" ], "summary": "Get all versions for a mapping", "description": "Retrieves all versions defined for a specific mapping.", "operationId": "getGatewayMappingVersions", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "List of mapping versions retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionListResponseWrapper" }, "example": { "body": { "results": [ { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Initial version", "version": 1, "modified": 1713531894, "type": "created" }, { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.2", "resource_type": "function", "resource": "user-service.getUsersV2", "resource_version": "latest", "active": true, "description": "Improved version with better filtering", "version": 2, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/mapping-version/{gateway_topic}/{version_number}": { "get": { "tags": [ "Mapping Versions" ], "summary": "Get a specific mapping version", "description": "Retrieves information about a specific mapping version.", "operationId": "getGatewayMappingVersion", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/version_number_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping version details retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionResponseWrapper" }, "example": { "body": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Gets all users with pagination", "version": 1, "modified": 1713531894, "type": "created" }, "metadata": { "subject": "ms.gateway.abcdef123456.mapping-version.get.api.users.1" } } } } }, "404": { "$ref": "#/components/responses/NotFound" } } }, "patch": { "tags": [ "Mapping Versions" ], "summary": "Update a mapping version", "description": "Updates an existing mapping version configuration.", "operationId": "patchGatewayMappingVersion", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/version_number_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionUpdateRequest" }, "example": { "active": false, "description": "Updated description for version 1" } } } }, "responses": { "200": { "description": "Mapping version updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "404": { "$ref": "#/components/responses/NotFound" } } }, "delete": { "tags": [ "Mapping Versions" ], "summary": "Delete a mapping version", "description": "Marks a mapping version as deleted (poison-pilled).", "operationId": "deleteMappingVersion", "x-resource-type": "service", "parameters": [ { "$ref": "#/components/parameters/gateway_topic_param" }, { "$ref": "#/components/parameters/version_number_param" }, { "$ref": "#/components/parameters/method_query_param" }, { "$ref": "#/components/parameters/path_query_param" } ], "responses": { "200": { "description": "Mapping version marked as deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "404": { "$ref": "#/components/responses/NotFound" } } } }, "/gateway/mapping-version/all": { "get": { "tags": [ "Mapping Versions" ], "summary": "Get all mapping versions", "description": "Retrieves a list of all available mapping versions.", "operationId": "getAllGatewayMappingVersions", "x-resource-type": "service", "responses": { "200": { "description": "List of mapping versions retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MappingVersionListResponseWrapper" }, "example": { "body": { "results": [ { "subject": "ms.gateway.abc123.mapping-version.get.api.users.1", "resource_type": "function", "resource": "user-service.getUsers", "resource_version": "latest", "active": true, "description": "Version 1", "version": 1, "modified": 1713531894, "type": "created" }, { "subject": "ms.gateway.def456.mapping-version.post.api.products.1", "resource_type": "function", "resource": "product-service.createProduct", "resource_version": "latest", "active": true, "description": "Version 1", "version": 1, "modified": 1713532000, "type": "created" } ], "results_total": 2 }, "metadata": { "subject": "gateway.*.mapping-version.>" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" } } } }, "/gateway/dns-zone": { "post": { "summary": "Create a DNS zone", "description": "Registers a custom domain as a DNS zone owned by the caller's account. The domain must be valid and not already registered.", "operationId": "postDnsZone", "tags": [ "DNS Zones" ], "x-resource-type": "service", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "domain": { "type": "string", "description": "Domain name" }, "soa": { "type": "object", "properties": { "domain": { "type": "string", "description": "Zone domain" }, "primary": { "type": "string", "description": "Primary name server" }, "email": { "type": "string", "description": "Admin email" }, "serial": { "type": "integer" }, "refresh": { "type": "integer" }, "retry": { "type": "integer" }, "expire": { "type": "integer" } } } }, "required": [ "domain" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "subject": { "type": "string", "description": "Zone subject" }, "account_id": { "type": "string", "description": "Owning account" }, "domain": { "type": "string", "description": "Zone domain" }, "soa": { "type": "object", "properties": { "domain": { "type": "string", "description": "Zone domain" }, "primary": { "type": "string", "description": "Primary name server" }, "email": { "type": "string", "description": "Admin email" }, "serial": { "type": "integer" }, "refresh": { "type": "integer" }, "retry": { "type": "integer" }, "expire": { "type": "integer" } } }, "version": { "type": "integer" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "409": { "description": "Zone domain exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/gateway/dns-zone/all": { "get": { "summary": "List DNS zones", "description": "Lists the DNS zones visible to the caller.", "operationId": "getDnsZones", "tags": [ "DNS Zones" ], "x-resource-type": "service", "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "subject": { "type": "string", "description": "Zone subject" }, "account_id": { "type": "string", "description": "Owning account" }, "domain": { "type": "string", "description": "Zone domain" }, "soa": { "type": "object", "properties": { "domain": { "type": "string", "description": "Zone domain" }, "primary": { "type": "string", "description": "Primary name server" }, "email": { "type": "string", "description": "Admin email" }, "serial": { "type": "integer" }, "refresh": { "type": "integer" }, "retry": { "type": "integer" }, "expire": { "type": "integer" } } }, "version": { "type": "integer" } } } }, "results_total": { "type": "integer" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/gateway/dns-zone/{zone_id}": { "get": { "summary": "Get a DNS zone", "description": "Returns one DNS zone.", "operationId": "getDnsZone", "tags": [ "DNS Zones" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "subject": { "type": "string", "description": "Zone subject" }, "account_id": { "type": "string", "description": "Owning account" }, "domain": { "type": "string", "description": "Zone domain" }, "soa": { "type": "object", "properties": { "domain": { "type": "string", "description": "Zone domain" }, "primary": { "type": "string", "description": "Primary name server" }, "email": { "type": "string", "description": "Admin email" }, "serial": { "type": "integer" }, "refresh": { "type": "integer" }, "retry": { "type": "integer" }, "expire": { "type": "integer" } } }, "version": { "type": "integer" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "patch": { "summary": "Update a DNS zone", "description": "Updates the zone's SOA record. `version` is the version read with the zone.", "operationId": "patchDnsZone", "tags": [ "DNS Zones" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "soa": { "type": "object", "properties": { "domain": { "type": "string", "description": "Zone domain" }, "primary": { "type": "string", "description": "Primary name server" }, "email": { "type": "string", "description": "Admin email" }, "serial": { "type": "integer" }, "refresh": { "type": "integer" }, "retry": { "type": "integer" }, "expire": { "type": "integer" } } }, "version": { "type": "integer", "description": "Zone version the update is based on" } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "subject": { "type": "string", "description": "Zone subject" }, "account_id": { "type": "string", "description": "Owning account" }, "domain": { "type": "string", "description": "Zone domain" }, "soa": { "type": "object", "properties": { "domain": { "type": "string", "description": "Zone domain" }, "primary": { "type": "string", "description": "Primary name server" }, "email": { "type": "string", "description": "Admin email" }, "serial": { "type": "integer" }, "refresh": { "type": "integer" }, "retry": { "type": "integer" }, "expire": { "type": "integer" } } }, "version": { "type": "integer" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "summary": "Delete a DNS zone", "description": "Deletes the zone and its records.", "operationId": "deleteDnsZone", "tags": [ "DNS Zones" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/gateway/dns-zone/{zone_id}/record": { "get": { "summary": "List DNS records", "description": "Lists the records of a zone.", "operationId": "getDnsRecords", "tags": [ "DNS Records" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "subject": { "type": "string", "description": "Record subject" }, "domain_name": { "type": "string", "description": "Zone domain" }, "type": { "type": "string", "description": "A, CNAME, MX, TXT and so on" }, "name": { "type": "string", "description": "Record name; `@` is the zone apex" }, "value": { "type": "string", "description": "Record value" }, "priority": { "type": "integer", "description": "MX priority" }, "ttl": { "type": "integer", "description": "Time to live in seconds" } } } }, "results_total": { "type": "integer" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "summary": "Create a DNS record", "description": "Adds a record to the zone. A CNAME pointing at a gateway also registers that domain for the gateway.", "operationId": "postDnsRecord", "tags": [ "DNS Records" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "description": "Record type" }, "name": { "type": "string", "description": "Record name; `@` is the apex" }, "value": { "type": "string", "description": "Record value" }, "priority": { "type": "integer" }, "ttl": { "type": "integer" } }, "required": [ "type", "name", "value" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "subject": { "type": "string", "description": "Record subject" }, "domain_name": { "type": "string", "description": "Zone domain" }, "type": { "type": "string", "description": "A, CNAME, MX, TXT and so on" }, "name": { "type": "string", "description": "Record name; `@` is the zone apex" }, "value": { "type": "string", "description": "Record value" }, "priority": { "type": "integer", "description": "MX priority" }, "ttl": { "type": "integer", "description": "Time to live in seconds" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/gateway/dns-zone/{zone_id}/record/{record_id}": { "get": { "summary": "Get a DNS record", "description": "Returns one record of a zone.", "operationId": "getDnsRecord", "tags": [ "DNS Records" ], "x-resource-type": "service", "x-path-derived": true, "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } }, { "name": "record_id", "in": "path", "required": true, "description": "Record id, as returned in the record subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "subject": { "type": "string", "description": "Record subject" }, "domain_name": { "type": "string", "description": "Zone domain" }, "type": { "type": "string", "description": "A, CNAME, MX, TXT and so on" }, "name": { "type": "string", "description": "Record name; `@` is the zone apex" }, "value": { "type": "string", "description": "Record value" }, "priority": { "type": "integer", "description": "MX priority" }, "ttl": { "type": "integer", "description": "Time to live in seconds" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "patch": { "summary": "Update a DNS record", "description": "Changes a record's type, value, priority or ttl.", "operationId": "patchDnsRecord", "tags": [ "DNS Records" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } }, { "name": "record_id", "in": "path", "required": true, "description": "Record id, as returned in the record subject", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "type": { "type": "string", "description": "Record type" }, "value": { "type": "string", "description": "Record value" }, "priority": { "type": "integer" }, "ttl": { "type": "integer" } } } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "subject": { "type": "string", "description": "Record subject" }, "domain_name": { "type": "string", "description": "Zone domain" }, "type": { "type": "string", "description": "A, CNAME, MX, TXT and so on" }, "name": { "type": "string", "description": "Record name; `@` is the zone apex" }, "value": { "type": "string", "description": "Record value" }, "priority": { "type": "integer", "description": "MX priority" }, "ttl": { "type": "integer", "description": "Time to live in seconds" } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "summary": "Delete a DNS record", "description": "Deletes one record.", "operationId": "deleteDnsRecord", "tags": [ "DNS Records" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } }, { "name": "record_id", "in": "path", "required": true, "description": "Record id, as returned in the record subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/gateway/{gateway_topic}/dns-records": { "get": { "summary": "List a gateway's domains", "description": "Lists the DNS records that point at the gateway.", "operationId": "getGatewayDomains", "tags": [ "DNS Records" ], "x-resource-type": "service", "parameters": [ { "name": "gateway_topic", "in": "path", "required": true, "description": "Gateway topic", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "subject": { "type": "string", "description": "Record subject" }, "domain_name": { "type": "string", "description": "Zone domain" }, "type": { "type": "string", "description": "A, CNAME, MX, TXT and so on" }, "name": { "type": "string", "description": "Record name; `@` is the zone apex" }, "value": { "type": "string", "description": "Record value" }, "priority": { "type": "integer", "description": "MX priority" }, "ttl": { "type": "integer", "description": "Time to live in seconds" } } } } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Gateway not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/gateway/cert/{zone_id}/{record_id}": { "get": { "summary": "Get a certificate", "description": "Returns the certificate issued for a record, if any.", "operationId": "getDnsCert", "tags": [ "Certificates" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } }, { "name": "record_id", "in": "path", "required": true, "description": "Record id, as returned in the record subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "post": { "summary": "Request a certificate", "description": "Requests a certificate for the record's domain. The domain list is taken from the record, not the body.", "operationId": "requestDnsCert", "tags": [ "Certificates" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } }, { "name": "record_id", "in": "path", "required": true, "description": "Record id, as returned in the record subject", "schema": { "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string", "description": "Contact email for the certificate authority" }, "production": { "type": "boolean", "description": "Use the production authority rather than staging" }, "renewDays": { "type": "integer", "description": "Days before expiry to renew" } }, "required": [ "email" ] } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "patch": { "summary": "Renew a certificate", "description": "Renews the record's certificate now.", "operationId": "renewDnsCert", "tags": [ "Certificates" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } }, { "name": "record_id", "in": "path", "required": true, "description": "Record id, as returned in the record subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "body": { "type": "object" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "summary": "Revoke a certificate", "description": "Revokes the record's certificate.", "operationId": "revokeDnsCert", "tags": [ "Certificates" ], "x-resource-type": "service", "parameters": [ { "name": "zone_id", "in": "path", "required": true, "description": "Zone id, as returned in the zone subject", "schema": { "type": "string" } }, { "name": "record_id", "in": "path", "required": true, "description": "Record id, as returned in the record subject", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Zone or record not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT" }, "apiKeyAuth": { "type": "apiKey", "in": "header", "name": "x-api-key" }, "oauth2": { "type": "oauth2", "description": "API integration client credentials. Tokens only work on the task-sync routes in workspaces.", "flows": { "clientCredentials": { "tokenUrl": "https://api.quiva.ai/oauth/token", "scopes": {} } } } }, "parameters": { "path_param": { "name": "path", "in": "path", "description": "Path segment of the mapping in dot notation", "required": true, "schema": { "type": "string" }, "example": "api.users" }, "method_param": { "name": "method", "in": "path", "description": "HTTP method for the mapping in lowercase", "required": true, "schema": { "type": "string", "enum": [ "get", "post", "put", "delete", "patch", "options", "head" ] }, "example": "get" }, "gateway_topic_param": { "name": "gateway_topic", "in": "path", "description": "Unique topic identifier of the gateway", "required": true, "schema": { "type": "string" }, "example": "abcdef123456" }, "version_number_param": { "name": "version_number", "in": "path", "description": "Sequential version number of the mapping version", "required": true, "schema": { "type": "integer" }, "example": 1 }, "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": { "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 } } }, "Middleware": { "type": "object", "properties": { "order": { "type": "integer", "description": "Execution order of the middleware", "example": 1 }, "resource": { "type": "string", "description": "Resource identifier for the middleware function", "example": "auth-middleware" }, "resource_type": { "type": "string", "description": "Type of resource the middleware points to", "example": "function", "enum": [ "function", "service" ] }, "resource_version": { "type": "string", "description": "Version of the middleware resource to use", "example": "latest" }, "type": { "type": "string", "description": "When the middleware should execute", "example": "pre-request", "enum": [ "pre-request", "post-request" ] } } }, "Metadata": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the resource", "example": "ms.gateway.abcdef123456.gateway" } } }, "GatewayCreateRequest": { "type": "object", "required": [ "name", "active" ], "properties": { "name": { "type": "string", "description": "Name of the gateway", "example": "My API Gateway" }, "description": { "type": "string", "description": "Description of the gateway", "example": "Gateway for my service APIs" }, "active": { "type": "boolean", "description": "Whether the gateway is active", "default": true, "example": true }, "middleware": { "type": "array", "description": "List of middleware to be applied to the gateway", "items": { "$ref": "#/components/schemas/Middleware" } }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for gateway requests", "default": 30000, "example": 30000 } } }, "GatewayUpdateRequest": { "type": "object", "properties": { "name": { "type": "string", "description": "Updated name of the gateway", "example": "Updated Gateway Name" }, "description": { "type": "string", "description": "Updated description of the gateway", "example": "Updated description for my gateway" }, "active": { "type": "boolean", "description": "Whether the gateway is active", "example": true }, "middleware": { "type": "array", "description": "Updated list of middleware to be applied to the gateway", "items": { "$ref": "#/components/schemas/Middleware" } }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Updated timeout in milliseconds for gateway requests", "example": 60000 } } }, "GatewayResponse": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the gateway", "example": "My API Gateway" }, "description": { "type": "string", "description": "Description of the gateway", "example": "Gateway for my service APIs" }, "url": { "type": "string", "description": "URL of the gateway", "example": "https://abc123.quiva.ai" }, "subject": { "type": "string", "description": "Subject identifier of the gateway", "example": "ms.gateway.abcdef123456.gateway" }, "active": { "type": "boolean", "description": "Whether the gateway is active", "example": true }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for gateway requests", "example": 30000 }, "limit": { "$ref": "#/components/schemas/Limit" }, "middleware": { "type": "array", "description": "List of middleware applied to the gateway", "items": { "$ref": "#/components/schemas/Middleware" } }, "modified": { "type": "integer", "description": "Unix timestamp of when the gateway was last modified", "example": 1713531894 }, "type": { "type": "string", "description": "Type of the gateway record", "example": "created" } } }, "GatewayResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/GatewayResponse" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "GatewayListResult": { "type": "object", "properties": { "results": { "type": "array", "description": "List of gateways", "items": { "$ref": "#/components/schemas/GatewayResponse" } }, "results_total": { "type": "integer", "description": "Total number of gateways returned", "example": 2 } } }, "GatewayListResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/GatewayListResult" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingCreateRequest": { "type": "object", "required": [ "path" ], "properties": { "path": { "type": "string", "description": "URL path for the mapping", "example": "/api/users" }, "method": { "type": "string", "description": "HTTP method for the mapping", "default": "POST", "enum": [ "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD" ], "example": "GET" }, "is_public": { "type": "boolean", "description": "Whether the mapping is publicly accessible", "default": false, "example": true }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for mapping requests", "default": 30000, "example": 30000 }, "traffic_distribution": { "type": "object", "description": "Traffic distribution configuration for A/B testing", "additionalProperties": { "type": "integer" }, "example": { "1": 100 } } } }, "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 } } } }, "MappingResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier of the mapping", "example": "ms.gateway.abcdef123456.mapping.get.api.users" }, "path": { "type": "string", "description": "URL path for the mapping", "example": "/api/users" }, "method": { "type": "string", "description": "HTTP method for the mapping", "example": "GET" }, "is_public": { "type": "boolean", "description": "Whether the mapping is publicly accessible", "example": true }, "limit": { "$ref": "#/components/schemas/Limit" }, "timeout": { "type": "integer", "description": "Timeout in milliseconds for mapping requests", "example": 30000 }, "traffic_distribution": { "type": "object", "description": "Traffic distribution configuration for A/B testing", "additionalProperties": { "type": "integer" }, "example": { "1": 100 } }, "modified": { "type": "integer", "description": "Unix timestamp of when the mapping was last modified", "example": 1713531894 }, "type": { "type": "string", "description": "Type of the mapping record", "example": "created" } } }, "MappingResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingResponse" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingListResult": { "type": "object", "properties": { "results": { "type": "array", "description": "List of mappings", "items": { "$ref": "#/components/schemas/MappingResponse" } }, "results_total": { "type": "integer", "description": "Total number of mappings returned", "example": 2 } } }, "MappingListResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingListResult" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingVersionCreateRequest": { "type": "object", "required": [ "resource_type", "resource" ], "properties": { "resource_type": { "type": "string", "description": "Type of resource that will handle requests", "example": "function" }, "resource": { "type": "string", "description": "Resource identifier that will handle requests", "example": "user-service.getUsers" }, "resource_version": { "type": "string", "description": "Version of the resource", "default": "latest", "example": "latest" }, "active": { "type": "boolean", "description": "Whether the mapping version is active", "default": true, "example": true }, "description": { "type": "string", "description": "Description of the mapping version", "example": "Gets all users with pagination" }, "middleware": { "type": "array", "description": "List of middleware to be applied to the mapping version", "items": { "$ref": "#/components/schemas/Middleware" } }, "exact_match": { "type": "boolean", "description": "Whether the path should be matched exactly", "default": false, "example": false }, "attributes": { "type": "array", "description": "Attributes for the mapping version", "items": { "type": "string" }, "example": [] }, "boolean_logic": { "type": "string", "description": "Boolean logic expression for request routing", "example": "" }, "invocation_type": { "type": "string", "description": "Type of invocation for the resource", "example": "RequestResponse" } } }, "MappingVersionUpdateRequest": { "type": "object", "properties": { "active": { "type": "boolean", "description": "Whether the mapping version is active", "example": false }, "description": { "type": "string", "description": "Updated description of the mapping version", "example": "Updated description for version 1" }, "middleware": { "type": "array", "description": "Updated list of middleware to be applied to the mapping version", "items": { "$ref": "#/components/schemas/Middleware" } }, "exact_match": { "type": "boolean", "description": "Whether the path should be matched exactly", "example": true }, "attributes": { "type": "array", "description": "Updated attributes for the mapping version", "items": { "type": "string" }, "example": [ "premium" ] }, "boolean_logic": { "type": "string", "description": "Updated boolean logic expression for request routing", "example": "user.premium == true" }, "invocation_type": { "type": "string", "description": "Updated type of invocation for the resource", "example": "Event" } } }, "MappingVersionResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier of the mapping version", "example": "ms.gateway.abcdef123456.mapping-version.get.api.users.1" }, "resource_type": { "type": "string", "description": "Type of resource that handles requests", "example": "function" }, "resource": { "type": "string", "description": "Resource identifier that handles requests", "example": "user-service.getUsers" }, "resource_version": { "type": "string", "description": "Version of the resource", "example": "latest" }, "active": { "type": "boolean", "description": "Whether the mapping version is active", "example": true }, "description": { "type": "string", "description": "Description of the mapping version", "example": "Gets all users with pagination" }, "middleware": { "type": "array", "description": "List of middleware applied to the mapping version", "items": { "$ref": "#/components/schemas/Middleware" } }, "exact_match": { "type": "boolean", "description": "Whether the path is matched exactly", "example": false }, "attributes": { "type": "array", "description": "Attributes for the mapping version", "items": { "type": "string" }, "example": [] }, "boolean_logic": { "type": "string", "description": "Boolean logic expression for request routing", "example": "" }, "invocation_type": { "type": "string", "description": "Type of invocation for the resource", "example": "RequestResponse" }, "version": { "type": "integer", "description": "Version number", "example": 1 }, "modified": { "type": "integer", "description": "Unix timestamp of when the mapping version was last modified", "example": 1713531894 }, "type": { "type": "string", "description": "Type of the mapping version record", "example": "created" } } }, "MappingVersionResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingVersionResponse" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "MappingVersionListResult": { "type": "object", "properties": { "results": { "type": "array", "description": "List of mapping versions", "items": { "$ref": "#/components/schemas/MappingVersionResponse" } }, "results_total": { "type": "integer", "description": "Total number of mapping versions returned", "example": 2 } } }, "MappingVersionListResponseWrapper": { "type": "object", "properties": { "body": { "$ref": "#/components/schemas/MappingVersionListResult" }, "metadata": { "$ref": "#/components/schemas/Metadata" } } }, "SuccessResponse": { "type": "object", "properties": { "message": { "type": "string", "example": "success" } } }, "Error": { "type": "object", "properties": { "error": { "type": "string" } } } }, "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" } } } } } } } } }