Skip to main content
Version: 3.9.x

Manage Subscriptions

Subscriptions grant developer applications access to consume APIs through API products. This guide covers how to manage subscriptions from the Provider Portal using the Provider Portal Admin API.

Prerequisites

Create a token by following Obtain a Token from the Dashboard and export it:

export API_KEY="a7ee-xxxxxxxxxxxxx"

List Subscriptions

Retrieve all subscriptions for a specific API product:

curl -k "https://localhost:7443/api/api_products/{product_id}/subscriptions?portal_id={portal_id}" \
-H "X-API-KEY: ${API_KEY}"

If you are not running locally, replace localhost with your Dashboard host. The -k flag is required if the Dashboard uses a self-signed TLS certificate.

Approve Subscription Requests

When an API product has subscription_auto_approval disabled, subscription requests create approval records that administrators must review.

List Pending Approvals

curl -k "https://localhost:7443/api/approvals?event=api_product_subscription&status=pending" \
-H "X-API-KEY: ${API_KEY}"

Response:

{
"list": [
{
"id": "approval-uuid",
"event": "api_product_subscription",
"status": "pending",
"resource_type": "api_product",
"resource_name": "Payments API",
"applicant_name": "Jane Smith",
"applied_at": "2025-01-15T10:30:00Z",
"portal_name": "Main Portal"
}
],
"total": 1
}

Approve a Subscription

curl -k -X POST "https://localhost:7443/api/approvals/{approval_id}/accept" \
-H "X-API-KEY: ${API_KEY}"

On approval:

  1. The subscription status changes from wait_for_approval to subscribed.
  2. The developer is notified by email (if configured).
  3. Webhook notifications are sent (if configured on the API product).

Reject a Subscription

curl -k -X POST "https://localhost:7443/api/approvals/{approval_id}/reject" \
-H "X-API-KEY: ${API_KEY}"

On rejection:

  1. The subscription record is deleted.
  2. The developer is notified by email (if configured).
  3. Webhook notifications are sent (if configured on the API product).

Cancel a Subscription

Administrators can cancel an active subscription:

curl -k -X DELETE "https://localhost:7443/api/api_products/{product_id}/subscriptions/{subscription_id}?portal_id={portal_id}" \
-H "X-API-KEY: ${API_KEY}"

Cancelling a subscription deletes the subscription record and cancels any pending approval associated with it.

Notification Configuration

Subscription events can trigger email and webhook notifications. Notifications are configured on the API product. See Manage API Products for setup details.

Notification Flow

EventDeveloper ReceivesAdmins ReceiveContact Points Notified
Subscription requested"Request is Under Review""Awaiting Your Approval"subscription_approval_created
Subscription approved"Request Has Been Approved""Request Approved"subscription_approval_accepted
Subscription rejected"Request Denied""Request Denied"subscription_approval_rejected
Subscription cancelled--subscription_approval_cancelled

Administrator notifications are sent only to users with the subscription approval permission and a verified email address.

Webhook Notifications

Webhook contact points send HTTP requests to configured endpoints. The request body can use template variables:

VariableDescription
ApplicantIDThe developer ID of the requester.
ApplicantNameThe developer's display name.
AppliedAtTimestamp of the subscription request.
ApprovalIDThe approval record ID.
ResourceIDThe API product ID.
ResourceNameThe API product name.
EventThe event type.

Webhook delivery uses exponential backoff retry (up to 5 retries, starting at 1 second, capped at 64 seconds).

Additional Resources