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 Admin API.
List Subscriptions
Retrieve all subscriptions for a specific API product:
curl "https://{ADMIN_API_URL}/api/portals/{portal_id}/api_products/{product_id}/subscriptions" \
-H "Authorization: Bearer $API_TOKEN"
Filter by status or developer:
# List only active subscriptions
curl "https://{ADMIN_API_URL}/api/subscriptions?api_product_id={product_id}&status=subscribed" \
-H "Authorization: Bearer $API_TOKEN"
# List subscriptions for a specific developer
curl "https://{ADMIN_API_URL}/api/subscriptions?developer_id={developer_id}" \
-H "Authorization: Bearer $API_TOKEN"
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 "https://{ADMIN_API_URL}/api/approvals?event=api_product_subscription&status=pending" \
-H "Authorization: Bearer $API_TOKEN"
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 -X POST "https://{ADMIN_API_URL}/api/approvals/{approval_id}/accept" \
-H "Authorization: Bearer $API_TOKEN"
On approval:
- The subscription status changes from
wait_for_approvaltosubscribed. - The developer is notified by email (if configured).
- Webhook notifications are sent (if configured on the API product).
Reject a Subscription
curl -X POST "https://{ADMIN_API_URL}/api/approvals/{approval_id}/reject" \
-H "Authorization: Bearer $API_TOKEN"
On rejection:
- The subscription record is deleted.
- The developer is notified by email (if configured).
- Webhook notifications are sent (if configured on the API product).
Cancel a Subscription
Administrators can cancel an active subscription:
curl -X DELETE "https://{ADMIN_API_URL}/api/portals/{portal_id}/api_products/{product_id}/subscriptions/{subscription_id}" \
-H "Authorization: Bearer $API_TOKEN"
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
| Event | Developer Receives | Admins Receive | Contact 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:
| Variable | Description |
|---|---|
ApplicantID | The developer ID of the requester. |
ApplicantName | The developer's display name. |
AppliedAt | Timestamp of the subscription request. |
ApprovalID | The approval record ID. |
ResourceID | The API product ID. |
ResourceName | The API product name. |
Event | The event type. |
Webhook delivery uses exponential backoff retry (up to 5 retries, starting at 1 second, capped at 64 seconds).