Saving an API as a New API

Last modified on April 14, 2021

You can create an API by copying it from another API that exists in SwaggerHub. You can use this functionality to use some existing specification as a starting point for your API spec, or you can create a copy to experiment with changes without affecting the original spec.

To use this functionality, you must be an owner of the original API or you must have the Edit permissions for it.

The new API can belong to your personal account or to any organization you created.

How it works

  1. Open one of your API specifications for editing.

    Select the needed version:

    Select an API version

    Make changes to the specification, if needed.

  2. Select the Save as New command:

    The 'Save as New' command

    This will open the following dialog:

    The 'Save as New' dialog
  3. In the dialog, enter the following data:

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

      • 3 to 60 character 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.

    • API Version – The initial version of the new API. For example, 1.0, 1.0.0, 1.0b, and so on. See Version Format.

    • Owner – Choose whether to create the API in your personal or organization account (if you are a member of an organization on SwaggerHub). The API owner is part of the API path in SwaggerHub: https://app.swaggerhub.com/apis/owner/api-name/1.0. Organization-owned APIs count toward the organization’s limits rather than yours.

      Note: Organization owners can always create APIs in that organization. Members with the Designer role have “create” permissions if the organization is configured with the Allow Designers to Create APIs under the Organization option.
    • 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.

      SwaggerHub On-Premise note: This option was added in v. 1.23.
    • Visibility – Choose whether to make the API public or private. Public APIs are visible to anyone, even to people without a SwaggerHub account. Private APIs can be accessed only by you and by the people you added as collaborators). You can change the API visibility later if needed.

  4. Click Save.

Notes

  • The “Save as New” command does not copy integrations, versions and comments that exist in the original API. Also, it does not copy the user permissions defined in the original API.

  • Forking is another way of creating a new API based on some existing API. The difference between these approaches is that you can use “Save as New” only for the APIs which you can edit. Forking works for any API to which you have access. For example, you can fork any public API or a private API, where you are a collaborator.

See Also

APIs
Creating a New API
Forking an API
Versioning

Highlight search results