Skip to main content

DELETE /v1/memories/{id}

Delete a memory by ID. Supports two deletion modes:
  • Soft delete (default) — marks the memory as deprecated. It is immediately excluded from all search results but remains in the database. Reversible via the dashboard.
  • Hard delete (?hard=true) — permanently removes the memory from all stores: the relational database, vector index, search cache, and archive. Irreversible. Use for GDPR erasure requests.
Required scope: memory:delete

Request

Soft delete

curl -X DELETE https://api.thrindex.com/v1/memories/3f2e1d0c-1234-5678-abcd-ef0123456789 \
  -H "Authorization: Bearer th_live_..."

Hard delete (GDPR erasure)

curl -X DELETE "https://api.thrindex.com/v1/memories/3f2e1d0c-1234-5678-abcd-ef0123456789?hard=true" \
  -H "Authorization: Bearer th_live_..."

Path parameters

ParameterTypeRequiredDescription
idstring (UUID)yesThe memory’s unique identifier.

Query parameters

ParameterTypeRequiredDefaultDescription
hardbooleannofalseSet to true for permanent erasure. Irreversible.

Response

204 No Content

Empty body. The memory has been deleted (or flagged for deletion).

Soft delete vs hard delete

Soft deleteHard delete
DefaultYes (hard omitted or false)No — must pass ?hard=true
Effect on searchImmediately excludedPermanently removed
Data retainedYes — status set to deprecatedNo — removed from all stores
ReversibleYes — via dashboardNo — irreversible
Use caseStandard deletion, debuggingGDPR right-to-erasure requests

Examples

from thrindex import Thrindex, NotFoundError

client = Thrindex(api_key="th_live_...")

# Soft delete
try:
    client.delete("3f2e1d0c-1234-5678-abcd-ef0123456789")
    print("Memory soft-deleted.")
except NotFoundError:
    print("Memory not found.")

# Hard delete (GDPR erasure)
try:
    client.delete("3f2e1d0c-1234-5678-abcd-ef0123456789", hard=True)
    print("Memory permanently erased.")
except NotFoundError:
    print("Memory not found.")

Errors

StatusCodeDescription
401unauthorizedMissing or invalid API key
401forbiddenAPI key lacks memory:delete scope
404not_foundMemory does not exist, has already been hard-deleted, or belongs to a different organization
429rate_limitedRate limit exceeded
500internal_errorServer error