DELETE
/
memories
/
{memory_id}
curl -X DELETE 'https://api.memsync.ai/memories/mem_123abc' \
  -H 'X-API-Key: YOUR_API_KEY'
{
  "success": true,
  "memory_id": "mem_123abc",
  "deleted_at": "2024-01-15T16:45:00Z",
  "cascade_deletions": {
    "profile_updates": 2,
    "derived_insights": 1,
    "embeddings": 1
  },
  "backup_id": "backup_456def"
}
Permanently removes a memory entry from the user’s memory store. This action cannot be undone.
This operation is irreversible. Once a memory is deleted, it cannot be recovered.
curl -X DELETE 'https://api.memsync.ai/memories/mem_123abc' \
  -H 'X-API-Key: YOUR_API_KEY'

Path Parameters

memory_id
string
required
The unique identifier of the memory to delete

Query Parameters

cascade
boolean
default:"false"
Whether to cascade delete related data (e.g., derived insights, profile updates)
backup
boolean
default:"true"
Whether to create a backup before deletion (for compliance/audit purposes)

Response

success
boolean
Indicates if the deletion was successful
memory_id
string
ID of the deleted memory
deleted_at
string
ISO 8601 timestamp when the memory was deleted
cascade_deletions
object
Information about related data that was also deleted (if cascade=true)
backup_id
string
ID of the backup created (if backup=true)
{
  "success": true,
  "memory_id": "mem_123abc",
  "deleted_at": "2024-01-15T16:45:00Z",
  "cascade_deletions": {
    "profile_updates": 2,
    "derived_insights": 1,
    "embeddings": 1
  },
  "backup_id": "backup_456def"
}

Error Responses

404
object
Memory not found
{
  "error": "Memory not found",
  "code": "MEMORY_NOT_FOUND",
  "memory_id": "mem_123abc"
}
401
object
Unauthorized access
{
  "error": "Invalid or expired token",
  "code": "UNAUTHORIZED"
}
403
object
Access denied - memory belongs to another user
{
  "error": "Access denied",
  "code": "FORBIDDEN"
}
409
object
Cannot delete - memory is being processed
{
  "error": "Memory is currently being processed and cannot be deleted",
  "code": "DELETION_CONFLICT",
  "processing_status": "embedding_generation"
}
500
object
Internal server error during deletion
{
  "error": "Failed to delete memory",
  "code": "DELETION_FAILED",
  "retry_after": 30
}

Batch Deletion

For deleting multiple memories at once, use the batch endpoint:
POST /memories/batch-delete
{
  "memory_ids": ["mem_123abc", "mem_456def", "mem_789ghi"],
  "cascade": true,
  "backup": true
}

Recovery Options

While deleted memories cannot be restored through the API, backups are created for compliance purposes:
  • Backups: Available for 30 days for compliance/audit purposes
  • Contact Support: For accidental deletions, contact support with the backup_id
  • Data Export: Consider using the data export feature before bulk deletions

Impact on User Profile

Deleting memories may affect:
  • Profile Bio: Auto-generated bio may be updated
  • Category Profiles: Statistics and insights for the memory’s category
  • Derived Insights: Any insights based on the deleted memory
  • Search Results: Memory will no longer appear in search results
Use the cascade=true parameter to automatically clean up related data, or cascade=false to preserve derived insights for analysis.