API7 Docs

Patch an API product in Provider Portal

PATCH /api/api_products/{api_product_id}

PATCH /api/api_products/{api_product_id}

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

api_product_id*string

The unique identifier of the API product.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256

Query Parameters

portal_id?string

The unique identifier of the portal instance.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256
Default"default"

Request Body

application/json

JSON Patch payload as defined by RFC 6902. See JSON Patch for more information.

[index: integer]?|

Response Body

application/json

application/json

curl -X PATCH "$API_BASE_URL/api/api_products/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101" \  -H "Content-Type: application/json" \  -d '[    {      "op": "add",      "path": "/name",      "value": "new-name"    }  ]'

API product updated successfully.

{
  "value": {
    "type": "gateway",
    "name": "Weather Insights API",
    "logo": "string",
    "desc": "The Weather Insights API provides real-time and historical weather data for any location worldwide.",
    "labels": {
      "version": "v2",
      "env": "prod"
    },
    "auth": {
      "key-auth": {
        "header": "apikey",
        "hide_credentials": false,
        "query": "apikey"
      }
    },
    "status": "draft",
    "subscription_auto_approval": false,
    "can_view_unsubscribed": true,
    "visibility": "public",
    "linked_gateway_services": [
      {
        "gateway_group_id": "bc1b95c9-b348-4832-acc3-e257d2342df1",
        "gateway_group_name": "us-west-rsc",
        "service_id": "b32e678e-7f6b-4a50-b113-550621ed4c01",
        "name": "Weather Insights API",
        "version": "1.3.2",
        "status": 0,
        "hosts": [
          "weatherinsights.com"
        ],
        "updated_at": 1742288230,
        "openapi_title": "Weather Insights API - OpenAPI 3.0"
      }
    ],
    "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
    "portal_id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
    "created_at": 1742288232,
    "updated_at": 1742288235,
    "notifications": [
      {
        "type": "email",
        "email_subject": "API7 Enterprise alert.",
        "content": "This is a alert testing email.",
        "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
        "event": "subscription_approval_created",
        "contact_point_ids": [
          "6c97bc5f-3356-41f5-894c-c88df5389bd2"
        ]
      }
    ]
  }
}
Complete operation details and schema variants

PATCH /api/api_products/{api_product_id}

Patch an API product in Provider Portal

IAM Action: portal:UpdateAPIProduct, Resource: arn:api7:portal:portal/%s/apiproduct/%s

Parameters

  • api_product_id (path, string, required): The unique identifier of the API product.
  • portal_id (query, string, optional): The unique identifier of the portal instance.

Request body

Content type: application/json

  • oneOf variant 1: add/replace
  • [].op (string, required): The operation to be performed.
  • [].path (string, required): Path to the field to be replaced or added. Path should follow the JSON Pointer format.
  • [].value (object, required): Value to be added or replaced.
  • oneOf variant 2: remove
  • [].op (string, required): The operation to be performed.
  • [].path (string, required): Path to the field to be removed. Path should follow the JSON Pointer format.

Responses

  • 200: API product updated successfully.

  • allOf variant 1

  • value (object, optional): The specific resource.

  • allOf variant 2

  • value (object, optional):

  • allOf variant 1

  • oneOf variant 1: Gateway API Product

  • allOf variant 1

  • value.type (string, required):

  • value.name (string, required): The object name.

  • value.logo (string, optional): The base64-encoded logo image of the API product.

  • value.desc (string, optional): The description of the API product.

  • value.labels (object, optional): Key-value pairs of labels.

  • value.auth (object, optional): The authentication configuration of the API product.

  • value.auth.key-auth (object, optional): Key authentication configurations.

  • value.auth.key-auth.hide_credentials (boolean, optional): If true, do not pass the header or query string with key to upstream services.

  • value.auth.key-auth.query (string, optional): The query string to get the key from. Lower priority than header.

  • value.auth.key-auth.header (string, optional): The header to get the key from.

  • value.auth.basic-auth (object, optional): Basic authentication configurations.

  • value.auth.basic-auth.hide_credentials (boolean, optional): If true, do not pass the header or query string with key to upstream services.

  • value.auth.dcr (object, optional): DCR authentication configurations.

  • value.auth.dcr.dcr_provider_id (string, required): ID of the DCR provider.

  • value.linked_gateway_services (array, required): An array of gateway groups and services that the API product is linked to.

  • value.linked_gateway_services[].gateway_group_id (string, optional): The gateway group ID.

  • value.linked_gateway_services[].service_id (string, optional): The ID of the linked gateway service.

  • value.linked_gateway_services[].linked_hosts (array, optional): Select one or more hosts configured for the gateway service to be published to the API portal. If not set, it means using all hosts of the gateway service.

  • value.status (string, optional): Status of the API product.

  • value.subscription_auto_approval (boolean, optional): If true, the subscription is automatically approved.

  • value.can_view_unsubscribed (boolean, optional): If true, developers can view the unsubscribed API.

  • value.visibility (string, optional): The visibility of the API product in the API hub. public means the product is visible to all users and logged_in means the product is only visible to logged-in developers.

  • allOf variant 2

  • value.linked_gateway_services (array, optional): An array of gateway groups and services that the API product is linked to.

  • value.linked_gateway_services[].gateway_group_id (string, optional): The gateway group ID.

  • value.linked_gateway_services[].gateway_group_name (string, optional): The object name.

  • value.linked_gateway_services[].service_id (string, optional): The service ID.

  • value.linked_gateway_services[].name (string, optional): The service name.

  • value.linked_gateway_services[].version (string, optional): The version of the service.

  • value.linked_gateway_services[].status (integer, optional): The object status. 1 means the object is active while 0 means it's inactive.

  • value.linked_gateway_services[].hosts (array, optional):

  • value.linked_gateway_services[].updated_at (integer, optional): The object timestamp.

  • value.linked_gateway_services[].openapi_title (string, optional): The title of the OpenAPI file.

  • allOf variant 3

  • value.id (string, optional): The object ID.

  • value.portal_id (string, optional): The object ID.

  • value.created_at (integer, optional): The object created timestamp.

  • value.updated_at (integer, optional): The object updated timestamp.

  • oneOf variant 2: External API Product

  • allOf variant 1

  • allOf variant 1

  • value.type (string, required): Type of API product.

  • value.name (string, required): The object name.

  • value.raw_openapi (string, required): The content of the OpenAPI YAML file.

  • value.status (string, optional): Status of the API product.

  • value.visibility (string, optional): The visibility of the API product in the API hub. public means the product is visible to all users and logged_in means the product is only visible to logged-in developers.

  • allOf variant 2

  • anyOf variant 1

  • value.server_url (string, required): The server URL. It should be configured if the server URL is not defined in the OpenAPI spec.

  • anyOf variant 2

  • value.server_urls (array, required): The server URLs. It should be configured if the server URLs are not defined in the OpenAPI spec.

  • allOf variant 2

  • value.tags (array, optional):

  • value.desc (string, optional): Description.

  • value.api_desc (string, optional): API description.

  • value.api_count (number, optional): API count.

  • allOf variant 3

  • value.id (string, optional): The object ID.

  • value.portal_id (string, optional): The object ID.

  • value.created_at (integer, optional): The object created timestamp.

  • value.updated_at (integer, optional): The object updated timestamp.

  • allOf variant 2

  • value.notifications (array, optional): Notification details.

  • oneOf variant 1: Email

  • allOf variant 1

  • value.notifications[].type (string, optional): The type of the notification.

  • value.notifications[].email_subject (string, optional): Email subject.

  • value.notifications[].content (string, optional): Email content.

  • allOf variant 2

  • value.notifications[].id (string, optional): The object ID.

  • value.notifications[].event (string, optional): Notification trigger.

  • value.notifications[].contact_point_ids (array, optional): An array of contact point IDs.

  • oneOf variant 2: Webhook

  • allOf variant 1

  • value.notifications[].type (string, optional): The type of the notification.

  • value.notifications[].message (string, optional): Notification message.

  • allOf variant 2

  • value.notifications[].id (string, optional): The object ID.

  • value.notifications[].event (string, optional): Notification trigger.

  • value.notifications[].contact_point_ids (array, optional): An array of contact point IDs.

  • 400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.

  • value (object, optional): The specific resource.

  • error_msg (string, optional): The error message.

cURL

curl -X PATCH '$API_BASE_URL/api/api_products/{api_product_id}'