Swarmz

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.

POSThttps://api.swarmz.net/functions/v1/platform-suspend

Reversibly 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

StatuserrorreasonWhen
400missing_fieldstenant_id or external_ref requiredNeither identifier supplied
401unauthorizedSee Authentication
404tenant_not_foundNo tenant matched the identifier under your account
405method_not_allowedAnything other than POST
410terminatedThe tenant has been terminated
429rate_limitedper_key / per_ipRate limit hit — see Rate limits
500suspend_failedRPC messageSuspend 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

Suspend is reversible

Suspend captures the tenant's prior state so unsuspend can republish projects, rebind domains, and resume cloud. For a permanent, irreversible removal, use terminate instead.

This endpoint is limited to 60 requests/min per key and 120/min per IP. See Rate limits.

On this page