Creating a New API

You can create APIs in API Hub for Design in several ways:

You can create APIs in your personal account or for any organization you created.

Create an API in API Hub for Design

  1. In the sidebar on the left, click and select Create New API.

    API_screenshot_create_API_01.png
  2. You will see a dialog where you will need to enter the API information:

    API_screenshot_create_API_02.png
    • Owner – Choose whether to create the API in your personal or organization account. The owner ID of the API owner is part of the API path in API Hub for Design: https://app.swaggerhub.com/apis/OwnerID/{api-name}/1.0. Organization-owned APIs count toward the organization’s limits rather than yours.

      Note

      Organization owners and anyone with the Designer role can create APIs in that organization.

    • Project – If an organization is selected as the Owner, you can optionally select a project to add this API to. The list contains existing projects available to you.

    • Specification – Choose the API format: OpenAPI 2.0, OpenAPI 3.0 or AsyncAPI. Note: OpenAPI 3.0 support has some limitations, AsyncAPI also has limitations.

    • Template – For OpenAPI: Select a template API, such as Petstore or IOT (Internet of Things), or select None to start with a blank API. If you have defined API custom templates, those will appear in the pulldown, and you can choose them.

    • Name – The API name is its unique ID and is part of its path on API Hub for Design, as in https://app.swaggerhub.com/api/{owner}/petstore/1.0. Requirements:

      • 3 to 60 characters long

      • allowed characters: A..Z a..z 0..9 - _.

      • must start and end with a letter or digit

      Note that API names are case-sensitive, so petstore and PetStore are two different APIs.

    • Visibility – Choose whether to make the API public or private. Public APIs are visible to anyone, even to people without a API Hub for Design account. Private APIs can be accessed only by owners and by those added as designers or consumers on this API. You can change the API visibility later if needed.

    • Auto Mock API – If selected, API Hub for Design will automatically create an API mock with the base path https://virtserver.swaggerhub.com/{owner}/{api}/{version}. This will let you test your API when designing it, and will let developers start working on the client application without having to wait until the API functionality is implemented. API Hub for Design will also create the API Auto Mocking integration for your new API that will automatically update the mock every time you save the API. For more information on using mocks, see API Auto Mocking.

    When creating a blank API (no template), you also need to specify the following fields:

    • Version – The API version. For example, 1.0, 1.0.0, 1.0b5, beta. See Version Format.

    • Title – The API title that is displayed in the interactive API docs. For example, Pet Store API.

    • Description – An overview of what your API is for. The description will be included in the API definition and displayed in search results in API Hub for Design. You can change the description later.

  3. Click Create API.

After you create the API, the API Hub for Design editor will open where you can write your API definition.

See Also

Publication date: