Manage operations Stay organized with collections Save and categorize content based on your preferences.
This pageapplies toApigee andApigee hybrid.
This page describes how to create and manage API operations in API hub. To learn more about operations, seeIntroduction to API operations.
Add an operation to an API version
You can add an API operation to an existingAPI version in the console or with the REST API.
Console
To add a new API operation to an API version, do the following:
In the Google Cloud console, go to theAPI hub page.
Go to API hub- ClickAPIs.
- Locate the API you wish to add an operation to. UseFilter to specify keywords to filter the list of APIs. If needed, useSearch to locate an API.
- Click the API to view its details.
- Click theVersions tab and select the version you wish to add from theSelect a version drop-down list.
- Go to theOperations section, clickAdd operation.
- Specify operation details in theAdd operation form.
- Operation ID: ClickSpecify Unique ID to optionally provide a unique ID for the operation. If you omit the ID, API hub creates one for you.Note: The ID must be 4-500 characters long and can contain only uppercase letters (A-Z), lowercase letters (a-z), numbers (0-9), and hyphens (-). The ID forms the last part of the API resource name:
projects/PROJECT/locations/LOCATION/apis/API_ID/versions/VERSION_ID/operations/OPERATION_ID. The full resource name is limited to 700 characters. - Documentation: Enter the URL to documentation for the API operation.
- Description: Add a description of the operation.
- Operation type: This field is automatically set as
HTTP. - Deprecated: Select if the operation is deprecated.
- Path: Enter the path of the operation.
- Path description: Enter the description of the path of the operation.
- Method: Enter the method of the operation.
- Additional attributes: Add user-defined attributes based on your organizational or team needs. SeeUser attributes.
- Operation ID: ClickSpecify Unique ID to optionally provide a unique ID for the operation. If you omit the ID, API hub creates one for you.Note: The ID must be 4-500 characters long and can contain only uppercase letters (A-Z), lowercase letters (a-z), numbers (0-9), and hyphens (-). The ID forms the last part of the API resource name:
- ClickCreate.
REST
To add a new API operation using theCreate operations API, use the following command:
curl --location --request POST 'https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions/VERSION_ID/operations?api_operation_id=OPERATION_ID' \--header 'Authorization: Bearer $(gcloud auth print-access-token)' \--header 'Content-Type: application/json' \--data '{ "details":{ "description":"DESCRIPTION", "deprecated":false, "documentation":{ "external_uri":"EXTERNAL_URI" }, "http_operation":{ "method":"METHOD", "path":{ "path":"PATH", "description":"DESCRIPTION" } } }}'Replace the following:
- HUB_PROJECT: The project ID of the API hub project.
- HUB_LOCATION: The location of the API hub project.
- API_ID: The ID of the API.
- VERSION_ID: The ID of the API version.
- OPERATION_ID: The ID of the API operation.
- DESCRIPTION: The description of the API operation.
- EXTERNAL_URI: The external URI of the API operation.
- METHOD: The method of the API operation.
- PATH: The path of the API operation.
Example:
curl --location --request POST 'https://apihub.googleapis.com/v1/projects/test-project/locations/us-central1/apis/test-api/versions/version-id/operations?api_operation_id=test-operation' \ --header 'Authorization: Bearer $(gcloud auth print-access-token)' \ --header 'Content-Type: application/json' \ --data '{ "details":{ "description":"api to create root level entity api in apihub", "deprecated":false, "documentation":{ "external_uri":"https://google.com" }, "http_operation":{ "method":"POST", "path":{ "path":"/apis", "description":"It is ccfe managed resource" } } } }'Edit an API operation
You can edit an API operation of an API version in the console or with the REST API.
Console
To edit an API operation, do the following:
In the Google Cloud console, go to theAPI hub page.
Go to API hub- ClickAPIs.
- Locate the API with the version that contains the operation you wish to edit. UseFilter to specify keywords to filter the list of APIs. If needed, useSearch to locate an API.
- Click the API to view its details.
- Click theVersions tab and select the version that contains the operation you wish to edit.
- Go to theOperations section and locate the operation you wish to edit.
- SelectEdit from theActions menu in the row of the operation you wish to edit.
- In theEdit operation form, make the required changes to the operation details.
- ClickSave.
REST
To edit or update an API operation using thePatch operations API, use the following command:
curl --location --request PATCH 'https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions/VERSION_ID/operations/OPERATION_ID?update_mask=UPDATE_MASK' \ --header 'Authorization: Bearer $(gcloud auth print-access-token)' \ --data '{ "details":{ "description":"DESCRIPTION", "deprecated":false, "documentation":{ "external_uri":"EXTERNAL_URI" }, "http_operation":{ "method":"METHOD", "path":{ "path":"PATH", "description":"DESCRIPTION" } } } }'Replace the following:
- HUB_PROJECT: The project ID of the API hub project.
- HUB_LOCATION: The location of the API hub project.
- API_ID: The ID of the API.
- VERSION_ID: The ID of the API version.
- OPERATION_ID: The ID of the API operation.
- UPDATE_MASK: The update mask of the API operation.
- DESCRIPTION: The description of the API operation.
- EXTERNAL_URI: The external URI of the API operation.
- PATH: The path of the API operation.
Example:
curl --location --request PATCH 'https://apihub.googleapis.com/v1/projects/test-project/locations/us-central1/apis/test-api/versions/version-id/operations/test-operation?update_mask=details.http_operation.path' \--header 'Authorization: Bearer $(gcloud auth print-access-token)' \--data '{ "details":{ "description":"api to create root level entity api in apihub update", "deprecated":false, "documentation":{ "external_uri":"https://google.com" }, "http_operation":{ "method":"POST", "path":{ "path":"/apiss", "description":"It is ccfe managed api" } } }}'Delete an API operation
You can delete an API operation in the console or with the REST API.
Console
To delete an API operation, do the following:
In the Google Cloud console, go to theAPI hub page.
Go to API hub- ClickAPIs.
- Locate the API with the version that contains the operation you wish to delete. UseFilter to specify keywords to filter the list of APIs. If needed, useSearch to locate an API.
- Click the API to view its details.
- Click theVersions tab and select the version that contains the operation you wish to delete.
- Go to theOperations section and locate the operation you wish to delete.
- SelectDelete from theActions menu in the row of the operation you wish to delete.
- ClickDelete in the confirmation dialog.
REST
To delete an API operation using theDelete operations API, use the following command:
curl --location --request DELETE 'https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions/VERSION_ID/operations/OPERATION_ID' \ --header 'Authorization: Bearer $(gcloud auth print-access-token)'
Replace the following:
- HUB_PROJECT: The project ID of the API hub project.
- HUB_LOCATION: The location of the API hub project.
- API_ID: The ID of the API.
- VERSION_ID: The ID of the API version.
- OPERATION_ID: The ID of the API operation.
Example:
curl --location --request DELETE 'https://apihub.googleapis.com/v1/projects/test-project/locations/us-central1/apis/test-api/versions/version-id/operations/test-operation' \ --header 'Authorization: Bearer $(gcloud auth print-access-token)'
List API operations
You can list or view the API operations of an API version using the API hub console UI or using theList operations API.
Console
To view the API operations of an API version, do the following:
In the Google Cloud console, go to theAPI hub page.
Go to API hub- ClickAPIs.
- Locate the API you wish to inspect. UseFilter to specify keywords to filter the list of APIs. If needed, useSearch to locate an API.
- Select an API.
- Go to theVersions tables in theAPI details page.
- Select an API version.
- The API operations for the selected API version are listed in theOperations table on the page.
REST
To list the API operations of an API version, use the following command:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -X GET https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions/VERSION_ID/operations
Replace the following:
- HUB_PROJECT: The project ID of the API hub project.
- HUB_LOCATION: The location of the API hub project.
- API_ID: The ID of the API.
- VERSION_ID: The ID of the API version.
Example:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -X GET https://apihub.googleapis.com/v1/projects/test-project/locations/us-central1/apis/test-api/versions/version-id/operations
Get API operation
You can get the details of an API operation using theGet operations API. These details include the name, specification, description, create time, update time, and user-defined attributes.
REST
To get the details of an API operation, use the following command:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -X GET https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/apis/API_ID/versions/VERSION_ID/operations/OPERATION_ID
Replace the following:
- HUB_PROJECT: The project ID of the API hub project.
- HUB_LOCATION: The location of the API hub project.
- API_ID: The ID of the API.
- VERSION_ID: The ID of the API version.
- OPERATION_ID: The ID of the API operation.
Example:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -X GET https://apihub.googleapis.com/v1/projects/test-project/locations/us-central1/apis/test-api/versions/version-id/operations/test-operation
Considerations
- For API versions with avalid OpenAPI specification and parsed operations, theOperations API can't be used to add, modify, or delete operations.
- When a valid OpenAPI specification is added to an API version containing existing operations, the operations defined in the specification will take precedence and replace the current ones.
What's next
- See the API reference documentation for theOperations API.
- Learn more aboutAPI specifications.
- Learn more aboutAPI operations.
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-19 UTC.