Create API supply chain dependencies

This pageapplies toApigee andApigee hybrid.

You can create a dependency between APIs, API versions, and API operations in API hub. The high-level process to create a dependency is as follows:

  1. Find two APIs that may have operations that may be dependent. The operations may be inregistered APIs orexternal APIs.
  2. Determine which API is the supplier and which is the consumer. As discussed previously, the consumer invokes the supplier.
  3. Use the Google Cloud console or theCreate dependency API to create the dependency between the supplier and consumer.
Note: API hub doesn't support creating dependencies between Model Context Protocol (MCP) tools.

Create a dependency

You can create a dependency in the console or with the REST API.

Console

To create a dependency using the Google Cloud console, do the following:

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

    Go to API hub
  2. ClickCreate dependency and provide the following inputs in theCreate a new dependency page.
  3. UnderGeneral details, do the following:
    1. Specify unique ID: (Optional) The identifier of the dependency. If not provided, a system-generated ID will be used.Note: Dependency 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/dependencies/DEPENDENCY_ID.
    2. Description: (Optional) A brief description of the dependency.
    3. ClickContinue.
  4. UnderSelect supplier resource, do the following:
    1. Resource type: SelectOperation as the supplier resource type.
    2. Supplier API: Select the API that supplies the operation.
    3. Version: Select the API version of the supplier API that provides the operation.
    4. Operation: Select the operation that is supplied to the consumer. For example:GET-/items.
    5. ClickContinue.
    6. Note:To use external APIs to create dependencies, you must use theDependencies API. For more information, see theREST API tab.
  5. UnderSelect consumer resource, do the following:
    1. Resource type: SelectOperation as the consumer resource type.
    2. Consumer API: Select the API that consumes the operation.
    3. Version: Select the API version of the consumer API that consumes the operation.
    4. Operation: Select the operation that is consumed by the supplier. For example:GET-/categories.
    5. ClickContinue.
  6. Optionally, provide values for any user-defined attributes that were defined in Settings.
  7. ClickCreate. The new dependency appears in theAPI supply chain page.

REST API

To create a new dependency using theCreate a dependency API, use the following command:

  curl -X POST 'https://apihub.googleapis.com/v1/projects/HUB_PROJECT/locations/HUB_LOCATION/dependencies?dependency_id=DEPENDENCY_ID' \  -H "Authorization: Bearer $(gcloud auth print-access-token)" \  -H 'Content-Type: application/json' \  --d '{      "description": "DESCRIPTION",      "supplier": {          // Specify one of the following:          "operation_resource_name":RESOURCE_NAME          // OR          "external_api_resource_name:RESOURCE_NAME"      },      "consumer": {        // Specify one of the following:        "operation_resource_name":RESOURCE_NAME        // OR        "external_api_resource_name:RESOURCE_NAME"      }  }'

Replace the following:

Example:

  curl -X POST 'https://apihub.googleapis.com/v1/projects/myproject/locations/us-central1/dependencies?dependency_id=user-to-pet' \  -H "Authorization: Bearer $(gcloud auth print-access-token)" \  -H 'Content-Type: application/json' \  --d '{      "description": "Dependency from user to pet API",      "consumer": {          "operation_resource_name": "projects/myproject/locations/us-central1/apis/payments-api/versions/paymentv1/operations/createuser"      },      "supplier": {          "operation_resource_name": "projects/myproject/locations/us-central1/apis/pet-api/versions/petstorev1/operations/addpet"      }  }'

Sample response:

{  "name": "projects/myproject/locations/us-central1/dependencies/user-to-pet",  "consumer": {      "displayName": "POST - /v2/user",      "operationResourceName": "projects/myproject/locations/us-central1/apis/payments-api/versions/version1/operations/createuser"  },  "supplier": {      "displayName": "POST - /v2/pet",      "operationResourceName": "projects/myproject/locations/us-central1/apis/payments-api/versions/version1/operations/addpet"  },  "state": "VALIDATED",  "description": "Dependency from user to pet API",  "discoveryMode": "MANUAL",  "createTime": "2024-04-17T19:33:31.664226Z",  "updateTime": "2024-04-17T19:33:31.664226Z" }

What's next?

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 2025-12-15 UTC.