Request Account Deletion
curl --request POST \
--url https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletionimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": true
}Auth Endpoints
Request Account Deletion
Email the authenticated user a one-time code to confirm self-service account deletion
POST
/
:projectId
/
api
/
v7
/
auth
/
request-account-deletion
Request Account Deletion
curl --request POST \
--url https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletionimport requests
url = "https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/api/v6/:projectId/api/v7/auth/request-account-deletion")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"success": true
}Starts the self-service account-deletion flow for the authenticated user. The server generates a one-time, 6-digit confirmation code, emails it to the user’s registered address, and stores it for 10 minutes. The user completes deletion by passing that code to the Confirm Account Deletion endpoint.
Requires a valid user access token. This step does not delete anything — it only sends the code.
This flow only works for accounts with an email on file. Accounts without one
(e.g. anonymous or foreign-id users) cannot self-serve deletion — delete them
server-side with a service key via the node SDK.
Body Parameters
This endpoint takes no body parameters.Response
boolean
true when the request is processed without a server error. The response is intentionally generic.Error Codes
| Code | Status | Description |
|---|---|---|
auth/no-email-on-file | 400 | The authenticated account has no email address, so a confirmation code cannot be delivered. Use a service key to delete it instead. |
Each call generates a fresh code and overwrites any pending one for that user.
The code expires after 10 minutes.

