Save a dataset def — a persisted query over the episode lake
const url = 'https://example.com/v1/datasets/defs';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"name":"example","description":"","query":{"dataset_ids":["2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"],"task":"example","tier":"","min_duration_s":1,"max_duration_s":1,"tags":["example"],"review_state":"","search":"example","numeric_predicates":[{"field":"duration_s","op":"gt","value":1}],"predicates":[{"stream":"action","channel":"example","agg":"max","op":"gt","value":1}],"episodes":[{"dataset_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","episode_index":1}],"query_text":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/datasets/defs \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "description": "", "query": { "dataset_ids": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "task": "example", "tier": "", "min_duration_s": 1, "max_duration_s": 1, "tags": [ "example" ], "review_state": "", "search": "example", "numeric_predicates": [ { "field": "duration_s", "op": "gt", "value": 1 } ], "predicates": [ { "stream": "action", "channel": "example", "agg": "max", "op": "gt", "value": 1 } ], "episodes": [ { "dataset_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "episode_index": 1 } ], "query_text": "example" } }'ADR 0010: a dataset is a saved query. Both modes land here — an exact
selection (query.episodes, the pairs the user picked) and a dynamic
view (the facets, resolved fresh at every pin). Pin the returned def to
freeze a reproducible version.
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Act on this account (active)
Act on this account (active)
Header Parameters
Section titled “Header Parameters ”Request Body required
Section titled “Request Body required ”Save a query over the episode lake as a dataset definition.
object
ADR 0010: a dataset IS this query.
Closed and fully typed on purpose. The query travels to QDS as opaque JSON, so this model is the only place its shape is checked — an unmodelled key would be stored or dropped in silence and the definition would then resolve to a different set of episodes than the one the user built. Predicates reuse the explore bodies so a definition can only hold a filter the resolver can actually evaluate.
Quality is not expressible here: no status/flag facet exists, because selection is intent. Every episode a user picked belongs to the dataset, flagged ones included.
object
object
object
One hand-picked member, keyed the way the server keys membership: (source dataset, episode index) — not an episode-row uuid.
object
Responses
Section titled “ Responses ”Successful Response
Example generated
exampleInvalid or missing API key
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}Unmodelled or oversized query
Standard error response.
object
Error message describing what went wrong
Example generated
{ "detail": "example"}