document_id.
Added in Python SDK 0.9.0 and JavaScript and TypeScript SDK 0.9.0. In TypeScript, pass the
document_key as a string, or an options object; every option is accepted in snake_case or camelCase (documentId or document_id). The result is returned as the server sends it, with snake_case fields, typed as Record<string, unknown>.documents.restore until the purge date, the end of the instance’s deletion period. After that they are removed for good. With permanent=True (permanent: true in TypeScript) they are removed at once, with no restore.
Parameters
Address the document one way: pass eitherdocument_key or document_id, as in documents.get.
Remove it now, with no restore period. Needs a management-level key. A key without it raises
MissingScopeError.Returns
pending_purge for a soft delete (hidden now, restorable until purge_at), or deleted for a permanent one.For a soft delete: when the document is removed for good.
None (null in TypeScript) for a permanent delete.Soft delete: how many memories made from the document are now hidden. A permanent delete returns
memories_removed instead.Example
Raises
MissingScopeError: when the key is not allowed to delete documents, orpermanent=Truewithout a management-level key. Playground keys cannot delete documents.ContextNotFoundError: when the document does not exist or belongs to another instance.AmbiguousDocumentError: when adocument_idnames more than one document in the scope you gave.InvalidInputError: whenpermanentis not a boolean, or you pass both or neither ofdocument_keyanddocument_id.