Skip to main content

Stopping a suspended or removed Installer

This page covers what happens when a Business suspends or removes one of its Installers, or when the platform blocks or deletes an account. It explains how the backend stops that person and what the app must do with the error codes it gets back: switch org, or sign the user out.

Where the status is stored​

WhatStored inNotes
Membership of a Business (ACTIVE, SUSPENDED, removed)HTTP server (cse-http-be)One membership per user per org. The TCP server keeps no copy of users or memberships.
Business status (ACTIVE, SUSPENDED, CLOSED)HTTP server; the TCP server keeps a read-only copyThe copy is used for display names and scoping, not to sign anyone in or out.
Account blocked by Crown, or account deletedHTTP server and CognitoThis is the only case Cognito knows about: it refuses new sign-ins.

Cognito does not record that an Installer was suspended by a Business, and the sign-in itself never checks memberships. The membership is checked on every request instead.

An account belongs to at most one Business (plus its own personal org and any plants shared with it). A suspended Installer cannot escape by joining or creating another Business: the HTTP server refuses that with 409 CONFLICT, details.reason: ALREADY_IN_BUSINESS, for as long as the suspended membership exists. It is allowed again only after the Installer is removed (detached) from the first Business, or that Business is closed.

How the backend stops them​

  1. HTTP API, on every request. The HTTP server loads the caller's memberships and checks the org selected by X-Org-Id. A suspended, removed or blocked caller is refused with one of the codes in the table below. This includes the realtime-ticket request, so they cannot get a new WebSocket ticket.
  2. WebSocket, within seconds. The HTTP server publishes an access revocation, and every WebSocket gateway acts on it:
    • Suspending a user, blocking an account, or suspending or closing a Business closes that user's connections with close code 4401. Commands and register writes stop with it.
    • Reassigning an Installer away from some plants ends only their live views of those plants. Watches end with NOT_AUTHORIZED, and the connection stays open.
  3. The old ticket is refused. After a revocation, the gateway refuses every ticket issued before it, on a new connection or a refresh, with auth_result code TICKET_EXPIRED. This holds even if the ticket has not run out yet. The app must ask the HTTP server for a new ticket, and the HTTP server refuses one while access is withdrawn.
  4. Expiry is the backstop. A gateway that missed the revocation (it restarted, or the message was lost) still drops the access when the ticket expires. Tickets are issued for 10 minutes.

See Authentication for the ticket flow itself.

What the app should do: switch org or sign out​

A WebSocket close with 4401, or TICKET_EXPIRED, does not tell you why on its own, because a normal ticket expiry looks the same. Always request a new ticket from the HTTP server, and decide from its answer:

HTTP responseMeaningApp action
401 with code: SESSION_REVOKEDSessions were ended (signed out everywhere, or the org's sessions ended)Sign out. Clear the tokens and go to the login screen.
403 with code: ACCOUNT_BLOCKEDCrown blocked the whole accountSign out and show "This account is blocked. Contact Crown support".
Any other 401, or a Cognito token refresh failing with NotAuthorizedException / UserNotFoundExceptionToken no longer valid, account disabled or deletedSign out.
403 with code: ACCOUNT_SUSPENDEDThis user's membership in the selected org is suspendedSign out, always. Clear the tokens and go to the login screen, even if the user has other active orgs.
403 FORBIDDEN with details.reason: NOT_A_MEMBERRemoved from the selected org (or never a member)Remove that org from the org picker. If the user has another active org, switch to it. If it was their only org, sign out.
403 FORBIDDEN with details.reason: BUSINESS_SUSPENDED or BUSINESS_CLOSEDThe Business itself is suspended or closedSame as NOT_A_MEMBER.
200 with a new ticketAccess still validSend auth with the new ticket and carry on.

Rules of thumb:

  • SESSION_REVOKED, ACCOUNT_BLOCKED, ACCOUNT_SUSPENDED and any other 401 always mean sign out. A suspended Installer is signed out strictly (owner decision 2026-11-25). After signing in again they can still use their personal org, but not the Business that suspended them.
  • NOT_A_MEMBER, BUSINESS_SUSPENDED and BUSINESS_CLOSED mean leave that org. Sign out only when no active org is left.
  • Do not reconnect the WebSocket in a loop after a 4401. Reconnect only after the HTTP server has issued a new ticket.
  • Apply the same table to every HTTP API call, not only to the ticket request. Any call can be the first one to hit the new status.

Joining another Business while suspended​

A suspended Installer cannot join or create another Business with the same account or email. An account belongs to at most one Business at a time (plus its own personal org), and a suspended membership still counts.

The HTTP server checks this on every way into a Business:

  • sending a join request with a join code
  • a Business accepting that join request
  • accepting an invitation
  • creating their own Business (self-serve onboarding)

Each one is refused with:

HTTP responseMeaningApp action
409 CONFLICT with details.reason: ALREADY_IN_BUSINESS and details.orgIdThe account already belongs to a Business (orgId), active or suspendedShow "You already belong to a business". Do not retry.

Joining another Business becomes possible again only when one of these happens:

EventResult
The first Business removes (detaches) the InstallerThe membership becomes REMOVED and no longer counts. They may join or create another Business.
The first Business is closedA closed Business no longer counts. Its members may join or create another one.
The first Business restores the InstallerThey are active there again, but still cannot join a second Business.

A suspended Business (as opposed to a suspended member) still counts too. Its Installers cannot move to another Business until it is closed or they are removed from it.

Getting access back​

When the Business restores the Installer, or accepts a new join request, the HTTP server issues tickets again. A newly issued ticket is accepted by the gateway, because it was issued after the revocation. The user may need to sign in again if they were signed out.