Saving an API as a New API

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 be a designer for it.

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

How it works

  1. Open one of your API specifications for editing.

    Select the needed version:

    Selecting 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 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.

      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 owners and by those added as designers or consumers). 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 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

Publication date: