API reference · Settings
Delete account
delete
/settings/account| Authentication | Customer token (Bearer) |
|---|---|
| Access | Free user · Pro user Customer token (Bearer) — free and paid users |
| Rate limit | 10/1min |
Destructive. After re-typing the email, the brand name or — for phone-only accounts — the mobile number, the account is
closed at once: all tokens are revoked, the email and phone are freed for a new sign-up, the free-queue entry is removed,
scheduled runs stop and a Stripe subscription is cancelled. After RAWI_DELETION_RETENTION_DAYS (default 30) the daily
rawi:purge-deleted deletes the brand and everything under it (questions, runs, answers, reports, suggestions),
consultation requests, email/SMS logs and sign-in codes, and clears the personal fields. Payment rows are kept,
anonymised (no card hash), as accounting law requires.
Parameters
| Name | In | Type |
|---|---|---|
confirm_email | query | string,null |
confirm_brand | query | string,null |
reauth_token | query | string |
Request body
Examplejson
{
"confirm_email": "{{userEmail}}",
"reauth_token": "{{reauthToken}}"
}
Responses
200
| Field | Type |
|---|---|
deleted* | boolean |
purge_at* | string |
retention_days* | integer |
json
{
"deleted": true,
"purge_at": "2026-12-26T10:00:00Z",
"retention_days": 30
}
401 — Missing/invalid token, or a token of the wrong owner (admin token on a user route or vice versa): {"message":"…","code":"unauthenticated"} (message in the request language)
| Field | Type |
|---|---|
message* | string |
code | string |
json
{
"message": "Please sign in to continue; your session has ended or is not valid.",
"code": "unauthenticated"
}
422 — Validation failed (confirm_email does not match)
| Field | Type |
|---|---|
message* | string |
errors* | object |
json
{
"message": "",
"errors": {
"email": [
"ایمیل معتبر نیست."
]
}
}
429 — Rate limit or login-code resend cooldown. Headers: Retry-After, X-RateLimit-*.
| Field | Type | Description |
|---|---|---|
message* | string | |
resend_in | integer | Seconds until a new login code may be requested (login-code cooldown only). |
json
{
"message": "Too Many Attempts.",
"resend_in": 0
}
curl example
bash
curl -X DELETE 'http://127.0.0.1:8010/api/settings/account' \
-H 'Accept: application/json' \
-H "Authorization: Bearer $RAWI_USER_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"confirm_email": "{{userEmail}}",
"reauth_token": "{{reauthToken}}"
}'