Manage versions

This pageapplies toApigee andApigee hybrid.

This topic explains how to create and manage API versions. To learn about versions, seeVersions overview.

Add a version to an API

You can add anAPI version to an existing API in the console or with the REST API.

Console

To add a new version:

  1. In the Google Cloud console, go to theAPI hub page.

    Go to API hub
  2. ClickAPIs.
  3. Locate the API you wish to version. UseFilter to specify keywords to filter the list of APIs. If needed, useSearch to locate an API.
  4. Click an API to view its details.
  5. Click theVersions tab and select the version you wish to add from theSelect a version drop-down list.
  6. ClickAdd version.
  7. Specify version details in theAdd a new version form. You must provide a display name. The other attributes are optional. For more information on attributes, seeManage attributes.
  8. ClickCreate.

REST

To add a new version using theCreate an API version API:

curl "https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions?version_id=VERSION_ID"  -H "Authorization: Bearer: $(gcloud auth print-access-token)" -X POST -H "Content-Type: application/json" \  '{    "display-name": "DISPLAY_NAME",    "description": "DESCRIPTION"               # description is an optional attribute    }'

Replace the following:

Sample output:

{  "name": "projects/myproject/locations/myproject/apis/docs-api-1/versions/myversion1",  "displayName": "My Version 1",  "createTime": "2024-04-02T18:48:41.162360Z",  "updateTime": "2024-04-02T18:48:41.162360Z"}

List API versions

This section explains how to list the versions associated with a registered API.

REST

To view all the versions associated with a registered API, use theList API versions API:

curl "https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions"  -H "Authorization: Bearer: $(gcloud auth print-access-token)" -H "Content-Type: application/json"

Replace the following:

  • HUB_PROJECT: The name of your API hub host project. The host project was selected when API hub was provisioned.
  • HUB_LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
  • API_ID: The unique ID of the API resource.

Sample output:

{  "versions": [    {      "name": "projects/myproject/locations/us-central1/apis/streetcarts-test/versions/streetcarts-testv1",      "displayName": "Streetcarts Test v1"    }  ]}

Get API version details

This section explains how to get the details about an API version, including its attributes, operations, deployments, and specification files.

Console

To view version details in the console:

  1. In the Google Cloud console, go to theAPI hub page.

    Go to API hub
  2. ClickAPIs.
  3. Locate the API you wish to inspect. UseFilter to specify keywords to filter the list of APIs. If needed, useSearch to locate an API.
  4. Click an API to view its details.
  5. Click theVersions tab and select the version you wish to view from theSelect a version drop-down list.
  6. Click a version to view its details.

    TheVersion details page displays the following information about the version:

    • Version details: General information about the version, including its display name, documentation, and system-defined attributes.
    • Operations: A list of API operations that are part of the version.
    • Specification files: A list of specifications that are part of the version.
    • Deployments: A list of deployments that are associated with the version.
    • Documentation: The documentation attribute associated with the version.
    • Additional attributes: Any user-defined attributes associated with the version.

REST

To view details of a version using theGet API version details API:

curl "https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions/VERSION_ID"  -H "Authorization: Bearer: $(gcloud auth print-access-token)" -X GET -H "Content-Type: application/json"

Replace the following:

  • HUB_PROJECT: The name of your API hub host project. The host project was selected when API hub was provisioned.
  • HUB_LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
  • API_ID: The unique ID of the API resource.
  • VERSION_ID: The unique ID of the version.

Sample output:

{  "name": "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1",  "displayName": "Test Version 3",  "documentation": {},  "specs": [    "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1/specs/docs-spec-1"  ],  "apiOperations": [    "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1/operations/listpets",    "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1/operations/createpets",    "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1/operations/deletepet",    "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1/operations/getpetbyid",    "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1/operations/updatepet"  ],  "definitions": [    "projects/myproject/locations/us-central1/apis/streetcarts/versions/streetcarts_testv1/definitions/pet"  ],  "createTime": "2024-04-04T14:53:57.299213423Z",  "updateTime": "2024-04-04T14:53:58.027321138Z"}

Delete an API version

This section explains how to delete an API version associated with an API resource.

Console

When you delete a version in the UI, all of the underlying specifications associated with the version (if any) are deleted.

To delete a version:

  1. In the Google Cloud console, go to theAPI hub page.

    Go to API hub
  2. ClickAPIs.
  3. Locate the API that includes the version you wish to delete.
  4. Click an API to view its details.
  5. Click theVersions tab and select the version you wish to delete from theSelect a version drop-down list.
  6. ClickDelete version.

REST

By default, a version can only be deleted if all underlying specifications are deleted. If you want to delete all specifications under a version in one step, set theforce query parameter totrue in the Delete REST API.

To delete a version using theDelete API version API:

curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" \  'https://apihub.googleapis.com/v1/projects/API_PROJECT/locations/API_LOCATION/apis/API_ID/versions/VERSION_ID'

Replace the following:

  • API_PROJECT: The name of your API hub host project. The host project was selected when API hub was provisioned.
  • API_LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
  • API_ID: The unique ID of the API resource.
  • VERSION_ID: The ID of the version to delete.

To delete a version and all underlying specifications, set theforce query parameter totrue. For example:

curl -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" \  'https://apihub.googleapis.com/v1/projects/API_PROJECT/locations/API_LOCATION/apis/API_ID/versions/VERSION_ID?force=true'

Edit a version

Console

To edit a version:

  1. In the Google Cloud console, go to theAPI hub page.

    Go to API hub
  2. ClickAPIs.
  3. UseFilter to specify keywords to filter the list of APIs. If needed, useSearch to locate an API.
  4. Click an API to view its details.
  5. Click theVersions tab and select the version you wish to edit from theSelect a version drop-down list.
  6. ClickEdit.
  7. After making edits, clickSave to save your changes. For a description of the editable attributes, see theversion resource description in the REST API reference.

REST

To edit a version with the REST API:

curl "https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions/VERSION_ID?updateMask=LIST_OF_ATTRIBUTES"    -H "Authorization: Bearer: $(gcloud auth print-access-token)" -X PATCH -H "Content-Type: application/json" \    '{      "display-name":DISPLAY_NAME,  # Use the request body to specify attribute changes      "description": "DESCRIPTION"    }'

Replace the following:

  • HUB_PROJECT: The name of your API hub host project. The host project was selected when API hub was provisioned.
  • HUB_LOCATION: The location of the host project. The location was chosen when API hub was provisioned.
  • API_ID: The unique ID of the API that has the version you wish to edit.
  • VERSION_ID: The ID of the version to edit.
  • DESCRIPTION: You can add other editable attributes in the request body, like the description and others. The editable attributes are listed in the Apigee hub API reference. thePatch version API.
  • LIST_OF_ATTRIBUTES: A comma-separated list of fully qualified attribute names. For example:?updateMask="description".

Sample output:

{  "name": "projects/myproject/locations/us-central1/apis/streetcarts-test/versions/streetcarts-testv1",  "displayName": "Streetcarts Test v1",  "description": "This is a revision of the test version.",  "documentation": {},  "createTime": "2024-04-18T19:57:11.870761Z",  "updateTime": "2024-04-18T20:23:42.465324Z"}

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-18 UTC.