Rawi

API reference · Settings

Remove phone

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

Customer token (Bearer) — free and paid users

Destructive. Removes the mobile. Not allowed for a phone-only account (it would have no way to sign in). Body: {"reauth_token":"…"} from POST /settings/reauth/verify (SEC-12).

Parameters

NameInType
reauth_tokenquerystring

Request body

Examplejson
{
  "reauth_token": "{{reauthToken}}"
}

Responses

200 — AccountSettings

FieldTypeDescription
email*string | nullEmail address.
phone*string | nullMobile number.
sms_notifications*boolean
email_notifications*object
email_notifications.reminders*boolean
email_notifications.report_ready*boolean
email_notifications.renewal*boolean
plan*string ("paid", "free")S5: reminders, report_ready, renewal
billing_period*string | null
plan_expires_at*string | null
payments*object[]
payments[].id*integerUnique ID.
payments[].period*string
payments[].status*stringCurrent status.
payments[].base_amount*integer
payments[].period_discount*integer
payments[].code_discount*integer
payments[].vat*integer
payments[].total*integer
payments[].currency*stringCurrency code, e.g. USD, EUR or IRT.
payments[].tracking_code*string | null
payments[].gateway_message*string | null
payments[].gateway_name*string | null
payments[].period_start*string | null
payments[].period_end*string | null
payments[].paid_at*string | null
payments[].created_at*string | nullWhen it was created (ISO 8601).
payments[].auto_renew*boolean
payments[].renewal_amount*integer | null«Renew automatically» (Stripe subscription)
payments[].amount_refunded*integerRefunds (status refunded / partially_refunded): total refunded so far and when the last one was made.
payments[].refunded_at*string | null
renewal*objectAutomatic renewal (Stripe subscription): renews_at / ends_at, cancel or resume (POST /billing/subscription).
renewal.auto*boolean
renewal.status*string | nullCurrent status.
renewal.can_cancel*booleanactive | past_due | cancel_at_period_end | none
renewal.can_resume*boolean
renewal.renews_at*string | null
renewal.ends_at*string | null
brand_names*any[]«Delete account» accepts any of these (or the email) as the typed confirmation.
json
{
  "email": "",
  "phone": "",
  "sms_notifications": false,
  "email_notifications": {
    "reminders": false,
    "report_ready": false,
    "renewal": false
  },
  "plan": "paid",
  "billing_period": "",
  "plan_expires_at": "",
  "payments": [
    {
      "id": 0,
      "period": "",
      "status": "",
      "base_amount": 0,
      "period_discount": 0,
      "code_discount": 0,
      "vat": 0,
      "total": 0,
      "currency": "",
      "tracking_code": "",
      "gateway_message": "",
      "gateway_name": "",
      "period_start": "",
      "period_end": "",
      "paid_at": "",
      "created_at": "",
      "auto_renew": false,
      "renewal_amount": 0,
      "amount_refunded": 0,
      "refunded_at": ""
    }
  ],
  "renewal": {
    "auto": false,
    "status": "",
    "can_cancel": false,
    "can_resume": false,
    "renews_at": "",
    "ends_at": ""
  },
  "brand_names": [
    null
  ]
}

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 (phone — the account has no email)

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

curl example

bash
curl -X DELETE 'http://127.0.0.1:8010/api/settings/phone' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer $RAWI_USER_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "reauth_token": "{{reauthToken}}"
}'

Try it in the console