import OAS

POST {{baseUrl}}/api/apis/oas/import?upstreamURL=<string>&listenPath=<string>&customDomain=<string>&allowList=true&validateRequest=true&mockResponse=true&authentication=true&templateID=<string>

For use with an existing OpenAPI document that you want to expose via your Tyk Gateway. Create a new Tyk OAS API from an OpenAPI document in JSON format (without x-tyk-api-gateway extension). The payload can contain either a fully fledged OpenAPI document or a URL pointing to an OpenAPI document.

Request Params

KeyDatatypeRequiredDescription
upstreamURLstringUpstream URL for the API
listenPathstringListen path for the API
customDomainstringCustom domain for the API
allowListbooleanEnable allowList middleware for all endpoints
validateRequestbooleanEnable validateRequest middleware for all endpoints having a request body with media type application/json
mockResponsebooleanEnable mockResponse middleware for all endpoints having responses configured.
authenticationbooleanEnable/disable the authentication mechanism in your Tyk Gateway for your OAS API
templateIDstringThe asset ID of template to apply while importing an OAS API.

Request Body

{"url"=>"<uri>"}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;action&quot;:&quot;\u003cstring\u003e&quot;,&quot;key&quot;:&quot;\u003cstring\u003e&quot;,&quot;key_hash&quot;:&quot;\u003cstring\u003e&quot;,&quot;status&quot;:&quot;\u003cstring\u003e&quot;}