Skip to main content
DELETE
Delete one or more sources by ID. type selects where to delete from: knowledge (the default), memory, or all to delete matching IDs from both. Send database, collection, ids, and type as top-level fields in the request body. Include the same collection used at ingestion. Omitting it targets the default collection.

Status codes

By default the call can return 200 even when nothing was deleted. Check data.deleted_count for the number deleted and data.results[] for each ID’s outcome.

Strict status codes

Send X-HydraDB-Delete-Status: strict to receive error statuses when deletion fails. A knowledge batch is not deleted while any requested source is still indexing. Check Ingestion Status before retrying.

Authorizations

Authorization
string
header
required

Send your API key as Authorization: Bearer <your_api_key>.

Headers

X-HydraDB-Delete-Status
enum<string>

strict answers 404, 409 or 500 when the delete did not happen; legacy always answers 200. Omit it for the server default, currently legacy.

Available options:
strict,
legacy

Body

application/json

Delete request

collection
string

Collection the contexts belong to. Omit it to use the database's default collection.

Example:

"team_docs"

database
string

Database the contexts belong to. Required. Formerly tenant_id; the alias is still accepted.

Example:

"acme_corp"

ids
string[]

The IDs of the contexts to delete.

Example:
sub_tenant_id
string
deprecated

Deprecated: use collection.

Example:

"sub_tenant_4567"

tenant_id
string
deprecated

Deprecated: use database.

Example:

"tenant_1234"

type
enum<string>

Corpus to delete from, knowledge, memory or all for both. Defaults to knowledge.

Available options:
knowledge,
memory,
all
Example:

"knowledge"

Response

OK

data
SourcesMemoryDeleteResponse · object
Example:
error
HandlerApiError · object | null

Error details on failure, or null on success.

Example:

null

meta
HandlerResponseMeta · object
Example:
success
boolean

Whether the request succeeded.

Example:

true