Delete a user
Delete a represented user and their associated data.
/api/v1/users/:idconst response = await fetch("https://api.smallworld.sh/api/v1/users/customer_123", {
method: "DELETE",
headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
Use your server-side apiKey. Replace the example IDs.
Path parameters#
idstringrequiredYour application's user ID, URL-encoded. At most 512 characters, with no surrounding whitespace or null bytes. Encode the IDs
.and..as%2Eand%2E%2E: curl sends these as written, but JavaScript'sfetchremoves them even when encoded.
Responses#
Returns deleted: true after deletion succeeds.
{
"deleted": true
}
More about this endpoint
Deletion also removes the user's sessions, files, executions, tool-call history, own connections, connect sessions, user policy overrides, group memberships, and user mounts with their files. Their groups, with the groups' connections and mounts, stay.
A user with a running session cannot be deleted. The Playground's test user is protected.
This is permanent. A later execution with the same external ID can create a new user but cannot recover the deleted state.