Subscriptions

Create or update API Subscriptions from Subscription Spec

Changed on

Create/update API Subscription from Subscription Spec

put/organizations/{orgId}/environments/{envId}/apis/{apiHrid}/subscriptions

Request

  • Base URL
    https://eu.cloudgate.gravitee.io/apim/automation
  • URL
    https://eu.cloudgate.gravitee.io/apim/automation/organizations/{orgId}/environments/{envId}/apis/{apiHrid}/subscriptions
  • Auth
    • HTTP bearer
    • or HTTP basic
    • or HTTP bearer

Path parameters

orgIdstring required
Example:dedd0e0f-b3e9-4d2f-89cd-b2a9de7cb145

organization ID

envIdstring required
Example:a44e0d1b-9fa9-4d64-8b76-3634623a2e27

environment ID

apiHridstring required
Example:my_demo_api

Human-readable ID of api

Query parameters

hridContainsUUIDboolean

When true, the HRID path or spec value is treated as an existing UUID rather than a human-readable identifier. This is to support backward compatibility for resources created before migration to the automation API and should not be used for new resources.

hridContainsApiUUIDboolean

When true, the apiHrid path value (and, on create or update, the spec's planHrid) is treated as an existing UUID rather than a human-readable identifier. This is to support backward compatibility for resources created before migration to the automation API and should not be used for new resources.

hridContainsAppUUIDboolean

When true, the spec's applicationHrid is treated as an existing UUID rather than a human-readable identifier. This is to support backward compatibility for resources created before migration to the automation API and should not be used for new resources.

Request body

hridstring required

A unique human readable id identifying this resource

applicationHridstring required

Application's hrid selected to subscribe an API.

planHridstring required

API plan's hrid

endingAtstring date-time
metadataobject

Key-value metadata for this subscription.

Example request

{
  "hrid": "demo_api",
  "applicationHrid": "demo-app",
  "planHrid": "demo-plan",
  "endingAt": "2040-12-25T09:12:28Z",
  "metadata": {
    "key1": "value1",
    "key2": "value2"
  },
  "apiKeys": [
    {
      "key": "my-custom-api-key",
      "expireAt": "2040-12-25T09:12:28Z"
    }
  ],
  "consumerConfiguration": {
    "entrypointId": "webhook",
    "channel": "/channel1"
  }
}

Response

State of the successfully created Subscription

hridstring required

A unique human readable id identifying this resource

applicationHridstring required

Application's hrid selected to subscribe an API.

planHridstring required

API plan's hrid

endingAtstring date-time
metadataobject

Key-value metadata for this subscription.

idstring

Resource UUID.

environmentIdstring

The environment ID.

organizationIdstring

The organization ID.

apiHridstring

The API's Hrid.

startingAtstring date-time

Start validity date time of this Subscription

Example response

{
  "hrid": "demo_api",
  "applicationHrid": "demo-app",
  "planHrid": "demo-plan",
  "endingAt": "2040-12-25T09:12:28Z",
  "metadata": {
    "key1": "value1",
    "key2": "value2"
  },
  "apiKeys": [
    {
      "key": "my-custom-api-key",
      "expireAt": "2040-12-25T09:12:28Z"
    }
  ],
  "consumerConfiguration": {
    "entrypointId": "webhook",
    "channel": "/channel1"
  },
  "apiHrid": "demo-api",
  "startingAt": "2040-12-25T09:12:28+01:00"
}

Changes

    • warning

      changed the pattern of the request property from ^[a-zA-Z0-9][a-zA-Z0-9_-]+[a-zA-Z0-9]$ to ^[a-zA-Z0-9][a-zA-Z0-9_.-]+[a-zA-Z0-9]$

    • info

      added the non-success response with the status

    • info

      the //// response's property pattern was changed from ^[a-zA-Z0-9][a-zA-Z0-9_-]+[a-zA-Z0-9]$ to ^[a-zA-Z0-9][a-zA-Z0-9_.-]+[a-zA-Z0-9]$ for the status

    • info

      added the new optional query request parameter hridContainsApiUUID

    • info

      added the new optional query request parameter hridContainsAppUUID

    • info

      added the new optional query request parameter hridContainsUUID