searchText. These routes are the REST twin of the Data runtime object and address the same collections your tools read.
Verified against lua-cli 3.33.0.
Base URL and authentication
Reads needknowledge:read and writes knowledge:write on the agent; the host, the bearer header, and the error envelope are on the REST API overview. Collections are not partitioned by environment.
The entry
string
Entry id, a UUID.
object
The JSON you stored.
string
The text embedded for semantic search, when set.
number
Unix time in milliseconds.
number
Unix time in milliseconds.
search cannot be read by id because .../<collection>/search is the search route.
Endpoints
GET /developer/agents/:agentId/custom-data
Lists the agent’s collections with counts and timestamps.string
required
The agent.
200 with { "data": [...], "count" }.
array
One item per collection:
name, entryCount, lastUpdatedAt, firstCreatedAt (Unix milliseconds), and indexes on collections that declared one.number
Number of collections.
Data.collections().
POST /developer/agents/:agentId/custom-data/:collection
Creates an entry and, whensearchText is given, embeds it for semantic search.
string
required
The agent.
string
required
Collection name; created on first write.
any
required
The value to store: an object, array, string, number, or boolean.
null and an empty string are refused.string
Text to embed. Include every term you expect a search to match. A string only; the options object the SDK’s
Data.create() types is not accepted here and answers 400 with searchText must be a string.201 with the entry.
Errors
Equivalent:
Data.create('movies', data, 'Inception Nolan sci-fi').
GET /developer/agents/:agentId/custom-data/:collection
Returns the entries that match a filter, one page at a time.string
required
The agent.
string
required
The collection.
string
A JSON Lua Query over
data: dot notation for nested fields, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, and $and or $or at the root. Omit it for every entry.integer
default:"1"
Page number from 1.
integer
default:"10"
From 1 to 100; larger values are clamped.
200 with { "data": [...entries], "pagination": { currentPage, totalPages, totalCount, limit, hasNextPage, hasPrevPage, nextPage, prevPage } }.
Errors
Equivalent:
Data.get('movies', { year: { $gte: 2010 } }, 1, 20).
GET /developer/agents/:agentId/custom-data/:collection/search
Returns the entries whosesearchText is semantically closest to a query.
string
required
The agent.
string
required
The collection.
string
required
Natural-language query.
integer
default:"5"
From 1 to 20; larger values are clamped to 20.
number
default:"0.6"
Minimum similarity from 0 to 1; results under it are dropped.
200 with { "data": [...entries with score], "count" }; each entry carries a score from 0 to 1. This is a flat list, not the paginated envelope the filter route returns.
Errors
Equivalent:
Data.search('movies', 'mind-bending thriller', 5, 0.7).
GET /developer/agents/:agentId/custom-data/:collection/:entryId
Returns one entry. Errors
Equivalent:
Data.getEntry('movies', '<entryId>').
PUT /developer/agents/:agentId/custom-data/:collection/:entryId
Merges new fields into an entry and optionally re-embeds it.object
required
Fields to merge into the stored
data.string
New text to embed.
200 with { "status": "success", "message": "Custom data entry updated" }.
Errors
Equivalent:
Data.update('movies', '<entryId>', { rating: 9 }, 'Inception Nolan sci-fi').
PATCH /developer/agents/:agentId/custom-data/:collection/:entryId
Sets and unsets top-level fields ofdata atomically, and sets or clears the embedding.
object
Top-level fields to write.
string[]
Top-level fields to remove.
string or null
A string re-embeds the entry;
null clears both the text and its vector; omit it to leave the embedding alone.200 with { "status": "success", "message" }; 404 Custom data entry not found when the entry does not exist.
DELETE /developer/agents/:agentId/custom-data/:collection/:entryId
Deletes one entry. Response200 with { "status": "success", "message": "Custom data entry deleted" }; 404 Custom data entry not found when the entry does not exist.
Equivalent: Data.delete('movies', '<entryId>').
See also
Data— the same collections from agent code, with declared indexes- Lua Query — the filter grammar the
filterparameter accepts - Store and search data — choosing filters or semantic search
- User data — one record per end user instead of a collection

