Skip to content

Subscriptions service

/subscriptions assigns plans (and their quotas) to accounts. Plans gate how many devices, how much object storage and bandwidth an account may use; the current consumption against those quotas is what the dash service reports and the Hub dashboard displays.

Alpha API

This is alpha API and code — don't build third-party software on it unless you are willing to rewrite it soon and often.

Plans

prn::subscriptions:FREE
prn::subscriptions:VIP
prn::subscriptions:CUSTOM

CUSTOM takes explicit quota attributes; the others carry defaults.

Assign a plan (admin)

Subscription admins are the accounts listed in PANTAHUB_ADMINS (default: the admin demo account) plus any in PANTAHUB_SUBSCRIPTION_ADMINS. Logged in as one of those:

sh
curl -s -X PUT https://api.pantahub.com/subscriptions/admin/subscription \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H 'Content-Type: application/json' \
  -d '{
    "subject": "prn:::accounts:/<account-id>",
    "plan": "prn::subscriptions:VIP"
  }'

Override quota attributes with a CUSTOM plan:

sh
curl -s -X PUT https://api.pantahub.com/subscriptions/admin/subscription \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H 'Content-Type: application/json' \
  -d '{
    "subject": "prn:::accounts:/<account-id>",
    "plan": "prn::subscriptions:CUSTOM",
    "attrs": {"BANDWIDTH": "10GiB", "OBJECTS": "60GiB", "DEVICES": "200"}
  }'

Changes are visible to the affected user immediately in the UI and on the dash endpoint.

See your subscription (user)

sh
curl -s https://api.pantahub.com/subscriptions/ \
  -H "Authorization: Bearer $TOKEN"

The response includes the active plan, its quota attributes, and the subscription's change history.

Endpoint reference

EndpointReference
GET /subscriptionsYour subscription

(The admin PUT /subscriptions/admin/subscription endpoint is not part of the published OpenAPI spec.)