1. Docs
  2. API Reference
  3. Delete the Account (owner only)

Delete the Account (owner only)

DELETE/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

Bearer TokenAuthorization

JWT access token. Never send alongside X-API-Key: a request carrying both is refused.

Requires capability account.deleteDanger zone

Delete 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

  • errorApiErrorBodyDto*

application/json

  • errorApiErrorBodyDto*

Errors

When the request can't be completed, the response body includes a stable error code you can branch on.

403account.capability_requiredForbidden
When it happens

The signed-in user's administrator roles do not grant the capability this endpoint requires.

Remediation

Ask an account administrator to grant a role carrying the capability named in the Authentication section, then retry.

Request
curl -X DELETE "https://auth.canopy-io.com/portal/v1/accounts/value" \
  -H "Authorization: Bearer $CANOPY_TOKEN"
Response
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)
Related endpoints
GETGet the current Account
PATCHUpdate the Account name or settings
Was this page helpful?

Tell us how we can improve this guide.