Delete memory
import requests
url = "https://api.hydradb.com/memories/delete_memory"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hydradb.com/memories/delete_memory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://api.hydradb.com/memories/delete_memory \
--header 'Authorization: Bearer <token>'{
"user_memory_deleted": true,
"success": true
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}Knowledge & Memories
Delete Memory
Permanently delete a single memory by its ID.
DELETE
/
memories
/
delete_memory
Delete memory
import requests
url = "https://api.hydradb.com/memories/delete_memory"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.hydradb.com/memories/delete_memory', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://api.hydradb.com/memories/delete_memory \
--header 'Authorization: Bearer <token>'{
"user_memory_deleted": true,
"success": true
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}{
"detail": {
"success": false,
"message": "Error occurred",
"error_code": "<string>"
}
}When to use it
- Right-to-deletion – remove a specific user’s memory upon request
- Cleanup – delete outdated or incorrect memories
- Privacy controls – let end users delete their own data through your app
POST /knowledge/delete_knowledge.
This operation is irreversible. Once deleted, the memory cannot be recovered.
Endpoint
- Auth: Bearer token
- Idempotency: Idempotent - re-sending for an already-deleted memory returns
200withuser_memory_deleted: false - Async: No
Example
curl -X DELETE 'https://api.hydradb.com/memories/delete_memory?tenant_id=my_first_tenant&memory_id=1d50e5cd7c196a2bbcc1a59b037b3a44' \
-H "Authorization: Bearer <your_api_key>"
const response = await client.upload.deleteMemory({
tenant_id: "my_first_tenant",
memory_id: "1d50e5cd7c196a2bbcc1a59b037b3a44"
});
response = client.upload.delete_memory(
tenant_id="my_first_tenant",
memory_id="1d50e5cd7c196a2bbcc1a59b037b3a44",
)
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | The tenant the memory belongs to. |
memory_id | string | Yes | The unique identifier of the memory to delete. This is the source_id returned when the memory was added. |
sub_tenant_id | string | No | Sub-tenant scope. If omitted, the default sub-tenant is used. |
Response
{
"success": true,
"user_memory_deleted": true
}
| Field | Description |
|---|---|
success | true if the deletion request was processed. |
user_memory_deleted | true if the specific memory was found and deleted. |
Related endpoints
- Before this: List data (
kind: "memories") – browse memories before deleting - Alternative: Delete tenant – delete all memories in a tenant at once
Errors
Common codes:400 INVALID_PARAMETERS, 404 MEMORY_NOT_FOUND. See Error Responses for the full list.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Tenant ID
Example:
"tenant_1234"
Unique identifier of the memory to delete
Example:
"memory_1234"
Sub-tenant ID
Example:
"sub_tenant_4567"
Was this page helpful?
