Deactivated organisations return a clear lockout response
What changed
An organisation can now hold a deactivated state. While it is deactivated, every request for that organisation fails closed with one response, on both the API-key and session paths:
curl -s https://api.speybooks.com/v1/organisation \
-H "Authorization: Bearer $TOKEN"
{
"success": false,
"error": {
"code": "ORGANISATION_DEACTIVATED",
"message": "Organisation is deactivated"
}
}
The response is the same whether the request carries an API key or a session token. Deactivation is reversible: when the organisation is restored, access returns immediately and no data is lost.
Why it matters
If your organisation is deactivated, at your request or for a billing reason, your integration now receives one unambiguous signal it can act on. You can tell “this organisation is deactivated” apart from “these credentials are wrong” and show your own users the right message, rather than handling a misleading authentication failure. The check runs ahead of any billing or subscription logic, so the response does not depend on subscription state, and it fails closed: no organisation data is reachable while the organisation is deactivated.
Proof and impact
The lockout is enforced at the API request resolver, on both the API-key and session paths, ahead of the subscription check. The deactivated state and its enforcement are carried by migrations 117 and 118 and covered by the Mode 1 deactivation regression suite, which asserts that a deactivated organisation is locked out at the resolver and stays fully recoverable. Reactivation clears the state and restores access.
Breaking changes: none. The response appears only for an organisation that is deactivated. Active organisations are unaffected.
Known issues
A session that made a request within the preceding five minutes can continue to read for up to that window after deactivation, because the resolver serves a short-lived cached organisation resolution. API-key requests are not cached and lock out at once. The window is bounded and closes on its own.