Delete User
curl --request DELETE \
--url https://api.sublay.io/v7/:projectId/users/:userId \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/users/:userId"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/users/:userId', 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/v7/:projectId/users/:userId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/v7/:projectId/users/:userId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/v7/:projectId/users/:userId")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/users/:userId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyUser Endpoints
Delete User
Permanently delete a user and cascade cleanup across all of their related data
Delete User
curl --request DELETE \
--url https://api.sublay.io/v7/:projectId/users/:userId \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/users/:userId"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v7/:projectId/users/:userId', 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/v7/:projectId/users/:userId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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/v7/:projectId/users/:userId"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.sublay.io/v7/:projectId/users/:userId")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/users/:userId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyPermanently deletes the specified user and cascades cleanup across all of their related records. Reactions, files, follows, connections, notifications, collections and reports are removed. The user’s drafts are deleted, with everything attached to them (files, reactions, comments, collection entries, reports). Their published entities and comments stay, with no author (
userId: null) and stripped of everything they wrote: title, content, attachments, mentions and metadata, and on an entity also its keywords and location. Their comments are marked deleted (userDeletedAt set). Reputation grants they sent stay (the recipients keep their reputation) but lose their note and metadata. Their chat messages are deleted the way a user deleting their own message deletes it: content, GIF, mentions and metadata are cleared, attached files are removed and userDeletedAt is set, and each message stays in its conversation as deleted, so replies and quotes still point at it. Each conversation’s connected clients get the message:deleted event for every message this deletes, as they do when a user deletes their own. Mentions of the user in other entities, comments and chat messages keep their text, but their id and foreignId become null. This is the same full-cascade delete performed from the dashboard.
This is a hard, irreversible delete. It cannot be undone.
Authentication
Requires a service key. User auth tokens are rejected with a403.
Path Parameters
Response
On success, returns HTTP204 No Content with an empty body.
Error Responses
Elevated Auth Required — 403
Elevated Auth Required — 403
{
"error": "Service key required.",
"code": "auth/elevated-auth-required"
}
User Not Found — 404
User Not Found — 404
{
"error": "User not found.",
"code": "user/not-found"
}
Invalid Params — 400
Invalid Params — 400
{
"error": "...",
"code": "user/invalid-params"
}
Server Error — 500
Server Error — 500
{
"error": "Failed to delete the user.",
"code": "user/server-error"
}

