Skip to main content
PATCH
/
tyk
/
apis
/
oas
/
{apiID}
Patch API in Tyk OAS format.
curl --request PATCH \
  --url https://{tenant}/tyk/apis/oas/{apiID} \
  --header 'Content-Type: application/json' \
  --header 'X-Tyk-Authorization: <api-key>' \
  --data '
{
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "description": "The API Access Credentials",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "This is a sample OAS.",
    "title": "OAS Sample",
    "version": "1.0.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/api/sample/users": {
      "get": {
        "operationId": "getUsers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "properties": {
                      "name": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "fetched users"
          }
        },
        "summary": "Get users",
        "tags": [
          "users"
        ]
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://localhost:8080"
    }
  ],
  "x-tyk-api-gateway": {
    "info": {
      "name": "user",
      "state": {
        "active": true
      }
    },
    "server": {
      "listenPath": {
        "strip": true,
        "value": "/user-test/"
      }
    },
    "upstream": {
      "url": "https://localhost:8080"
    }
  }
}
'
{
  "action": "modified",
  "key": "b13d928b9972bd18",
  "key_hash": "<string>",
  "status": "ok"
}

Authorizations

X-Tyk-Authorization
string
header
required

Api key

Path Parameters

apiID
string
required

ID of the API you want to fetch.

Query Parameters

upstreamURL
string

Upstream URL for the API

listenPath
string

Listen path for the API

customDomain
string

Custom domain for the API

allowList
enum<boolean>

Enable allowList middleware for all endpoints

Available options:
true,
false
Example:

true

validateRequest
enum<boolean>

Enable validateRequest middleware for all endpoints having a request body with media type application/json

Available options:
true,
false
Example:

true

mockResponse
enum<boolean>

Enable mockResponse middleware for all endpoints having responses configured.

Available options:
true,
false
Example:

true

authentication
enum<boolean>

Enable/disable the authentication mechanism in your Tyk Gateway for your OAS API

Available options:
true,
false
Example:

true

Body

application/json

The body is of type object.

Response

API patched.

action
string
Example:

"modified"

key
string
Example:

"b13d928b9972bd18"

key_hash
string
status
string
Example:

"ok"