Suspend user
POST
https://app.speybooks.com/api/v1/admin/users/{id}/suspendSuspend or permanently ban a user account.
The account is made inactive and the reason and time are recorded against it. Any active sessions are ended immediately, so the user is logged out at once. A suspension can be reversed; a ban is the permanent form of the same action.
Two protections apply: an admin cannot suspend their own account, and admin accounts cannot be suspended through this endpoint.
Request Body
reason: minimum 5 characters, requiredpermanent: boolean (default false). True records a ban, false a reversible suspension
Records a USER_SUSPENDED or USER_BANNED action in the
audit log.
Error responses:
400 { code: "SELF_SUSPEND" }: cannot suspend yourself400 { code: "CANNOT_SUSPEND_ADMIN" }: admin users are protected404 { code: "NOT_FOUND" }: user not found
Path parameters
idstringrequiredUser ID.
Body parameters
reasonstringrequiredSuspension reason (audit trail). Min 5 characters.
permanentbooleanoptionalTrue for permanent ban, false for temporary suspension. Default false.
Response
200User suspended (or banned if permanent). All sessions invalidated.
Show response fields
messagestringError codes
400Cannot suspend yourself or admin users.
404User not found.