Deleting APIs

User can delete their own API definitions at any time, but organization-owned APIs can only be deleted by the organization owners. When an API is deleted, all the designers and consumer sharing that API receive an email notification.Resource Roles

Important

Deleting an API cannot be undone. You might want to download the API definition for backup purposes before deleting it.Download API Definitions From API Hub for Design

Delete from API catalog pages

Note: In API Hub for Design On-Premise, this is supported since v. 1.26.

  1. In the API Hub for Design sidebar, select the organization or project that contains the API you want to delete.

    If you want to delete a personal API, select Home instead.

  2. Find the API you want to delete. You can use sort, filter, and search options to find that API.Searching API Hub for Design

  3. Click Delete API to the right of the API.

    Note

    If there is no Delete APIbutton, it means you don’t have permissions to delete this API. For example, you may be an Editor, but not the Owner of the API.

  4. Select the Yes, I want to delete this API check box and click Delete API.

Delete from API Hub for Design Editor

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

  2. Click the API name. This will open the API Info panel.

    API_screenshot_open_API_infopanel_01.png
  3. Click Delete API in the API Info panel.

    Note

    If there is no Delete APIbutton, it means you don't have permissions to delete this API. For example, you may be an Editor, but not the Owner of the API.

  4. Select the Yes, I want to delete this API check box and click Delete API.

Delete an API with published versions

If your API has published versions, you need to unpublish them before deleting the API. This is an extra safety precaution against deleting published APIs.Publishing an API

  1. On your API page, open the version list and see which versions are published.

    API_screenshot_API_publishing_01.png
  2. For each published version:

    • Switch to this version.

    • Click unpublish.png to unpublish this version.

  3. After all versions have been unpublished, you can delete the API by clicking Delete API in the info panel.

Delete via CLI

Use API Hub for Design CLI to delete an API from the command line:

swaggerhub api:delete OWNER/API_NAME 

The --force option bypasses the confirmation prompt:

swaggerhub api:delete OWNER/API_NAME --force 

Note

The API must not have published versions, otherwise, the api:delete command will fail.Publishing an API

See Also

Publication date: