Skip to main content

Version: latest

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:

  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 -X POST "https://{ADMIN_API_URL}/api/approvals/{approval_id}/reject" \
-H "Authorization: Bearer $API_TOKEN"

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 -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

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

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation