Tyk

Tyk Tyk OAS APIs API

**Note: Applies only to Tyk Gateway Community Edition**

OpenAPI Specification

tyk-tyk-oas-apis-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Tyk Dashboard Admin Additional Permissions Tyk OAS APIs API
  version: 5.3.0
  description: 'For Tyk On-Premises installations only, the Dashboard Admin API has two endpoints and is used to set up and provision a Tyk Dashboard instance without the command line.


    In order to use the Dashboard Admin API, you''ll need to get the `admin_secret` value from your Tyk Dashboard configurations.


    The secret you set should then be sent along as a header with each Dashboard Admin API Request in order for it to be successful:


    ```

    admin-auth: <your-secret>

    ```'
servers:
- url: http://localhost/
- url: https://localhost/
security:
- ApiKeyAuth: []
tags:
- description: '**Note: Applies only to Tyk Gateway Community Edition** <br/>


    '
  name: Tyk OAS APIs
paths:
  /tyk/apis/oas:
    get:
      description: List all APIs in Tyk OAS API format, from Tyk Gateway.
      operationId: listApisOAS
      parameters:
      - description: "By default mode is empty which means it will return the Tyk API OAS spec including the x-tyk-api-gateway part. \n When mode=public, the Tyk OAS API spec will exclude the x-tyk-api-gateway part in the response."
        example: public
        in: query
        name: mode
        required: false
        schema:
          enum:
          - public
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                oasExampleList:
                  $ref: '#/components/examples/oasExampleList'
              schema:
                items:
                  allOf:
                  - $ref: https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json
                  - $ref: '#/components/schemas/XTykAPIGateway'
                type: array
          description: List of API definitions in Tyk OAS format.
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
      summary: List All Apis in Tyk Oas Api Format.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    post:
      description: Create an API with Tyk OAS API format on the Tyk Gateway.
      operationId: createApiOAS
      parameters:
      - description: The base API which the new version will be linked to.
        example: 663a4ed9b6be920001b191ae
        in: query
        name: base_api_id
        required: false
        schema:
          type: string
      - description: The version name of the base API while creating the first version. This doesn't have to be sent for the next versions but if it is set, it will override base API version name.
        example: Default
        in: query
        name: base_api_version_name
        required: false
        schema:
          type: string
      - description: The version name of the created version.
        example: v2
        in: query
        name: new_version_name
        required: false
        schema:
          type: string
      - description: If true, the new version is set as default version.
        example: true
        in: query
        name: set_default
        required: false
        schema:
          type: boolean
      requestBody:
        content:
          application/json:
            example:
              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
            schema:
              allOf:
              - $ref: https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json
              - $ref: '#/components/schemas/XTykAPIGateway'
      responses:
        '200':
          content:
            application/json:
              example:
                action: added
                key: e30bee13ad4248c3b529a4c58bb7be4e
                status: ok
              schema:
                $ref: '#/components/schemas/ApiModifyKeySuccess'
          description: API created.
        '400':
          content:
            application/json:
              example:
                message: the payload should contain x-tyk-api-gateway
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Bad Request
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '500':
          content:
            application/json:
              example:
                message: file object creation failed, write error
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Internal server error.
      summary: Create an Api With Tyk Oas Format.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /tyk/apis/oas/{apiID}:
    delete:
      description: Deleting an API definition will remove the file from the file store, the API definition will not be unloaded, a separate reload request will need to be made to disable the API endpoint.
      operationId: deleteOASApi
      parameters:
      - description: The API ID.
        example: 1bd5c61b0e694082902cf15ddcc9e6a7
        in: path
        name: apiID
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              example:
                action: deleted
                key: 1bd5c61b0e694082902cf15ddcc9e6a7
                status: ok
              schema:
                $ref: '#/components/schemas/ApiModifyKeySuccess'
          description: API deleted
        '400':
          content:
            application/json:
              example:
                message: Must specify an apiID to delete
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Bad Request
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                message: API not found
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: API not found.
        '500':
          content:
            application/json:
              example:
                message: Delete failed
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Internal server error.
      summary: Deleting a Tyk Oas Api.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    get:
      description: Get Tyk OAS API definition using an API ID.
      operationId: getOASApi
      parameters:
      - description: "By default mode is empty which means it will return the Tyk API OAS spec including the x-tyk-api-gateway part. \n When mode=public, the Tyk OAS API spec will exclude the x-tyk-api-gateway part in the response."
        example: public
        in: query
        name: mode
        required: false
        schema:
          enum:
          - public
          type: string
      - description: ID of the API you want to fetch
        example: 4c1c0d8fc885401053ddac4e39ef676b
        in: path
        name: apiID
        required: true
        schema:
          type: string
      responses:
        '200':
          content:
            application/json:
              examples:
                oasExample:
                  $ref: '#/components/examples/oasExample'
              schema:
                allOf:
                - $ref: https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json
                - $ref: '#/components/schemas/XTykAPIGateway'
          description: OK
          headers:
            x-tyk-base-api-id:
              description: ID of the base API if the requested API is a version.
              schema:
                type: string
              style: simple
        '400':
          content:
            application/json:
              example:
                message: the requested API definition is in Tyk classic format, please use old API endpoint
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Bad Request
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                message: API not found
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: API not found.
      summary: Get a Tyk Oas Api Definition.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    patch:
      description: 'You can use this endpoint to update Tyk OAS part of the Tyk API definition.

        This endpoint allows you to configure Tyk OAS extension based on query params provided(similar to import).'
      operationId: patchApiOAS
      parameters:
      - description: ID of the API you want to fetch.
        example: 4c1c0d8fc885401053ddac4e39ef676b
        in: path
        name: apiID
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/UpstreamURL'
      - $ref: '#/components/parameters/ListenPath'
      - $ref: '#/components/parameters/CustomDomain'
      - $ref: '#/components/parameters/AllowList'
      - $ref: '#/components/parameters/ValidateRequest'
      - $ref: '#/components/parameters/MockResponse'
      - $ref: '#/components/parameters/Authentication'
      requestBody:
        content:
          application/json:
            example:
              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
            schema:
              $ref: https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiModifyKeySuccess'
          description: API patched.
        '400':
          content:
            application/json:
              example:
                message: Must specify an apiID to patch
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Bad Request
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                message: API not found
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: API not found.
        '500':
          content:
            application/json:
              example:
                message: file object creation failed, write error
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Internal server error.
      summary: Patch Api in Tyk Oas Format.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
    put:
      description: "Updating an API definition uses the same signature an object as a `POST`, however it will first ensure that the API ID that is being updated is the same as the one in the object being `PUT`.\n\n\n      Updating will completely replace the file descriptor and will not change an API Definition that has already been loaded, the hot-reload endpoint will need to be called to push the new definition\nto live."
      operationId: updateApiOAS
      parameters:
      - description: ID of the API you want to fetch
        example: 4c1c0d8fc885401053ddac4e39ef676b
        in: path
        name: apiID
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            example:
              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
            schema:
              allOf:
              - $ref: https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json
              - $ref: '#/components/schemas/XTykAPIGateway'
      responses:
        '200':
          content:
            application/json:
              example:
                action: modified
                key: e30bee13ad4248c3b529a4c58bb7be4e
                status: ok
              schema:
                $ref: '#/components/schemas/ApiModifyKeySuccess'
          description: API updated
        '400':
          content:
            application/json:
              example:
                message: Request APIID does not match that in Definition! For Update operations these must match.
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Bad Request
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                message: API not found
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: API not found
        '500':
          content:
            application/json:
              example:
                message: file object creation failed, write error
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Internal server error.
      summary: Update a Tyk Oas Api Definition.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /tyk/apis/oas/{apiID}/export:
    get:
      description: Use the mode query parameter to specify if you want the x-tyk-api-gateway stripped out.
      operationId: downloadApiOASPublic
      parameters:
      - description: ID of the API you want to fetch.
        example: 4c1c0d8fc885401053ddac4e39ef676b
        in: path
        name: apiID
        required: true
        schema:
          type: string
      - description: "By default mode is empty which means it will return the Tyk API OAS spec including the x-tyk-api-gateway part. \n When mode=public, the Tyk OAS API spec will exclude the x-tyk-api-gateway part in the response."
        example: public
        in: query
        name: mode
        required: false
        schema:
          enum:
          - public
          type: string
      responses:
        '200':
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
          description: Exported API definition file
        '400':
          content:
            application/json:
              example:
                message: requesting API definition that is in Tyk classic format
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Bad Request
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                message: API not found
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Not Found
        '500':
          content:
            application/json:
              example:
                message: Unexpected error
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Internal server error.
      summary: Download a Tyk Oas Format Api.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /tyk/apis/oas/{apiID}/versions:
    get:
      description: Listing versions of a Tyk OAS API.
      operationId: listOASApiVersions
      parameters:
      - description: ID of the API you want to fetch.
        example: 4c1c0d8fc885401053ddac4e39ef676b
        in: path
        name: apiID
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/SearchText'
      - $ref: '#/components/parameters/AccessType'
      responses:
        '200':
          content:
            application/json:
              example:
                apis:
                - expirationDate: ''
                  id: keyless
                  internal: false
                  isDefaultVersion: false
                  name: Tyk Test Keyless API
                  versionName: ''
                - expirationDate: ''
                  id: 1f20d5d2731d47ac9c79fddf826eda00
                  internal: false
                  isDefaultVersion: true
                  name: Version three Api
                  versionName: v2
                status: success
              schema:
                $ref: '#/components/schemas/VersionMetas'
          description: API version metas.
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '404':
          content:
            application/json:
              example:
                message: API not found.
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: API not found
      summary: Listing Versions of a Tyk Oas Api.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /tyk/apis/oas/export:
    get:
      description: Download all Tyk OAS format APIs, from the Gateway.
      operationId: downloadApisOASPublic
      parameters:
      - description: "By default mode is empty which means it will return the Tyk API OAS spec including the x-tyk-api-gateway part. \n When mode=public, the Tyk OAS API spec will exclude the x-tyk-api-gateway part in the response."
        example: public
        in: query
        name: mode
        required: false
        schema:
          enum:
          - public
          type: string
      responses:
        '200':
          content:
            application/octet-stream:
              schema:
                format: binary
                type: string
          description: Get a list of Tyk OAS APIs definitions.
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '500':
          content:
            application/json:
              example:
                message: Unexpected error
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Internal server error.
      summary: Download All Tyk Oas Format Apis.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
  /tyk/apis/oas/import:
    post:
      description: "Import an Tyk OAS format API without x-tyk-gateway.\n For use with an existing Tyk OAS API that you want to expose via your Tyk Gateway."
      operationId: importOAS
      parameters:
      - $ref: '#/components/parameters/UpstreamURL'
      - $ref: '#/components/parameters/ListenPath'
      - $ref: '#/components/parameters/CustomDomain'
      - $ref: '#/components/parameters/AllowList'
      - $ref: '#/components/parameters/ValidateRequest'
      - $ref: '#/components/parameters/MockResponse'
      - $ref: '#/components/parameters/Authentication'
      - description: The base API which the new version will be linked to.
        example: 663a4ed9b6be920001b191ae
        in: query
        name: base_api_id
        required: false
        schema:
          type: string
      - description: The version name of the base API while creating the first version. This doesn't have to be sent for the next versions but if it is set, it will override base API version name.
        example: Default
        in: query
        name: base_api_version_name
        required: false
        schema:
          type: string
      - description: The version name of the created version.
        example: v2
        in: query
        name: new_version_name
        required: false
        schema:
          type: string
      - description: If true, the new version is set as default version.
        example: true
        in: query
        name: set_default
        required: false
        schema:
          type: boolean
      requestBody:
        content:
          application/json:
            example:
              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
            schema:
              $ref: https://raw.githubusercontent.com/TykTechnologies/tyk/refs/heads/master/apidef/oas/schema/3.0.json
      responses:
        '200':
          content:
            application/json:
              example:
                action: added
                key: e30bee13ad4248c3b529a4c58bb7be4e
                status: ok
              schema:
                $ref: '#/components/schemas/ApiModifyKeySuccess'
          description: API imported.
        '400':
          content:
            application/json:
              example:
                message: the import payload should not contain x-tyk-api-gateway
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Bad Request
        '403':
          content:
            application/json:
              example:
                message: Attempted administrative access with invalid or missing key!
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Forbidden
        '500':
          content:
            application/json:
              example:
                message: file object creation failed, write error
                status: error
              schema:
                $ref: '#/components/schemas/ApiStatusMessage'
          description: Internal server error.
      summary: Import an Api in Tyk Oas Format.
      tags:
      - Tyk OAS APIs
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    Operation:
      properties:
        allow:
          $ref: '#/components/schemas/Allowance'
        block:
          $ref: '#/components/schemas/Allowance'
        cache:
          $ref: '#/components/schemas/CachePlugin'
        circuitBreaker:
          $ref: '#/components/schemas/CircuitBreaker'
        doNotTrackEndpoint:
          $ref: '#/components/schemas/TrackEndpoint'
        enforceTimeout:
          $ref: '#/components/schemas/EnforceTimeout'
        ignoreAuthentication:
          $ref: '#/components/schemas/Allowance'
        internal:
          $ref: '#/components/schemas/Internal'
        mockResponse:
          $ref: '#/components/schemas/MockResponse'
        postPlugins:
          $ref: '#/components/schemas/EndpointPostPlugins'
        rateLimit:
          $ref: '#/components/schemas/RateLimitEndpoint'
        requestSizeLimit:
          $ref: '#/components/schemas/RequestSizeLimit'
        trackEndpoint:
          $ref: '#/components/schemas/TrackEndpoint'
        transformRequestBody:
          $ref: '#/components/schemas/TransformBody'
        transformRequestHeaders:
          $ref: '#/components/schemas/TransformHeaders'
        transformRequestMethod:
          $ref: '#/components/schemas/TransformRequestMethod'
        transformResponseBody:
          $ref: '#/components/schemas/TransformBody'
        transformResponseHeaders:
          $ref: '#/components/schemas/TransformHeaders'
        urlRewrite:
          $ref: '#/components/schemas/URLRewrite'
        validateRequest:
          $ref: '#/components/schemas/ValidateRequest'
        virtualEndpoint:
          $ref: '#/components/schemas/VirtualEndpoint'
      type: object
    Cache:
      properties:
        cacheAllSafeRequests:
          type: boolean
          example: true
        cacheByHeaders:
          items:
            type: string
          type: array
          example: []
        cacheResponseCodes:
          items:
            type: integer
          type: array
          example: []
        controlTTLHeaderName:
          type: string
          example: example_value
        enableUpstreamCacheControl:
          type: boolean
          example: true
        enabled:
          type: boolean
          example: true
        timeout:
          type: integer
          example: 10
      type: object
    PluginConfigData:
      properties:
        enabled:
          type: boolean
          example: true
        value:
          additionalProperties: {}
          nullable: true
          type: object
          example: example_value
      type: object
    BooleanQueryP

# --- truncated at 32 KB (59 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/tyk/refs/heads/main/openapi/tyk-tyk-oas-apis-api-openapi.yml