Skip to main content
DELETE
/
user
Delete a user account
curl --request DELETE \
  --url https://our-secret-api-url.com/user \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '
{
  "code": "123456"
}
'
{
  "result": true
}
To request OTP, keep the code empty.
To verify the OTP and proceed to deletion, pass the code in the body.

Delete User User Flow

1

OTP Request

The user requests OTP to delete account.
2

Report Suspension Checking

If the user has any of the following, this process will fail and no OTP will be generated:
  • A report marked with reviewing/suspended status;
  • The user isSuspended is true;
  • The user has a post with isSuspended is true.
3

OTP Creation

An OTP is sent to the user’s email or phone. If the user has both an email and a phone number, the OTP will be sent to the email.
4

OTP Verification

The OTP is verified, and the account with all linked data are deleted.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

X-API-KEY
string
required

API key required for authentication

Body

application/json

Optional OTP code for user account deletion.

code
string

OTP code for verifying the deletion request.

Example:

"123456"

Response

User account deleted successfully.

result
boolean

Indicates whether the deletion was successful.