v1

latestOpenAPI 3.1.0Proprietary2026-07-262570100.1 KB
context

Delete documents or memories

Delete one or more knowledge sources or memories by ID.

delete/context

Request body

collectionstring

Collection scope. Defaults to the default collection when omitted. Formerly sub_tenant_id; the sub_tenant_id alias is still accepted (deprecated).

databasestring

Database/Collection are the canonical v2 names; TenantID/SubTenantID are their deprecated aliases, reconciled by the TenantAliases middleware before binding so TenantID is always populated.

idsstring[]

IDs of the sources or memories to delete.

sub_tenant_idstring

deprecated: use collection

tenant_idstring

deprecated: use database

type'knowledge' | 'memory'

Bucket to delete from: knowledge (default) or memory.

Example request

{
  "collection": "team_docs",
  "database": "acme_corp",
  "ids": [
    "HydraDoc1234",
    "HydraDoc4567"
  ],
  "sub_tenant_id": "sub_tenant_4567",
  "tenant_id": "tenant_1234",
  "type": "knowledge"
}

Response

OK

successboolean

Whether the request succeeded.

Example response

{
  "data": {
    "deleted_count": 1,
    "message": "Success",
    "results": [
      {
        "deleted": true,
        "error": "",
        "id": "HydraDoc1234"
      }
    ],
    "success": true,
    "user_memory_deleted": 1
  },
  "error": {
    "code": "DATABASE_NOT_FOUND",
    "message": "Database not found"
  },
  "meta": {
    "collection": "team_docs",
    "database": "acme_corp",
    "deprecation": [
      {
        "deprecated": true,
        "deprecated_field": "tenant_id",
        "deprecated_since": "2.0.1",
        "message": "tenant_id is deprecated; use database instead.",
        "preferred_field": "database"
      }
    ],
    "latency_ms": 12.3,
    "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
    "source_type": "file",
    "sub_tenant_id": "sub_tenant_4567",
    "tenant_id": "tenant_1234"
  },
  "success": true
}