> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/api-and-integrations/rest-api-reference/datasets.md).

# Datasets

## List datasets

> Lists datasets for the workspace with current ontology conceptVersions on every source. Paginated (limit, cursor).

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"PaginatedEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{},"description":"Payload not declared in this repo"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]}},"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets","summary":"List datasets","description":"Lists datasets for the workspace with current ontology conceptVersions on every source. Paginated (limit, cursor).","tags":["Datasets"],"parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"Page size (1-1000, default 50).","type":"number","minimum":1,"maximum":1000},"description":"Page size (1-1000, default 50)."},{"in":"query","name":"cursor","required":false,"schema":{"type":"string","description":"Opaque cursor from a previous response's `pagination.cursor`."},"description":"Opaque cursor from a previous response's `pagination.cursor`."},{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Create dataset

> Creates a new dataset — a derived, queryable table over one or more sources. Body: name, sources, operations, optional description, tags, anchorConceptId. Every non-empty source must include conceptVersions with exactly one entry per conceptId, copied from a current GET or recommendation response; stale versions return a conflict. Returns the created dataset document.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"CreateDatasetInput":{"type":"object","properties":{"name":{"type":"string"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/DataViewMutationSourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}},"description":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"anchorConceptId":{"type":["string","null"]}},"required":["name","sources","operations"]},"DataViewMutationSourceSchema":{"$ref":"#/components/schemas/SourceSchema"},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets":{"post":{"operationId":"post-api-v1-workspaces-{wsId}-datasets","summary":"Create dataset","description":"Creates a new dataset — a derived, queryable table over one or more sources. Body: name, sources, operations, optional description, tags, anchorConceptId. Every non-empty source must include conceptVersions with exactly one entry per conceptId, copied from a current GET or recommendation response; stale versions return a conflict. Returns the created dataset document.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDatasetInput"}}}},"responses":{"201":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Get dataset

> Returns the dataset by id with current ontology conceptVersions on every source. Must belong to the workspace.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets-{id}","summary":"Get dataset","description":"Returns the dataset by id with current ontology conceptVersions on every source. Must belong to the workspace.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Delete dataset

> Deletes the dataset. Its sources are left intact. Requires full permission.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}":{"delete":{"operationId":"delete-api-v1-workspaces-{wsId}-datasets-{id}","summary":"Delete dataset","description":"Deletes the dataset. Its sources are left intact. Requires full permission.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"responses":{"204":{"description":"No Content"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Update dataset

> Updates name, description, tags, sources, operations, anchorConceptId. A sources update must round-trip conceptVersions from a current GET and include exactly one version per conceptId; stale versions return a conflict. Changing sources/operations may change schema and row count.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"UpdateDataViewSchema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"$ref":"#/components/schemas/DataViewMutationSourceSchema"}},"operations":{"type":"array","items":{}},"anchorConceptId":{"type":["string","null"]}}},"DataViewMutationSourceSchema":{"$ref":"#/components/schemas/SourceSchema"},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}":{"patch":{"operationId":"patch-api-v1-workspaces-{wsId}-datasets-{id}","summary":"Update dataset","description":"Updates name, description, tags, sources, operations, anchorConceptId. A sources update must round-trip conceptVersions from a current GET and include exactly one version per conceptId; stale versions return a conflict. Changing sources/operations may change schema and row count.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDataViewSchema"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Get recommended datasets

> Returns recommended dataset definitions for the workspace (e.g. based on ontology or usage). Used to suggest datasets to create.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/recommended":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets-recommended","summary":"Get recommended datasets","description":"Returns recommended dataset definitions for the workspace (e.g. based on ontology or usage). Used to suggest datasets to create.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Get enriched dataset

> Returns the dataset with enriched metadata: output schema, column metadata, row count, concept metadata, operation details. Use when you need full schema and stats without fetching records.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}/enriched":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets-{id}-enriched","summary":"Get enriched dataset","description":"Returns the dataset with enriched metadata: output schema, column metadata, row count, concept metadata, operation details. Use when you need full schema and stats without fetching records.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Get dataset metadata

> Returns schema entries, column metadata, and row count for the dataset in one call. More efficient than fetching schema and records separately when you only need structure and count.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}/metadata":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets-{id}-metadata","summary":"Get dataset metadata","description":"Returns schema entries, column metadata, and row count for the dataset in one call. More efficient than fetching schema and records separately when you only need structure and count.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Get dataset records

> Returns paginated rows from the dataset. Query params: limit (default 50, max 1000), cursor (opaque, from the previous response's pagination.cursor). Data is computed on demand from sources and operations; no materialisation.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"PaginatedEnvelope":{"type":"object","properties":{"data":{"type":"array","items":{},"description":"Payload not declared in this repo"},"pagination":{"type":"object","properties":{"cursor":{"type":"string","description":"Pass back as ?cursor= to fetch the next page"},"hasMore":{"type":"boolean","description":"Whether a further page exists"},"total":{"type":"number","description":"Total matching rows, when the query can count them"}},"required":["hasMore"]}},"required":["data","pagination"]}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}/records":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets-{id}-records","summary":"Get dataset records","description":"Returns paginated rows from the dataset. Query params: limit (default 50, max 1000), cursor (opaque, from the previous response's pagination.cursor). Data is computed on demand from sources and operations; no materialisation.","tags":["Datasets"],"parameters":[{"in":"query","name":"limit","required":false,"schema":{"description":"Page size (1-1000, default 50).","type":"number","minimum":1,"maximum":1000},"description":"Page size (1-1000, default 50)."},{"in":"query","name":"cursor","required":false,"schema":{"type":"string","description":"Opaque cursor from a previous response's `pagination.cursor`."},"description":"Opaque cursor from a previous response's `pagination.cursor`."},{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedEnvelope"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Get dataset schema

> Returns the output schema (list of schema entries) for the dataset. Reflects the result of applying all operations to the sources.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}/schema":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets-{id}-schema","summary":"Get dataset schema","description":"Returns the output schema (list of schema entries) for the dataset. Reflects the result of applying all operations to the sources.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Validate an operations chain

> Validates an operations chain without persisting anything — a schema dry-run. Body: sources, operations (same shape as a dataset). Returns sourceSchemas, operationSchemas (schema after each step), finalSchema, and the enriched dataset preview. Use to check schema and metadata before creating or updating a dataset.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"SimulateInput":{"type":"object","properties":{"sources":{"type":"array","items":{"$ref":"#/components/schemas/SourceSchema"}},"operations":{"type":"array","items":{"$ref":"#/components/schemas/OperationSchema"}}},"required":["sources","operations"]},"SourceSchema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATASET"},"name":{"type":["string","null"]},"conceptIds":{"type":"array","items":{"type":"string"}},"conceptVersions":{"anyOf":[{"type":"object","additionalProperties":{"type":"integer","minimum":0}},{"type":"null"}]},"version":{"anyOf":[{"$ref":"#/components/schemas/SourcePinSchema"},{"type":"null"}]}},"required":["id","type","conceptIds"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"DATA_VIEW"},"name":{"type":["string","null"]}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"CONCEPT"},"name":{"type":["string","null"]},"prioritiseCalculation":{"type":"boolean","default":true},"showCalculationColumns":{"type":"boolean","default":false}},"required":["id","type"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"GEO_SIDECAR"},"name":{"type":["string","null"]},"conceptId":{"type":"string"},"sidecarKey":{"type":"string"}},"required":["id","type","conceptId","sidecarKey"]}],"discriminator":{"propertyName":"type"}},"SourcePinSchema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"latest"}},"required":["kind"]},{"type":"object","properties":{"kind":{"type":"string","const":"pinned"},"versionId":{"type":"string"}},"required":["kind","versionId"]}],"discriminator":{"propertyName":"kind"}},"OperationSchema":{"type":"object","properties":{"id":{"type":"string"},"sourceId":{"type":"string"},"config":{"$ref":"#/components/schemas/OperationConfigSchema"}},"required":["id","sourceId","config"]},"OperationConfigSchema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"FILTER"},"filterGroup":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}},"required":["type","filterGroup"]},{"type":"object","properties":{"type":{"type":"string","const":"AGGREGATE"},"groupByColumns":{"type":"array","items":{"type":"string"}},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","groupByColumns","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"columnPairs":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/JoinColumnPairSchema"}},{"type":"null"}]},"leftField":{"type":["string","null"]},"rightField":{"type":["string","null"]},"conflictResolution":{"$ref":"#/components/schemas/JoinConflictResolutionEnum"},"leftPrefix":{"type":["string","null"]},"rightPrefix":{"type":["string","null"]}},"required":["type","joinType","conflictResolution"]},{"type":"object","properties":{"type":{"type":"string","const":"CONCATENATE"},"topSource":{"type":["string","null"]},"bottomSource":{"type":["string","null"]},"sources":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"columnMapping":{"type":"object","additionalProperties":{"type":"string"}},"unmatchedRule":{"$ref":"#/components/schemas/UnmatchedRuleEnum"},"discriminatorColumn":{"type":["string","null"]},"discriminatorValues":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","columnMapping","unmatchedRule"]},{"type":"object","properties":{"type":{"type":"string","const":"SORT"},"sortColumns":{"type":"array","items":{"$ref":"#/components/schemas/SortColumnSchema"}}},"required":["type","sortColumns"]},{"type":"object","properties":{"type":{"type":"string","const":"SQL_QUERY"},"query":{"type":"string"},"columnSourceAliases":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}]}},"required":["type","query"]},{"type":"object","properties":{"type":{"type":"string","const":"SPLIT_COLUMN"},"columnToSplit":{"type":"string"},"splitType":{"$ref":"#/components/schemas/SplitTypeEnum"},"delimiter":{"type":["string","null"]},"columns":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/NewColumnDefinitionSchema"}},{"type":"null"}]}},"required":["type","columnToSplit","splitType"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_COLUMNS"},"columns":{"type":"array","items":{"type":"string"}}},"required":["type","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"REMOVE_DUPLICATES"},"column":{"type":["string","null"]},"keep":{"$ref":"#/components/schemas/KeepEnum","default":"first"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"IMPUTE_NULLS"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"column":{"type":["string","null"]},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]},"imputations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"method":{"$ref":"#/components/schemas/ImputeMethodEnum","default":"constant"},"fillValue":{"anyOf":[{"type":["string","number","boolean"]},{"type":"null"}]}},"required":["column"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"DROP_NULLS"},"axis":{"type":"string","enum":["rows","empty_columns"],"default":"rows"},"column":{"type":["string","null"]},"columns":{"type":"array","items":{"type":"string"},"default":[]},"nullThresholdPercent":{"type":"number","default":100}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_VALUES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":["string","null"]}}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"REPLACE_TYPE"},"changes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"column":{"type":"string"},"toType":{"$ref":"#/components/schemas/SchemaMainTypeEnum"},"toSubType":{"anyOf":[{"$ref":"#/components/schemas/SchemaSubTypeEnum"},{"type":"null"}]},"dateFormat":{"type":["string","null"]}},"required":["column","toType"]}},{"type":"null"}]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"INTERPOLATE_TIME"},"column":{"type":"string"},"frequency":{"type":"string"},"method":{"$ref":"#/components/schemas/InterpolateTimeMethodEnum"}},"required":["type","column","frequency","method"]},{"type":"object","properties":{"type":{"type":"string","const":"CLIP_OUTLIERS"},"column":{"type":"string"},"lowerQuantile":{"type":"number","default":0.05},"upperQuantile":{"type":"number","default":0.95}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"NORMALIZE_NUMERIC"},"column":{"type":"string"},"method":{"$ref":"#/components/schemas/NormalizeNumericMethodEnum","default":"z_score"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"MAP_CATEGORIES"},"column":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"defaultValue":{"type":["string","null"]}},"required":["type","column","mapping"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_AGGREGATE"},"timeColumn":{"type":"string"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},"dateFormat":{"anyOf":[{"$ref":"#/components/schemas/DatetimeFormatSchema"},{"type":"null"}]}},"required":["type","timeColumn","granularity","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"TIME_SERIES_JOIN"},"joinType":{"$ref":"#/components/schemas/JoinTypeEnum"},"leftTimeColumn":{"type":"string"},"rightTimeColumn":{"type":"string"},"rightSource":{"type":"string"},"strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"leftEndColumn":{"type":"string"}},"required":["type","leftEndColumn"]}],"discriminator":{"propertyName":"type"}},"exactMatchKeys":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]}},{"type":"null"}]},"multiMatch":{"$ref":"#/components/schemas/MultiMatchStrategyEnum"},"multiMatchAggregations":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}},{"type":"null"}]}},"required":["type","joinType","leftTimeColumn","rightTimeColumn","rightSource","strategy","multiMatch"]},{"type":"object","properties":{"type":{"type":"string","const":"TRANSPOSE"},"timeColumn":{"type":"string"},"envColumns":{"type":"array","items":{"type":"string"}},"valueColumns":{"type":"array","items":{"type":"string"}},"columnTemplate":{"type":"string"},"joinStrategy":{"anyOf":[{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"exact"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"granularity"},"granularity":{"type":"string","enum":["nanosecond","microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"]}},"required":["type","granularity"]},{"type":"object","properties":{"type":{"type":"string","const":"asOf"},"direction":{"$ref":"#/components/schemas/AsOfDirectionEnum"},"tolerance":{"anyOf":[{"type":"object","properties":{"value":{"type":"number"},"unit":{"$ref":"#/components/schemas/ToleranceUnitEnum"}},"required":["value","unit"]},{"type":"null"}]}},"required":["type","direction"]}],"discriminator":{"propertyName":"type"}},{"type":"null"}]}},"required":["type","timeColumn","envColumns","valueColumns","columnTemplate"]},{"type":"object","properties":{"type":{"type":"string","const":"FREQUENCY_ANALYSIS"},"timeColumn":{"type":"string"},"valueColumns":{"type":"array","items":{"type":"string"}},"method":{"$ref":"#/components/schemas/FrequencyMethodEnum"},"windowFunction":{"$ref":"#/components/schemas/FrequencyWindowFunctionEnum","default":"hann"},"windowSize":{"type":["number","null"]},"overlap":{"type":"number","default":0.5},"samplingRateHz":{"type":["number","null"]},"outputFormat":{"$ref":"#/components/schemas/FrequencyOutputFormatEnum"},"frequencyRange":{"anyOf":[{"type":"object","properties":{"minHz":{"type":["number","null"]},"maxHz":{"type":["number","null"]}}},{"type":"null"}]},"frequencyUnit":{"$ref":"#/components/schemas/FrequencyUnitEnum","default":"hz"}},"required":["type","timeColumn","valueColumns","method","outputFormat"]},{"type":"object","properties":{"type":{"type":"string","const":"CYCLIC_AGGREGATE"},"timeColumn":{"type":"string"},"cycleComponent":{"$ref":"#/components/schemas/CyclicComponentEnum"},"aggregations":{"type":"array","items":{"$ref":"#/components/schemas/AggregationFunctionSchema"}}},"required":["type","timeColumn","cycleComponent","aggregations"]},{"type":"object","properties":{"type":{"type":"string","const":"DIFF"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_diff"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"DATE_DIFF"},"startColumn":{"type":"string"},"endColumn":{"type":"string"},"unit":{"$ref":"#/components/schemas/DateDiffUnitEnum","default":"days"},"sign":{"$ref":"#/components/schemas/DateDiffSignEnum","default":"signed"},"outputColumn":{"type":["string","null"]}},"required":["type","startColumn","endColumn"]},{"type":"object","properties":{"type":{"type":"string","const":"CUMULATIVE"},"timeColumn":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"partitionColumns":{"type":"array","items":{"type":"string"},"default":[]},"outputSuffix":{"type":"string","default":"_cumsum"},"replaceColumns":{"type":"boolean","default":false}},"required":["type","timeColumn","columns"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_DECOMPOSE"},"column":{"type":"string"},"mode":{"$ref":"#/components/schemas/ArrayDecomposeModeEnum","default":"position"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"outputPrefix":{"type":"string","default":"_"}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_CONSOLIDATE"},"groups":{"type":"array","items":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"string"},"minItems":1},"outputColumn":{"type":"string"},"dropSource":{"type":"boolean","default":true},"includeNulls":{"type":"boolean","default":false}},"required":["columns","outputColumn"]},"minItems":1}},"required":["type","groups"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_EXPLODE"},"column":{"type":"string"},"outputColumn":{"type":["string","null"]},"preserveIndex":{"type":"boolean","default":false}},"required":["type","column"]},{"type":"object","properties":{"type":{"type":"string","const":"ARRAY_AGGREGATE"},"column":{"type":"string"},"aggregation":{"$ref":"#/components/schemas/ArrayAggregationKindEnum"},"outputColumn":{"type":["string","null"]}},"required":["type","column","aggregation"]},{"type":"object","properties":{"type":{"type":"string","const":"JSON_FLATTEN"},"column":{"type":"string"},"maxColumns":{"type":"integer","exclusiveMinimum":0,"default":500},"separator":{"type":"string","default":"."},"dropSource":{"type":"boolean","default":true}},"required":["type","column"]}],"discriminator":{"propertyName":"type"}},"FilterSchema":{"type":"object","properties":{"column":{"type":"string"},"comparisonOperator":{"$ref":"#/components/schemas/ComparisonOperatorEnum"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":["string","number","boolean"]}}]},"correctType":{"type":"boolean"}},"required":["column","comparisonOperator","value","correctType"]},"ComparisonOperatorEnum":{"type":"string","enum":["Equal to","Not Equal to","Contains","Does not contain","Starts with","Ends with","Is Empty","Is not Empty","Less than","Greater than","Less than or equal to","Greater than or equal to","Before","After","Array contains","Array contains any","Array contains all","Array does not contain","Array does not contain any","Array does not contain all","Array size equal to","Array size greater than","Array size less than"]},"FilterGroupSchema":{"type":"object","properties":{"booleanOperator":{"$ref":"#/components/schemas/LogicalOperatorEnum"},"filters":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]}}},"required":["booleanOperator","filters"]},"LogicalOperatorEnum":{"type":"string","enum":["AND","OR"]},"AggregationFunctionSchema":{"type":"object","properties":{"column":{"type":"string"},"function":{"$ref":"#/components/schemas/AggregateFunctionEnum"},"alias":{"type":["string","null"]},"filter":{"anyOf":[{"anyOf":[{"$ref":"#/components/schemas/FilterSchema"},{"$ref":"#/components/schemas/FilterGroupSchema"}]},{"type":"null"}]}},"required":["column","function"]},"AggregateFunctionEnum":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last","categoryShare"]},"JoinTypeEnum":{"type":"string","enum":["inner","left","right","full"]},"JoinColumnPairSchema":{"type":"object","properties":{"leftField":{"type":"string"},"rightField":{"type":"string"}},"required":["leftField","rightField"]},"JoinConflictResolutionEnum":{"type":"string","enum":["keep_left","keep_right","prefix"]},"UnmatchedRuleEnum":{"type":"string","enum":["error","drop","append"]},"SortColumnSchema":{"type":"object","properties":{"column":{"type":"string"},"direction":{"$ref":"#/components/schemas/SortDirectionEnum"}},"required":["column","direction"]},"SortDirectionEnum":{"type":"string","enum":["asc","desc"]},"SplitTypeEnum":{"type":"string","enum":["delimiter","pattern"]},"NewColumnDefinitionSchema":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":["string","null"]}},"required":["name"]},"KeepEnum":{"type":"string","enum":["first","last"]},"ImputeMethodEnum":{"type":"string","enum":["mean","median","mode","constant"]},"SchemaMainTypeEnum":{"type":"string","enum":["None","String","Category","Number","Boolean","DateTime","Array","Unknown"]},"SchemaSubTypeEnum":{"type":"string","enum":["Integer","Float","UnsignedInteger","UnsignedFloat","String","Number","Category","Boolean","DateTime"]},"InterpolateTimeMethodEnum":{"type":"string","enum":["linear","time","index"]},"NormalizeNumericMethodEnum":{"type":"string","enum":["min_max","z_score"]},"DatetimeFormatSchema":{"type":"string","minLength":1},"AsOfDirectionEnum":{"type":"string","enum":["backward","forward","nearest"]},"ToleranceUnitEnum":{"type":"string","enum":["us","ms","s","m","h","d"]},"MultiMatchStrategyEnum":{"type":"string","enum":["first","last","aggregate"]},"FrequencyMethodEnum":{"type":"string","enum":["fft","welch"]},"FrequencyWindowFunctionEnum":{"type":"string","enum":["hann","hamming","blackman","rectangular"]},"FrequencyOutputFormatEnum":{"type":"string","enum":["spectrogram","time_frequency_long"]},"FrequencyUnitEnum":{"type":"string","enum":["hz","per_minute","per_hour","per_day","per_week","per_month","per_year"]},"CyclicComponentEnum":{"type":"string","enum":["second_in_minute","minute_in_hour","hour_of_day","day_of_week","day_of_month","week_of_year","month_of_year","quarter_of_year"]},"DateDiffUnitEnum":{"type":"string","enum":["seconds","minutes","hours","days","weeks"]},"DateDiffSignEnum":{"type":"string","enum":["signed","absolute"]},"ArrayDecomposeModeEnum":{"type":"string","enum":["position","one_hot"]},"ArrayAggregationKindEnum":{"type":"string","enum":["mean","sum","min","max","median","count"]},"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}/validate":{"post":{"operationId":"post-api-v1-workspaces-{wsId}-datasets-{id}-validate","summary":"Validate an operations chain","description":"Validates an operations chain without persisting anything — a schema dry-run. Body: sources, operations (same shape as a dataset). Returns sourceSchemas, operationSchemas (schema after each step), finalSchema, and the enriched dataset preview. Use to check schema and metadata before creating or updating a dataset.","tags":["Datasets"],"parameters":[{"name":"wsId","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: wsId"},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: id"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateInput"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"422":{"$ref":"#/components/responses/422"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Export dataset

> Streams the dataset result as a file. Path param format: csv, json, or parquet. Response is streaming with appropriate Content-Type and Content-Disposition. Requires exports:read scope.

```json
{"openapi":"3.1.0","info":{"title":"RootCause Public API","version":"1.0.0"},"tags":[{"name":"Datasets"}],"servers":[{"url":"https://sandbox.rootcause.ai","description":"Sandbox"},{"url":"https://platform.rootcause.ai","description":"Production"},{"url":"http://localhost:3000","description":"Local development"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"An API key (pk_...) created on the Organisation API page, or an OAuth access token. Every operation requires one."}},"schemas":{"UnspecifiedEnvelope":{"type":"object","properties":{"data":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":{}},{"type":"array","items":{}}],"description":"Payload not declared in this repo"}},"required":["data"]}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"429":{"description":"Too Many Requests; the response carries Retry-After","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}},"required":["type","title","status","detail"]}}}}}},"paths":{"/api/v1/workspaces/{wsId}/datasets/{id}/export/{format}":{"get":{"operationId":"get-api-v1-workspaces-{wsId}-datasets-{id}-export-{format}","summary":"Export dataset","description":"Streams the dataset result as a file. Path param format: csv, json, or parquet. Response is streaming with appropriate Content-Type and Content-Disposition. Requires exports:read scope.","tags":["Datasets"],"parameters":[{"in":"path","name":"format","required":true,"schema":{"type":"string","enum":["csv","json","parquet"],"description":"Export format"},"description":"Export format"}],"responses":{"200":{"description":"Successful response","content":{"application/octet-stream":{"schema":{"$ref":"#/components/schemas/UnspecifiedEnvelope"}}}},"400":{"$ref":"#/components/responses/400"},"401":{"$ref":"#/components/responses/401"},"403":{"$ref":"#/components/responses/403"},"404":{"$ref":"#/components/responses/404"},"429":{"$ref":"#/components/responses/429"},"500":{"$ref":"#/components/responses/500"}}}}}}
```
