Suspend a tenant
Reversibly pause a tenant — flip it to suspended, take its public site offline, and tear down running infrastructure. The prior state is captured for unsuspend to replay.
https://api.swarmz.net/functions/v1/platform-suspendReversibly suspends a tenant. The status is flipped to suspended first, so any in-flight generation or publish refuses immediately. Then the teardown runs: projects are unpublished (the public site goes offline), custom domains are disconnected, preview pods are slept, and managed cloud is paused. The prior state is captured so unsuspend can replay it.
Address the tenant by tenant_id or external_ref — supply exactly one.
Parameters
Prop
Type
Request
curl -X POST https://api.swarmz.net/functions/v1/platform-suspend \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "external_ref": "whmcs:1234" }'const res = await fetch('https://api.swarmz.net/functions/v1/platform-suspend', {
method: 'POST',
headers: {
Authorization: 'Bearer sk_live_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({ external_ref: 'whmcs:1234' }),
});
const data = await res.json();import requests
res = requests.post(
"https://api.swarmz.net/functions/v1/platform-suspend",
headers={"Authorization": "Bearer sk_live_..."},
json={"external_ref": "whmcs:1234"},
)
data = res.json()Response
A fresh suspend returns the teardown report:
{
"ok": true,
"status": "suspended",
"report": {
"pausedPods": [],
"unpublishedProjects": [],
"disconnectedDomains": [],
"pausedCloud": [],
"errors": []
}
}If the tenant is already suspended, the call short-circuits:
{ "ok": true, "status": "suspended", "already": true }report.errors[] is populated if a teardown step fails, but the status flip is authoritative: the tenant is suspended and the call still returns 200. Inspect errors[] for steps to retry out of band.
Errors
| Status | error | reason | When |
|---|---|---|---|
| 400 | missing_fields | tenant_id or external_ref required | Neither identifier supplied |
| 401 | unauthorized | — | See Authentication |
| 404 | tenant_not_found | — | No tenant matched the identifier under your account |
| 405 | method_not_allowed | — | Anything other than POST |
| 410 | terminated | — | The tenant has been terminated |
| 429 | rate_limited | per_key / per_ip | Rate limit hit — see Rate limits |
| 500 | suspend_failed | RPC message | Suspend failed server-side; safe to retry |
Idempotency
Suspend is idempotent by state. An already-suspended tenant returns already: true and is not torn down twice. See Idempotency.
Notes
This endpoint is limited to 60 requests/min per key and 120/min per IP. See Rate limits.