Skip to content

Delete somebody’s account

POST
/staff/people/{id}/delete
curl --request POST \
--url https://api.sloose.com/staff/people/c1d2e3f4/delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "reason": "example" }'

Backoffice route: a staff session, or ADMIN_TOKEN. What POST /auth/account/delete does for the person themselves, for somebody who asked by email: every session, sign-in, factor and membership they hold goes, their own connections are revoked (asked of each one’s provider, and what it would not revoke, or ends only by hand, is named in warnings and listed in unrevoked), and what they did for an organisation stays as the organisation’s record under “a deleted person”. The address is freed and is sent one message saying it is done. A banned person can be deleted — that is the one thing they cannot do for themselves — and the ban goes with the account, since the address is freed and nothing is left for it to stop; a staff member cannot: take the role away first. Once deleted, the person is not found by any tool here. Refused while they are the only owner of an open organisation. Written down as user.delete, with the reason. The one route the restore switch lets through (#1854): while it is on, the ADMIN_TOKEN alone may call this, so a restore can delete again a person deleted since the restored minute; a staff session is refused 503 MAINTENANCE like everyone.

id
required

The person

string
Example
c1d2e3f4

The person

Media typeapplication/json
object
reason
required

Why — the request that asked for it, usually. Required; it goes on the record.

string
>= 1 characters <= 500 characters
Examplegenerated
{
"reason": "example"
}

Deleted.

Media typeapplication/json
object
sessionsEnded
required

Browsers signed out, as sessions/revoke counts them: a CRM tab’s own session is its browser’s.

integer
warnings
required

What a provider would not do — a grant it would not revoke, or can only end by hand — each in a sentence. The account is deleted regardless.

Array<string>
unrevoked
required

The same grants as a list: each one’s provider and where the person removes Sloose to end it.

Array<object>

A grant its provider may still hold — it would not take it back, or ends it only by hand — with where a person ends it.

object
provider
required

Who issued the grant.

string
removedAt
required

Where a person removes Sloose to end it, completing “remove Sloose under …”.

string
byHand
required

The provider has no way for Sloose to revoke one grant: removing Sloose there is the only way it ends. False when the provider would not take it back this time.

boolean
mailed
required

The message saying it is done was accepted for delivery. False when it was not — the account is deleted regardless, and nothing can send it again.

boolean
Example
{
"unrevoked": [
{
"provider": "Zoho",
"removedAt": "Connected Apps in your Zoho account"
}
]
}

The request — its body or its query — 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_DELETED), or the only owner of an open organisation (code: SOLE_OWNER, naming each in orgs).

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"
}

The restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed value: MAINTENANCE
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com