{"openapi":"3.1.0","info":{"title":"FiniDB","version":"0.0.1","description":"FiniDB daemon REST API (docs/05). Field names are the legacy camelCase names."},"servers":[{"url":"/"}],"components":{"securitySchemes":{"basic":{"type":"http","scheme":"basic"},"bearer":{"type":"http","scheme":"bearer"}}},"paths":{"/v1/openapi.json":{"get":{"summary":"OpenAPI 3.1 document generated from the route schemas","tags":["server"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}}}},"/v1/health":{"get":{"summary":"version, uptime, open databases","tags":["server"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}}}},"/v1/databases":{"get":{"summary":"list the databases the caller can access","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a database {name, owner?, settings?} (superuser or a user with createdb)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"owner":{"type":"string"},"settings":{"type":"object","properties":{"max_memory":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_rows":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_pivot_cells":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"idle_timeout":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false}},"required":["name"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}":{"get":{"summary":"database metadata and status","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"patch":{"summary":"update per-database settings (owner)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"type":"object","properties":{"max_memory":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_rows":{"type":"integer","minimum":0,"maximum":9007199254740991},"max_pivot_cells":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"idle_timeout":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false}},"required":["settings"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"drop a database (owner): files removed after a final backup","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/grants":{"get":{"summary":"list grants (owner)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"grant a role {user, role} (owner)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"string"},"role":{"type":"string","enum":["owner","editor","viewer","token"]}},"required":["user","role"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"revoke {user} (owner)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"string"}},"required":["user"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/grants/{user}":{"delete":{"summary":"revoke a user's grant (owner)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/open":{"post":{"summary":"open the database now (loads it into a worker)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/close":{"post":{"summary":"persist and close the database (editor)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/save":{"post":{"summary":"write the snapshot now (editor)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/recompute":{"post":{"summary":"RECOMPUTE_ALL as a job: 202 {jobId}, progress on /events (editor)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: RESET_BY_CALC_TYPE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/stats":{"get":{"summary":"engine stats (docs/04 §9)","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: STATS","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/databases/{db}/jobs/{jobId}":{"get":{"summary":"status of a background job","tags":["databases"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/users":{"get":{"summary":"list users (superuser)","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a user {name, password, superuser?, createdb?} (superuser)","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"password":{"type":"string"},"superuser":{"type":"boolean"},"createdb":{"type":"boolean"}},"required":["name","password"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/users/{user}":{"get":{"summary":"one user (self or superuser)","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"patch":{"summary":"change password (self) or flags (superuser)","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"superuser":{"type":"boolean"},"createdb":{"type":"boolean"}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"delete a user (superuser)","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/users/{user}/tokens":{"get":{"summary":"list a user's tokens (self or superuser)","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a token {label?, expires?, database?}; the token is returned once","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"expires":{"type":["string","null"]},"database":{"type":["string","null"]}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/users/{user}/tokens/{id}":{"delete":{"summary":"revoke a token (self or superuser)","tags":["users"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"user","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}":{"get":{"summary":"describe the whole database (models, tables, dims, methods, cond_objs, views)","tags":["models"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: DESCRIBE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models":{"get":{"summary":"list models","tags":["models"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: GET_MODELS","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a model {id, name?, description?}","tags":["models"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_MODEL","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}":{"get":{"summary":"one model","tags":["models"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: FETCH_MODEL","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"patch":{"summary":"update a model {name?, description?, newId?}","tags":["models"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_MODEL, UPDATE_MODEL_ID","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"newId":{"type":"string"}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove a model","tags":["models"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_MODEL","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables":{"get":{"summary":"list the tables of a model","tags":["tables"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: GET_TABLES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a table {id, name?, description?, isPivot?, folder?} or duplicate one {sourceModelId?, sourceTableId, id, name?}","tags":["tables"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_TABLE, DUP_TABLE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"isPivot":{"type":"boolean"},"folder":{"type":"string"},"sourceModelId":{"type":"string"},"sourceTableId":{"type":"string"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}":{"get":{"summary":"one table (definition, dims, methods, cond_objs, views, num_records)","tags":["tables"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: FETCH_TABLE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"patch":{"summary":"update a table {name?, description?, folder?, newId?, calcType?, displayDimId?}","tags":["tables"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_TABLE, UPDATE_TABLE_ID, SET_TABLE_CALC_TYPE, UPDATE_TABLE_DISPLAY_DIM_ID","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"folder":{"type":"string"},"newId":{"type":"string"},"calcType":{"type":"string","enum":["auto","manual"]},"displayDimId":{"type":"string"}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove a table","tags":["tables"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_TABLE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/pivot":{"put":{"summary":"configure the pivot {vdimIds, hdimIds, cdimIds, vfdimIds?, hfdimIds?, pvalueBehavior?, pvalueBehaviorDimValue?, periodsDimId?, displayDimId?, calcType?}","tags":["tables"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: SET_PIVOT, SET_PERIODS_DIM_ID, UPDATE_TABLE_DISPLAY_DIM_ID, SET_TABLE_CALC_TYPE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vdimIds":{"type":"array","items":{"type":"string"}},"hdimIds":{"type":"array","items":{"type":"string"}},"cdimIds":{"type":"array","items":{"type":"string"}},"vfdimIds":{"type":"array","items":{"type":"string"}},"hfdimIds":{"type":"array","items":{"type":"string"}},"pvalueBehavior":{"type":"string"},"pvalueBehaviorDimValue":{"type":"string"},"periodsDimId":{"type":"string"},"displayDimId":{"type":"string"},"calcType":{"type":"string","enum":["auto","manual"]},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/make-pivot":{"post":{"summary":"build an aggregate pivot over this table {newModelId?, newTableId, newTableName?, vdimIds, hdimIds, cdimIds, aggType?} or a reference table from a dim {id, sourceDimId, name?}","tags":["tables"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: MAKE_PIVOT, CREATE_TABLE_FROM_DIM","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/dims":{"get":{"summary":"list dims","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: FETCH_TABLE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a dim {id, name?, type?, refModelId?, refTableId?, refDimId?, anchorId?} or duplicate one {id, sourceDimId, anchorDimId?}","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_DIM, CREATE_DIM_AT, DUP_DIM","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"refModelId":{"type":"string"},"refTableId":{"type":"string"},"refDimId":{"type":"string"},"anchorId":{"type":"string"},"sourceDimId":{"type":"string"},"anchorDimId":{"type":"string"},"format":{"type":"string"},"width":{"type":"number"},"hidden":{"type":"boolean"},"formulaOnly":{"type":"boolean"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/dims/{d}":{"get":{"summary":"one dim","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: GET_DIM","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"d","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"patch":{"summary":"update a dim {name?, type?, refModelId?, refTableId?, refDimId?, newId?, format?, width?, hidden?, formulaOnly?}","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_DIM, UPDATE_DIM_ID","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"d","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"refModelId":{"type":"string"},"refTableId":{"type":"string"},"refDimId":{"type":"string"},"newId":{"type":"string"},"format":{"type":"string"},"width":{"type":"number"},"hidden":{"type":"boolean"},"formulaOnly":{"type":"boolean"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove a dim","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_DIM","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"d","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/dims/{d}/values":{"delete":{"summary":"clear every entered value of a dim","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CLEAR_DIM_VALUES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"d","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/dims/{d}/move":{"post":{"summary":"move a dim {before: dimId} | {after: dimId} | {switchWith: dimId}","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: MOVE_DIM_BEFORE, MOVE_DIM_AFTER, SWITCH_DIMS","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"d","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"before":{"type":"string"},"after":{"type":"string"},"switchWith":{"type":"string"}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/dims/{d}/unique-values":{"get":{"summary":"unique values of a dim (?search= prefix filter, ?limit=)","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: GET_UNIQUE_VALUES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"d","in":"path","required":true,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/linked-pdims":{"post":{"summary":"create a dim linked to a pdim {id, linkedToPdimId, fetchDimId, name?, type?, anchorId?}","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_DIM_LINKED_TO_PDIM","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"linkedToPdimId":{"type":"string"},"fetchDimId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"anchorId":{"type":"string"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","linkedToPdimId","fetchDimId"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/linked-pdims/{d}":{"patch":{"summary":"update a linked dim {linkedToPdimId, fetchDimId, name?, type?}","tags":["dims"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_DIM_LINKED_TO_PDIM","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"d","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"linkedToPdimId":{"type":"string"},"fetchDimId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["linkedToPdimId","fetchDimId"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/records":{"get":{"summary":"page of records (?startIdx=0&pageSize=100&full=1 for cell objects; filters as filterValues JSON)","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CALCULATE (tabular)","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"startIdx","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"pageSize","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"full","in":"query","required":false,"schema":{"type":"string"}},{"name":"filterValues","in":"query","required":false,"schema":{"type":"string"}},{"name":"search","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a record {record: [...]} (at recordIdx / after recordId when given)","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_RECORD, CREATE_RECORD_AT, CREATE_RECORD_AT_ID","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"array","items":{}},"recordIdx":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recordId":{"type":["string","number"]},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["record"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove records {recordIdxs: [...]} or {recordIds: [...]} or {all: true}","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_RECORDS, REMOVE_RECORD_ID, CLEAR_RECORDS","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recordIdxs":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"recordIds":{"type":"array","items":{"type":["string","number"]}},"all":{"type":"boolean"}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/records/many":{"post":{"summary":"bulk create: body = [[...], ...] or {records, dupBehavior?}; > 50k rows runs as a job (202 {jobId})","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_RECORDS, CREATE_MANY","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"array","items":{}}},{"type":"object","properties":{"records":{"type":"array","items":{"type":"array","items":{}}},"dupBehavior":{"type":"string"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["records"],"additionalProperties":false}]}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/records/sort":{"post":{"summary":"physically sort the table {dimId, isAscending?}","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: SORT_TABLE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dimId":{"type":"string"},"isAscending":{"type":"boolean"}},"required":["dimId"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/records/{id}":{"get":{"summary":"one record by id (rendered cells)","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CALCULATE (recordIds)","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"patch":{"summary":"update a record {record: [...]} (whole row) or {values: {dimId: value}}","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_RECORD, SET_VALUES_BY_ID","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"record":{"type":"array","items":{}},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove a record by id","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_RECORD_ID","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/records/{id}/move":{"post":{"summary":"move a record {destIdx, before?: true}","tags":["records"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: MOVE_RECORD_BEFORE, MOVE_RECORD_AFTER","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destIdx":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"before":{"type":"boolean"}},"required":["destIdx"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/cells":{"put":{"summary":"write cells: {values:[{dimId, recordIdx|recordId, value}]} | {values:[{r,c,value}], req?, dimId?} (visible coordinates) | {copy: 'down'|'right', startRow, endRow, startCol, endCol, req?} | {dimId, req} (SET_DIM_VALUES) | {dimId, searchValue, replaceValue} | {dimId, selectedCondition}","tags":["cells"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: SET_VALUE, SET_VALUES, SET_VALUES_BY_ID, SET_TABULAR_VALUES_RC, SET_PIVOT_VALUES_RC, COPY_DOWN_PIVOT, COPY_RIGHT_PIVOT, SET_DIM_VALUES, REPLACE_DIM_VALUES, SET_PIVOT_CONDITION_VALUES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"unset cells {dimId, recordIdx} | {dimId, req} (UNSET_DIM_VALUES)","tags":["cells"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UNSET_VALUE, UNSET_DIM_VALUES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dimId":{"type":"string"},"recordIdx":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"req":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["dimId"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/cells/explain":{"post":{"summary":"EXPLAIN one cell {dimId, recordId|recordIdx|coords}","tags":["cells"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: EXPLAIN_CELL","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dimId":{"type":"string"},"recordIdx":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recordId":{"type":["string","number"]},"coords":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number"]}}},"required":["dimId"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/recompute":{"post":{"summary":"RECALCULATE_TABLE: evaluate a manual table's stale nodes and volatile cells","tags":["cells"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: RECALCULATE_TABLE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/methods":{"get":{"summary":"list methods","tags":["methods"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a method {name, dimId, condition?, formula}","tags":["methods"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_METHOD","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"dimId":{"type":"string"},"condition":{"type":"array","items":{"type":"object","properties":{"join":{"type":"string"},"left":{"type":"string"},"comparison":{"type":"string"},"right":{}},"required":["left","comparison","right"],"additionalProperties":false}},"formula":{"type":"string"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","dimId","formula"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/methods/{idx}":{"patch":{"summary":"update a method","tags":["methods"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_METHOD","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"idx","in":"path","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"dimId":{"type":"string"},"condition":{"type":"array","items":{"type":"object","properties":{"join":{"type":"string"},"left":{"type":"string"},"comparison":{"type":"string"},"right":{}},"required":["left","comparison","right"],"additionalProperties":false}},"formula":{"type":"string"},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["name","dimId","formula"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove a method","tags":["methods"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_METHOD","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"idx","in":"path","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/methods/{idx}/move":{"post":{"summary":"move a method {destIdx}","tags":["methods"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: MOVE_METHOD","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"idx","in":"path","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destIdx":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["destIdx"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/cond-objs":{"get":{"summary":"list cond_objs","tags":["cond-objs"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a cond_obj {type, name, dimId, condition?, data?, dashboard?, ...}","tags":["cond-objs"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_COND_OBJ","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/cond-objs/{idx}":{"patch":{"summary":"update a cond_obj","tags":["cond-objs"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_COND_OBJ","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"idx","in":"path","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove a cond_obj","tags":["cond-objs"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_COND_OBJ","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"idx","in":"path","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/cond-objs/{idx}/move":{"post":{"summary":"move a cond_obj {destIdx}","tags":["cond-objs"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: MOVE_COND_OBJ","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"idx","in":"path","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destIdx":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["destIdx"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/indexes":{"get":{"summary":"list index hints","tags":["indexes"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: FETCH_INDEXES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create an index hint {dimIds}","tags":["indexes"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_INDEXES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dimIds":{"type":"array","items":{"type":"string"}}},"required":["dimIds"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove an index hint {idx}","tags":["indexes"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_INDEXES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"idx":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["idx"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/indexes/{idx}":{"delete":{"summary":"remove an index hint","tags":["indexes"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_INDEXES, DELETE_INDEXES","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"idx","in":"path","required":true,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/views":{"get":{"summary":"list saved views","tags":["views"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"post":{"summary":"create a saved view {id, name?, isDefault?, spec, columnWidths?, frozenColumns?}","tags":["views"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CREATE_VIEW","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"columnWidths":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"frozenColumns":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","spec"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/views/{v}":{"get":{"summary":"one saved view","tags":["views"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"v","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]},"patch":{"summary":"update a saved view","tags":["views"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: UPDATE_VIEW","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"v","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"spec":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"columnWidths":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"frozenColumns":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]},"delete":{"summary":"remove a saved view","tags":["views"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: REMOVE_VIEW","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}},{"name":"v","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/models/{m}/tables/{t}/render":{"post":{"summary":"render one request on one table (body = tabular | pivot | groupedPivot | uniqueValues | recordIds request, or {viewId, ...overrides})","tags":["render"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CALCULATE, OUTPUT","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"m","in":"path","required":true,"schema":{"type":"string"}},{"name":"t","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["tabular","pivot","groupedPivot","uniqueValues","recordIds"]},"viewId":{"type":"string"}},"additionalProperties":{}}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/render":{"post":{"summary":"multi-table visibleReq in the legacy envelope {populateAllModels?, populateAllTables?, models: {...}}","tags":["render"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: CALCULATE","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"models":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"populateAllModels":{"type":"boolean"},"populateAllTables":{"type":"boolean"}},"required":["models"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/commands":{"post":{"summary":"atomic batch: body = [{type, data}, ...] or {commands, render?}; `type` accepts legacy names with or without the socket/ prefix","tags":["commands"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"render","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type"],"additionalProperties":false}},{"type":"object","properties":{"commands":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["type"],"additionalProperties":false}},"render":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["commands"],"additionalProperties":false}]}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/formulas/parse":{"post":{"summary":"parse + bind a formula without saving: {formula} → diagnostics and read set","tags":["formulas"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"formula":{"type":"string"},"modelId":{"type":"string"},"tableId":{"type":"string"},"dimId":{"type":"string"}},"required":["formula"],"additionalProperties":false}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/events":{"get":{"summary":"SSE change feed: change / structure / progress events with seq; ?tables=m:t1,m:t2 filters","tags":["events"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"tables","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/import/csv":{"post":{"summary":"import CSV (body text/csv; ?model=&table=&types=id:string,amount:number&dupBehavior=); the table and typed dims are created when missing","tags":["import-export"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"model","in":"query","required":true,"schema":{"type":"string"}},{"name":"table","in":"query","required":true,"schema":{"type":"string"}},{"name":"types","in":"query","required":false,"schema":{"type":"string"}},{"name":"dupBehavior","in":"query","required":false,"schema":{"type":"string"}},{"name":"header","in":"query","required":false,"schema":{"type":"string"}},{"name":"delimiter","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"text/csv":{"schema":{"type":"string"}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/export/csv":{"get":{"summary":"export a table as CSV (?model=&table=)","tags":["import-export"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"model","in":"query","required":true,"schema":{"type":"string"}},{"name":"table","in":"query","required":true,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/import/xlsx":{"post":{"summary":"import a workbook (body = xlsx bytes; ?model=; one table per sheet, or ?table= for the first sheet; values only)","tags":["import-export"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"model","in":"query","required":true,"schema":{"type":"string"}},{"name":"table","in":"query","required":false,"schema":{"type":"string"}},{"name":"types","in":"query","required":false,"schema":{"type":"string"}},{"name":"dupBehavior","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"text/csv":{"schema":{"type":"string"}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/export/xlsx":{"get":{"summary":"export a workbook: one sheet per table (values + formats) and per pivot (rendered grid); ?model= limits to one model","tags":["import-export"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"model","in":"query","required":false,"schema":{"type":"string"}},{"name":"table","in":"query","required":false,"schema":{"type":"string"}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/export/script":{"get":{"summary":"the replayable command list [{type, data}, ...] (legacy GET_FINAL_STATE_FTL); ?format=model for the declarative model script","tags":["import-export"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: GET_FINAL_STATE_FTL","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["commands","model"]}}],"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/import/script":{"post":{"summary":"replay a command list (JSON array; legacy FTL / socket action lists accepted, unsupported actions reported) atomically","tags":["import-export"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: FTL import","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},{"type":"object","properties":{"commands":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"legacy":{"type":"boolean"}},"required":["commands"],"additionalProperties":false}]}}}},"security":[{"basic":[]},{"bearer":[]}]}},"/v1/db/{db}/apply":{"post":{"summary":"apply a model script {models, tables, methods, data} (JSON or YAML body): idempotent create-or-update with a diff; ?prune=1 removes what the script omits; ?dryRun=1 plans only","tags":["import-export"],"responses":{"200":{"description":"OK"},"400":{"description":"invalid request: {error: {code, message, hint?, legacyCode?}}"}},"description":"Legacy actions: D-38","parameters":[{"name":"db","in":"path","required":true,"schema":{"type":"string"}},{"name":"prune","in":"query","required":false,"schema":{"type":"string"}},{"name":"dryRun","in":"query","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"text/csv":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"security":[{"basic":[]},{"bearer":[]}]}}}}