Skip to main content
DELETE
JavaScript
Permanently delete a memory layer and every entry inside it.

Entries go with it; assignments block it

The layer’s entries are deleted along with it, no need to empty it first. A layer with entries deletes cleanly. What does block the delete is an assignment. While any variation still has the layer attached, the delete is a 400:
So detach the layer from every variation first, then delete it. The variation’s info.memoryLayerAssignments is where you see what still holds it.
A layer can get stuck in this state if you deleted the agent that held the assignment rather than removing the assignment: agent deletion does not always clean up the memory-layer assignment, which leaves the layer reporting “assigned” with no live variation to detach from. Deleting the variation directly, or removing the assignment, avoids this.
Episodic layers are system-managed and cleaned up by Cadenya; you delete the skills layers you created, not the episodic ones it maintains.

Remove a memory layer from a variation

Detach it first so the delete succeeds.

Get a memory layer

Check entryCount before you remove it.

Delete a memory entry

Remove one entry instead of the whole layer.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

workspaceId
string
required
Example:

"workspace_01HXKD2E5NQM3T9AYWCF133E3Q"

id
string
required

Memory layer ID. Accepts canonical memlyr_… form or external_id: form.

Example:

"memlyr_01HXKD2E5NQM3T9AYWCFFFBMJH"

Response