Skip to content

Ban somebody

POST
/staff/people/{id}/ban
curl --request POST \
--url https://api.sloose.com/staff/people/c1d2e3f4/ban \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "reason": "example", "expiresAt": "2026-04-15T12:00:00Z" }'

Backoffice route: a staff session, or ADMIN_TOKEN. A ban is on the person, not on a membership: every session they hold in every org answers 403 BANNED at once, and so does a new sign-in. Their existing sessions are ended too, so nothing keeps working until it expires. Staff cannot be banned — take the role away first, which is a deliberate second step. Written down as user.ban.

id
required

The person

string
Example
c1d2e3f4

The person

Media typeapplication/json
object
reason
required

Why. Required, and shown to nobody but staff.

string
>= 1 characters <= 500 characters
expiresAt

ISO timestamp the ban lifts itself. Omitted means it does not.

string format: date-time
Examplegenerated
{
"reason": "example",
"expiresAt": "2026-04-15T12:00:00Z"
}

Banned, and signed out.

Media typeapplication/json
object
banned
required
boolean
sessionsRevoked
required
integer
Example
{
"banned": true
}

The request body did not match the schema. issues carries the Zod issue list.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No such person, or it is not visible to this session.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

That person is staff (code: STAFF_CANNOT_BE_BANNED).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}