Ls
List the entries of one directory of an end user's memory, to see its shape before reading.
POST /v1/memory/lsAn end user's memory is a tree of files: raw/ holds the ledger of what was added, passages/ the passages
cut from it, and further directories hold what was built from them. Ls lists one directory. Makes no model call.
Headers
AuthorizationstringBearer tm_…. A read key is enough.
X-Twin-AccountstringThe end user whose memory to list. See End users.
X-Request-IdstringYour id for this request, echoed on the response.
Body
pathstringThe directory, such as passages/memory. Up to 512 characters. Default "", the top of the tree.
Response
pathstringThe directory as sent, or / for the top.
entriesstring[]Its entries. Directories end in /.
Errors
400bad requestX-Twin-Account is missing or not a usable id.
401unauthorizedThe bearer is not a key this service issued.
404not foundno memory for end user 'user_42' yet.
422invalidA path over 512 characters.
503unavailableAt capacity, or this end user is being rebuilt. Retry after Retry-After seconds.
curl https://api.twinmemory.dev/v1/memory/ls \
-H "Authorization: Bearer $TWIN_MEMORY_API_KEY" \
-H "X-Twin-Account: user_42" \
-H "Content-Type: application/json" \
-d '{ "path": "passages/memory" }'{
"path": "passages/memory",
"entries": ["documents/", "messages/", "notes/"]
}{
"path": "/",
"entries": ["passages/", "raw/", "threads/", "timeline/"]
}