Rawi

API reference · Settings

Delete account

delete/settings/account
AuthenticationCustomer token (Bearer)
AccessFree user · Pro user

Customer token (Bearer) — free and paid users

Rate limit10/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

NameInType
confirm_emailquerystring,null
confirm_brandquerystring,null
reauth_tokenquerystring

Request body

Examplejson
{
  "confirm_email": "{{userEmail}}",
  "reauth_token": "{{reauthToken}}"
}

Responses

200

FieldType
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)

FieldType
message*string
codestring
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)

FieldType
message*string
errors*object
json
{
  "message": "",
  "errors": {
    "email": [
      "ایمیل معتبر نیست."
    ]
  }
}

429 — Rate limit or login-code resend cooldown. Headers: Retry-After, X-RateLimit-*.

FieldTypeDescription
message*string
resend_inintegerSeconds 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}}"
}'

Try it in the console