Delete the Account (owner only)
/portal/v1/accounts/{accountSlug}Owner-only soft-delete of the Account. Marks the row deleted_at with a purge_after deadline (default 30-day grace), revokes every member's session so access stops immediately, and emits the account.deleted event that cancels billing on the hosted instance. The row is recoverable during the grace window before a daily cron hard-purges it. Returns 204 on success and 403 (account.delete_owner_only) when the caller is a member but not the owner. Writes an account.deleted audit row.
Authentication
AuthorizationJWT access token. Never send alongside X-API-Key: a request carrying both is refused.
account.deleteDanger zoneDelete the account. Granted through an administrator role in the Admin Workspace; a valid token without it is refused with 403.
Path Parameters
accountSlugstring Required Responses
Account soft-deleted: access stops immediately, paid billing is cancelled, and the account is scheduled for permanent purge after a grace window. Owner-only.
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Errors
When the request can't be completed, the response body includes a stable error code you can branch on.
account.capability_requiredForbiddenThe signed-in user's administrator roles do not grant the capability this endpoint requires.
Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.
curl -X DELETE "https://auth.canopy-io.com/portal/v1/accounts/value" \ -H "Authorization: Bearer $CANOPY_TOKEN"
HTTP/1.1 204 Account soft-deleted: access stops immediately, paid billing is cancelled, and the account is scheduled for permanent purge after a grace window. Owner-only. (empty body)
Tell us how we can improve this guide.