Forking an API

Forking creates a copy of a specific version of an API in your account. For example, you can fork someone else’s API as a starting point for your own API. Or you can create a fork of your own API to experiment with changes without affecting the original API definition.

You can fork to your personal account or to any organization you created.

Forks are not linked to the original API in any way, so the changes in the original API do not affect the forks.

Public vs private APIs

Public APIs can be forked by any logged-in API Hub for Design user. Private APIs can be forked only by the API owner and by the people who are designers on that API.

How to fork an API

  1. Open the API page in API Hub for Design.

  2. If the API has several versions, select the version you want to fork.

    API_screenshot_API_versions_01.png
  3. Click the API name. This will open the API Info panel.

    API_screenshot_open_API_infopanel_01.png
  4. Click Fork in the API Info panel.

  5. Enter the name for your fork and specify other details.

    Forked API
    • API Name – The ID of your API, which will be part of the API URL in API Hub for Design, as in https://app.swaggerhub.com/apis/{owner}/petstore/1.0.

      The ID must be at least 3 characters long and must start and end with a letter or digit. You can use English letters (A..Z, a..z), digits (0..9), dots (.), hyphens (-), and underscores (_). IDs are case-sensitive, so petstore and PetStore are two different APIs.

    • API Version – The API version. For example, 1.0, 1.0.0, 1.0b5, beta (see Version Format). It does not necessarily need to match the API version you are forking, because the fork will be a completely different API.

    • Owner – Choose whether to create the API in your personal or organization account (if you are a member of an organization on API Hub for Design). The API owner is part of the API path in API Hub for Design: 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.Projects

      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 API Hub for Design account. Private APIs can be accessed only by owners and by the people added as designers or consumers). You can change the API visibility later if needed.

  6. Click Fork API.

API Hub for Design will copy the API to the specified owner account and will open the API definition in the API Hub for Design editor where you can edit it.

Notes

  • Forking does not copy integrations and comments that exist in the original API. This is by design to protect the integrity of the original API.

  • The “Save as New’ command is another way to copy an existing specification to a new API spec. This command works only for the APIs that you can edit in API Hub for Design. Forking can be used for any accessible API specification.

See Also

Publication date: