Skip to content

Delete user

Erase one app user whole - everything held for them and anything still on its way in - from your backend.

POST/v2/memory/users/deleteErases memoryTry it in the Playground
Auth
write key
Cost
1 event; never refused for your plan

Erases everything held for the app user named in X-Alexein-User: every item, excerpt and fact, every version, and anything still on its way in. It does what Delete app user does in the console, so an account deletion in your app can erase the user's memory without anyone opening the console. See Handling erasure requests.

It cannot be undone. A later add for the same id starts an empty memory. Like every erasure, it is listed in the organisation's Deletion log. To erase only some of a user's memory, use forget.

Headers

Authorizationstringrequired

Bearer tm_…. The key must read and write.

X-Alexein-Userstringrequired

The app user to erase. See App users.

X-Request-Idstring

Your id for this request, echoed on the response.

Body

(none)object

Send {}.

Response

userstring

The app user erased, as you sent it.

deletedboolean

true. Keep the response, with the date, as your proof of the erasure.

Errors

400bad request

X-Alexein-User is missing or not a usable id.

401unauthorized

The bearer is not a key this service issued.

403forbidden

this key reads; writing takes a key that writes.

429too many requests

Too many requests in flight. Retry after Retry-After seconds. See Limits.

503unavailable

The service is busy or briefly unavailable. Retry after Retry-After seconds, or with backoff when there is none.

Request
curl https://api.alexein.ai/v2/memory/users/delete \
  -H "Authorization: Bearer $ALEXEIN_API_KEY" \
  -H "X-Alexein-User: user_42" \
  -H "Content-Type: application/json" \
  -d '{}'
200 OK
{
  "user": "user_42",
  "deleted": true
}