List your plans
Enumerate the named plans defined for your platform account. Each plan carries a stable code you map to a WHMCS product and later pass to create or plan.
https://api.swarmz.net/functions/v1/platform-plansReturns the named plans defined for your platform account. Maps to the WHMCS Console's product-mapping screen: call it with your bearer key, then map each WHMCS product to a plan code. The code is the stable handle you store and later pass as plan_code to create and plan — never the internal UUID.
Read-only. The response exposes only host-relevant columns; internal ids, timestamps, and ordering fields are not returned.
Parameters
All parameters are optional.
Prop
Type
Request
curl -X POST https://api.swarmz.net/functions/v1/platform-plans \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "active_only": true }'const res = await fetch('https://api.swarmz.net/functions/v1/platform-plans', {
method: 'POST',
headers: {
Authorization: 'Bearer sk_live_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({ active_only: true }),
});
const { plans } = await res.json();import requests
res = requests.post(
"https://api.swarmz.net/functions/v1/platform-plans",
headers={"Authorization": "Bearer sk_live_..."},
json={"active_only": True},
)
plans = res.json()["plans"]Response
{
"ok": true,
"plans": [
{
"code": "pro",
"display_name": "Pro",
"monthly_credits": 500,
"free_credits_per_day": 10,
"monthly_credit_cap": null,
"rollover_months": 1,
"max_projects": 25,
"max_published_projects": 25,
"max_custom_domains": 5,
"custom_domains_enabled": true,
"max_compute_size": null,
"cloud_budget_cap": null,
"price_cents": 4900,
"currency": "usd"
}
]
}Field meanings:
| Field | Meaning |
|---|---|
code | The stable API handle for the plan. Pass it as plan_code to create / plan. |
display_name | The customer-facing plan name. |
monthly_credits | The monthly credit grant the plan assigns. See Credits. |
free_credits_per_day | The plan's daily free-credit allowance. |
monthly_credit_cap | Hard monthly credit ceiling (null = unlimited). |
rollover_months | How long unused monthly credits roll over (0/1/2). |
max_projects / max_published_projects / max_custom_domains | Plan caps (null = unlimited). |
custom_domains_enabled | Whether the plan allows custom domains. |
max_compute_size | Compute selector lock (null = unrestricted). |
cloud_budget_cap | Per-tenant cloud spend ceiling in USD (null = unlimited). |
price_cents / currency | Your display price for the plan. Informational — billing always meters to your platform account. |
Plans are ordered for display. A fresh account with no plans defined returns plans: [] — that is not an error.
Plans are yours to define
There is no Swarmz plan catalog. You define your plans (names, prices, and the caps each maps to) and register them with Swarmz; this endpoint reads them back. See Entitlements for the underlying caps and Credits for the credit model.
Errors
| Status | error | reason | When |
|---|---|---|---|
| 401 | unauthorized | — | See Authentication |
| 405 | method_not_allowed | — | Anything other than POST |
| 429 | rate_limited | per_key / per_ip | Rate limit hit — see Rate limits |
| 500 | plans_read_failed | DB message | A read failed server-side; safe to retry |
Idempotency
Not applicable — listing plans is a pure read. Safe to call as often as you like. See Idempotency.
Notes
This endpoint is limited to 60 requests/min per key. See Rate limits.