Deactivate organisation

POSThttps://app.speybooks.com/api/v1/admin/orgs/{id}/deactivate

Deactivate an organisation. A reversible soft delete: it sets deactivated_at and locks the organisation out at the request chokepoint, on both the API key path and the session path. All data is retained and the action is independent of billing state.

Deactivation is the within-window alternative to erasure. Hard deletion is disabled (see deleteOrg); to take an organisation offline while keeping its records, deactivate it here and reactivate later.

Idempotent: deactivating an already-deactivated organisation is a no-op that preserves the original timestamp, reason, and actor, and writes no second audit record.

Request Body

  • reason: one of customer_request, non_payment, admin_action, migration_abandoned. Required, recorded in both the audit trail and the deactivated_reason column.
  • note: optional free-text for the audit trail, minimum 5 characters.

Records an ORGANISATION_DEACTIVATED action in the audit log. A repeat on an already-deactivated organisation returns alreadyDeactivated: true and writes no audit record.

Error responses:

  • 404 NOT_FOUND: no organisation with that id.
  • 400: reason missing or outside the allowed set.

Path parameters

idstringrequired
Organisation ID.

Body parameters

reasonstringrequired
Reason for deactivation (audit trail and deactivated_reason column).
customer_requestnon_paymentadmin_actionmigration_abandoned
notestringoptional
Optional free-text note (audit trail only). Min 5 characters.
min length: 5

Response

200Organisation deactivated, or already deactivated (idempotent).
Show response fields
deactivatedAtstringdate-time
messagestring

Error codes

404Organisation not found.