SmartBear APIs API

Manage API definitions and versions

OpenAPI Specification

smartbear-apis-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: SmartBear SwaggerHub APIs API
  description: The SwaggerHub API provides programmatic access to manage API definitions, domains, projects, and integrations on the SwaggerHub platform. It allows teams to automate API lifecycle management including creating, updating, publishing, and versioning APIs. The API also supports organization management, member access control, and integration configuration with third-party services.
  version: 1.0.0
  termsOfService: https://smartbear.com/terms-of-use/
  contact:
    name: SmartBear Support
    url: https://support.smartbear.com/swaggerhub/
  license:
    name: SmartBear License
    url: https://smartbear.com/terms-of-use/
servers:
- url: https://api.swaggerhub.com
  description: SwaggerHub SaaS
security:
- ApiKeyAuth: []
tags:
- name: APIs
  description: Manage API definitions and versions
paths:
  /apis/{owner}:
    get:
      operationId: getOwnerApis
      summary: Get Owner APIs
      description: Retrieves all APIs for a given owner (user or organization).
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
        description: Username or organization name
      - name: page
        in: query
        required: false
        schema:
          type: integer
          default: 0
        description: Page number for pagination
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 10
        description: Number of results per page
      - name: sort
        in: query
        required: false
        schema:
          type: string
          enum:
          - NAME
          - CREATED
          - UPDATED
        description: Sort field
      - name: order
        in: query
        required: false
        schema:
          type: string
          enum:
          - ASC
          - DESC
        description: Sort order
      responses:
        '200':
          description: A list of APIs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApisJson'
        '401':
          description: Unauthorized
  /apis/{owner}/{api}:
    get:
      operationId: getApiVersions
      summary: Get API Versions
      description: Returns the list of versions for a given API.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: API version list
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApisJson'
        '401':
          description: Unauthorized
        '404':
          description: Not Found
    post:
      operationId: saveDefinition
      summary: Create Or Update API Version
      description: Creates a new API or updates an existing API version.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: query
        required: false
        schema:
          type: string
        description: API version identifier
      - name: isPrivate
        in: query
        required: false
        schema:
          type: boolean
        description: Set API visibility to private
      requestBody:
        required: true
        content:
          application/yaml:
            schema:
              type: string
          application/json:
            schema:
              type: string
      responses:
        '200':
          description: API updated
        '201':
          description: API created
        '401':
          description: Unauthorized
    delete:
      operationId: deleteApi
      summary: Delete API
      description: Deletes the specified API and all its versions.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: API deleted
        '401':
          description: Unauthorized
        '404':
          description: Not Found
  /apis/{owner}/{api}/{version}:
    get:
      operationId: getDefinition
      summary: Get API Definition
      description: Retrieves the OpenAPI definition for a specific API version.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: API definition
          content:
            application/yaml:
              schema:
                type: string
            application/json:
              schema:
                type: object
        '401':
          description: Unauthorized
        '404':
          description: Not Found
    delete:
      operationId: deleteApiVersion
      summary: Delete API Version
      description: Deletes a specific version of an API.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Version deleted
        '401':
          description: Unauthorized
        '404':
          description: Not Found
  /apis/{owner}/{api}/{version}/swagger.yaml:
    get:
      operationId: downloadDefinitionYaml
      summary: Download API Definition As YAML
      description: Downloads the API definition as YAML format.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: YAML definition file
          content:
            application/yaml:
              schema:
                type: string
  /apis/{owner}/{api}/{version}/swagger.json:
    get:
      operationId: downloadDefinitionJson
      summary: Download API Definition As JSON
      description: Downloads the API definition as JSON format.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: JSON definition file
          content:
            application/json:
              schema:
                type: object
  /apis/{owner}/{api}/{version}/publish:
    post:
      operationId: publishApi
      summary: Publish API Version
      description: Publishes a specific version of an API.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: API version published
        '401':
          description: Unauthorized
  /apis/{owner}/{api}/{version}/unpublish:
    post:
      operationId: unpublishApi
      summary: Unpublish API Version
      description: Unpublishes a specific version of an API.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: API version unpublished
        '401':
          description: Unauthorized
  /apis/{owner}/{api}/{version}/default:
    put:
      operationId: setDefaultApiVersion
      summary: Set Default API Version
      description: Sets the specified version as the default for the API.
      tags:
      - APIs
      parameters:
      - name: owner
        in: path
        required: true
        schema:
          type: string
      - name: api
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Default version set
        '401':
          description: Unauthorized
  /search:
    get:
      operationId: searchApis
      summary: Search APIs
      description: Searches the SwaggerHub public API catalog.
      tags:
      - APIs
      parameters:
      - name: query
        in: query
        required: true
        schema:
          type: string
        description: Search query string
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 10
      - name: page
        in: query
        required: false
        schema:
          type: integer
          default: 0
      - name: sort
        in: query
        required: false
        schema:
          type: string
          enum:
          - NAME
          - CREATED
          - UPDATED
      - name: order
        in: query
        required: false
        schema:
          type: string
          enum:
          - ASC
          - DESC
      responses:
        '200':
          description: Search results
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApisJson'
components:
  schemas:
    ApiEntry:
      type: object
      properties:
        name:
          type: string
        description:
          type: string
        created:
          type: string
          format: date-time
        modified:
          type: string
          format: date-time
        swaggerUrl:
          type: string
        url:
          type: string
        versions:
          type: array
          items:
            type: string
        owner:
          type: string
        isPrivate:
          type: boolean
        tags:
          type: array
          items:
            type: string
    ApisJson:
      type: object
      properties:
        offset:
          type: integer
        totalCount:
          type: integer
        apis:
          type: array
          items:
            $ref: '#/components/schemas/ApiEntry'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization