Archive a sub-account
DESTRUCTIVE. Archive a sub-account and its direct child sub-accounts (sets archived_at, is_active = false), then release and delete their platform phone numbers and stop knowledge-base rebilling — the same flow as the agency Sub-Accounts page.
https://api.centerfy.ai/webhooks/inbound/agency/sub-accounts/:id/archive Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your agency API key (cfy_…) | Agency (organization-wide) API key, created in the agency workspace under Settings → API Keys (“Agency API Keys”; the tab only appears on White Label or SaaS Mode plans). Or send Authorization: Bearer <key>; x-api-key wins if both are present. Keys must start with cfy_. A sub-account key is rejected with 401. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | The sub-account id. Must belong to the key’s agency and not be deleted. |
Example
curl -X POST "https://api.centerfy.ai/webhooks/inbound/agency/sub-accounts/{id}/archive" \
-H "x-api-key: $CENTERFY_AGENCY_API_KEY" import { CenterfyAgencyClient } from "@centerfy/sdk";
const agency = new CenterfyAgencyClient({ apiKey: process.env.CENTERFY_AGENCY_API_KEY! });
const result = await agency.subAccounts.archive("<subAccountId>");
console.log(result); centerfy --agency subAccounts archive <subAccountId> MCP tool: centerfy_agency_sub_accounts_archive (see MCP server)
Response
{
"status": "success",
"archived": true,
"sub_account_ids": [
"5a1f3c2e-8b4d-4e6f-9a7b-1c2d3e4f5a01",
"6b2a4d3f-9c5e-4f70-8b1c-2d3e4f5a6b02"
],
"phone_numbers": {
"platform_numbers": 2,
"released": 2,
"release_failed": []
},
"knowledge_base_billing_stopped": true
}Errors
409— if the sub-account is already archived.404— when the sub-account id is not a uuid, does not exist, is deleted, or belongs to another agency.401— when the key is missing, not cfy_-prefixed or unknown (including sub-account keys); 403 when the agency is not on a White Label or SaaS Mode plan; 429 above 50 requests per minute per agency (Retry-After header set); 500 ‘database error’ on an internal failure.
Notes
Released phone numbers are gone for good — unarchiving does not bring them back. Archived accounts are no longer billed for numbers; any number whose release failed (listed in release_failed) stays on file and is released later by the renewal job without billing. If the release step could not run at all, phone_numbers is { error, details } instead and the archive still stands. Knowledge bases are disabled and their billing turned off. No request body.