Kater API
Kater API
The Kater API is what Kater promises to your code and your agents: find what the data team built, read its numbers, learn what each metric means, keep definitions in step with your other tools, and read what people asked. Every call acts as the signed-in person, with that person’s access.
Authentication
Send the access token of a signed-in person: Authorization: Bearer <token>. Run kater login once to get one. The token expires, so a job that runs with nobody signed in, such as a CI pipeline, cannot use the API yet. Some routes also need a permission, which their description names.
export KATER_API_URL="URL"export KATER_API_TOKEN="TOKEN"Stability
A stable route changes only by adding: a route, an optional field, an answer field or an error code. A route marked Beta can change, after a changelog entry 30 days before. A route that goes is first marked Deprecated with the day it goes: six months ahead for a stable route, 30 days for a beta one.
Usage
Start with the connections. Each other route takes a connection's name, or a path in it.
curl "$KATER_API_URL/v1/connection/list" \ -H "Authorization: Bearer $KATER_API_TOKEN"JSON in and out. Every failure answers one error body, with <code>error</code>, <code>code</code> and <code>request_id</code>. OpenAPI 3.1.0, version 1.0.0 of the Kater API: 24 routes.
Who you are
Check a token, and read the permissions of the person it signs in.
/v1/me/access Read the caller's permissions, groups and attributes
Reads who the caller is: their organisation, their user, their permissions, their groups and their attributes. Use it to check a token, and to learn what the caller may do before other requests.
Response
Request
curl -X GET "$KATER_API_URL/v1/me/access" \ -H "Authorization: Bearer $KATER_API_TOKEN"Response
{ "organizationId": "string", "user": { "id": "string", "email": "string", "firstName": "string", "lastName": "string", "role": "string", "avatarColor": "string" }, "permissions": [ "string" ], "attributes": {}, "groups": [ { "id": "grp_1a2b3c4d", "name": "finance", "attributes": { "department": [ "Finance" ] }, "followsRole": "string" } ], "directoryAvailable": true}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}Find what the data team built
List the connections, then the workspaces, queries, dashboards and apps in each one.
/v1/connection/list List the connections
Lists the organisation's connections that the caller can read. A connection is one warehouse and the models that the data team built on it. Use a connection's name in every other request that takes connection or a namespace.
Request Parameters
Response
"error""warning""info""hint" Request
curl -X GET "$KATER_API_URL/v1/connection/list" \ -H "Authorization: Bearer $KATER_API_TOKEN"Response
{ "connections": [ { "connection": "string", "label": "string", "warehouse_type": "string", "database_count": 0, "schema_count": 0, "diagnostics": [ { "code": "string", "message": "string", "severity": "error", "range": { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 } } } ] } ]}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}/v1/connection/read Read one connection
Reads one connection's settings, as its file saves them, and whether the organisation stored a warehouse credential for it. A connection without a credential cannot run a query.
Request Parameters
Response
"username_password""key_pair" "error""warning""info""hint" Request
curl -X GET "$KATER_API_URL/v1/connection/read?connection=<connection>" \ -H "Authorization: Bearer $KATER_API_TOKEN"Response
{ "connection": { "id": "string", "name": "string", "warehouse_metadata": { "warehouse_type": "string", "auth_method": "username_password", "snowflake_account_id": "string", "warehouse": "string", "role": "string" }, "label": "string", "description": "string", "databases": [ { "db__database": "string", "name": "string", "label": "string", "description": "string", "timezone": "string", "schemas": [ { "db__schema": "string", "name": "string", "label": "string", "description": "string", "tables": [ "string" ], "exclude_tables": [ "string" ] } ] } ], "query_timezone_conversion": "string", "query_timeout": 0 }, "path": "string", "revision": "string", "warehouse_credential": { "present": true }, "diagnostics": [ { "code": "string", "message": "string", "severity": "error", "range": { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 } } } ]}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}/v1/workspace/browse List the caller's workspaces in a connection, one page at a time
Lists the workspaces of one connection that the caller can open. show keeps the connection's own workspaces, the caller's own or the ones shared with the caller. Read the next page with the answer's nextCursor.
Request Parameters
"all""mine""shared" Response
"mine""shared""others" Request
curl -X GET "$KATER_API_URL/v1/workspace/browse?connection=<connection>" \ -H "Authorization: Bearer $KATER_API_TOKEN"Response
{ "items": [ { "ownership": "mine", "owner": "string", "ownerProfile": { "name": "string", "pictureUrl": "string", "id": "string", "avatarColor": "string" }, "openedAt": "string", "pinnedAt": "string", "changedAt": "string", "recentAt": "string", "path": "string", "name": "string", "label": "string", "description": "string", "canWrite": true } ], "nextCursor": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}/v1/query/list List the queries of a workspace
Lists the queries of one workspace, with the fields that each one shows, and the workspace's own filters and tiles. A query is named by its workspace's path and its own name. Read a query's rows with POST /v1/result/resolve or POST /v1/run.
Request Parameters
Response
Request
curl -X POST "$KATER_API_URL/v1/query/list" \ -H "Authorization: Bearer $KATER_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "namespace": { "kind": "string", "path": "string" }}'Response
{ "queries": [ { "query": { "name": "string", "model_type": "string", "namespace": { "kind": "string", "path": "string" } }, "id": "string", "name": "string", "path": "string", "ordinal": 0, "label": "string", "copied_from": { "query": { "name": "string", "model_type": "string", "namespace": { "kind": "string", "path": "string" } }, "path": "string", "label": "string" }, "revision": "string", "selection": { "start": { "line": 0, "character": 0 }, "end": { "line": 0, "character": 0 } }, "charts": 0, "empty": true, "sql_only": true } ], "diagnostics": [ "string" ], "workspace_revision": "string", "label": "string", "layer": "string", "filters": [ "string" ], "tiles": 0, "reads_model": true, "moved_to": "string", "renamed": {}, "moved": {}}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}/v1/dashboard/open Open a workspace's dashboard
Reads a workspace's dashboard: its tiles, its filters and the queries and charts that the tiles show. It does not run the queries. Read their rows with POST /v1/result/resolve or POST /v1/run.
Request Parameters
Response
"error""warning" "contract""operations""realtime""transactions" "scalar""json_array" "db_dataset""kater_dataset""workspace""semantic""query""chart""test""scratch""local" Request
curl -X POST "$KATER_API_URL/v1/dashboard/open" \ -H "Authorization: Bearer $KATER_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "namespace": { "kind": "string", "path": "string" }, "include_inputs": true, "scaffold": true}'Response
{ "namespace": { "kind": "string", "path": "string" }, "path": "string", "revision": "string", "saved": true, "scaffolded": true, "can_write": true, "file": {}, "problems": [ { "severity": "error", "message": "string", "at": "string", "code": "cards-cut-off", "chart": "string" } ], "dashboard": { "template": "contract", "title": "string", "description": "string", "headline": { "chart": "string", "text": "string", "card": true, "empty": true, "region": "kpis", "position": 0, "tab": "string", "section": "string", "x": 0, "span": 0, "height": 0, "sizes_to_content": true, "kind": "string", "label": "string", "available": true, "problem": "string", "definition": { "path": "string", "revision": "string", "spec": {}, "sql": "string", "formats": {} } }, "takeaways": [ { "position": 0, "insight": "string", "query": "string", "columns": {}, "parameters": {}, "label": "string", "available": true, "problem": "string" } ], "hidden_takeaways": [ { "insight": "string", "query": "string" } ], "tabs": [ { "name": "string", "label": "string", "index": 0 } ], "sections": [ { "name": "string", "label": "string", "index": 0 } ], "regions": {}, "single_tile_regions": [ "kpis" ], "full_width": true, "filters": [ "string" ], "theme": "string", "rail_width": "narrow", "sticky_rail": true, "refresh_seconds": 0 }, "inputs": { "parameters": [ { "definition": { "name": "string", "default_value": null, "label": "string", "description": "string", "ai_context": "string", "kater_data_type": "string", "subtype": "single_value", "relative": true, "allowed_values": { "from_field": { "ref": "string", "limit": 0 }, "from_list": [ null ] }, "min": { "from_value": null, "from_field": { "ref": "string" } }, "max": { "from_value": null, "from_field": { "ref": "string" } }, "fields": [ { "name": "string", "default_value": null, "label": "string", "description": "string", "ai_context": "string", "kater_data_type": "string", "subtype": "single_value", "relative": true, "allowed_values": { "from_field": { "ref": "string", "limit": 0 }, "from_list": [ null ] }, "min": { "from_value": null, "from_field": { "ref": "string" } }, "max": { "from_value": null, "from_field": { "ref": "string" } }, "fields": [ { "name": "string", "default_value": null, "label": "string", "description": "string", "ai_context": "string", "kater_data_type": "string", "subtype": "single_value", "relative": true, "allowed_values": { "from_field": { "ref": null, "limit": null }, "from_list": [ null ] }, "min": { "from_value": null, "from_field": { "ref": null } }, "max": { "from_value": null, "from_field": { "ref": null } }, "fields": [ { "name": null, "default_value": null, "label": null, "description": null, "ai_context": null, "kater_data_type": null, "subtype": null, "relative": null, "allowed_values": null, "min": null, "max": null, "fields": null } ] } ] } ] }, "position": 0, "db_data_type": "string", "encoding": "scalar", "required": true, "control": "string" } ], "filters": [ { "name": "string", "label": "string", "description": "string", "ai_context": "string", "required": true, "activation_position": 0, "parameters": [ "string" ], "owners": [ { "name": "string", "model_type": "db_dataset" } ] } ] }, "charts": [ "string" ], "saved_charts": [ { "chart": "string", "label": "string", "kind": "string", "path": "string", "query": "string", "query_label": "string", "spec": {} } ], "queries": [ { "query": "string", "label": "string", "path": "string", "id": "string" } ], "workspace_model": { "path": "string", "name": "string", "revision": "string" }}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}{ "error": "string", "code": "string", "diagnostics": [ null ], "request_id": "string", "error_reference": "string", "warehouse": { "warehouse_type": "string", "label": "string", "code": "string", "sqlstate": "string", "query_id": "string", "message": "string" }, "compiled_sql": "string"}List the caller's apps in a connection, one page at a time
GET /v1/app/browse
Lists the apps of one connection that the caller can open. `show` keeps the connection's own apps, the caller's own or the ones shared with the caller. Read the next page with the answer's `nextCursor`.
Read the numbers
Read a query’s rows from the result Kater keeps, or run it when no result is kept.
Find the kept result of a request, or start its run
POST /v1/result/resolve
Finds the kept result of one query with its inputs, or starts a job that runs it. `ready` answers the result to read with `GET /v1/result/read`. `pending` answers a job to wait for with `GET /v1/result/job/read`. With `freshness: require_fresh`, a result that is out of date is run again. With `run: false`, it never runs the query and answers `missing` when no result is kept. Use it to read a saved query's rows. Use `POST /v1/run` to run several files at once.
Read the state of a result job
GET /v1/result/job/read
Reads the state of a result job that `POST /v1/result/resolve` started. With `wait_ms`, it waits up to that time for the job to end. When the status is `ready`, read the rows with `GET /v1/result/read` and the answer's `result.id`.
Read rows of a kept result
GET /v1/result/read
Reads one page of rows of a kept result, with its columns. Each row holds its values by `columns[].name`. Read the next page from `next_offset`. With `rows_only`, the answer holds the rows alone, which is faster for each page after the first.
Stop a result job
POST /v1/result/job/cancel
Tells Kater that the caller no longer waits for a result job. The warehouse query stops when nobody else waits for it. Send the `job_id` and `interest_id` that `POST /v1/result/resolve` answered.
Run the selected queries
POST /v1/run
Runs the queries of the files that `selector` names and answers each one's first rows. A query whose rows another person already ran with the same inputs answers from the kept result, unless `fresh` is set. A query that takes longer than `wait_ms` answers `pending`: read its rows later with `POST /v1/result/resolve`. To read one saved query's rows, `POST /v1/result/resolve` is faster.
What a metric means
Search the catalog, and explain how a field gets its value.
Read the catalog: its scopes, its models or their fields
POST /v1/catalog
Reads what the data team built. `action` selects the answer: `scopes` lists the connections and their layers, `models` lists the models that `selector` names, `show` reads one model with its fields, and `search` finds models and fields by their words, labels and descriptions. Set `fields` to also get each model's fields. To learn how one field gets its value, use `POST /v1/catalog/explain`.
Explain how a field gets its value
POST /v1/catalog/explain
Explains how a field of a model gets its value: its formula, the fields and models it reads, its filters and its grain. Leave `field` out to explain every field of the model, measures first. With `result_id`, it explains the field as one query run produced it.
Keep definitions in step
Read and save the files that define the models, compile them, and sync them with the warehouse.
Read a text file as it is saved
GET /v1/source/read
Reads one file of the organisation's content, such as a model's SQL or a workspace's file, by its path under the content root. The answer's `revision` is what `POST /v1/source/write` takes as `expected_revision`, so a save never replaces a change that the caller did not read.
Save a whole file
POST /v1/source/write
Saves the whole text of one file. A Kater SQL file is formatted and compiled first, and a file that does not compile is refused with the compiler's errors. Send the `revision` that `GET /v1/source/read` answered as `expected_revision`: when the file changed since, the save is refused.
Compile the selected files
POST /v1/compile
Compiles the files that `selector` names and answers each file's status and diagnostics, without running a query on the warehouse. With `wait_for_apps`, it also waits for the checks of the apps and dashboards that the files reach. With `format`, it first formats each file and saves it. A long compile answers `pending`: read it again with the same request.
Sync the database models and the Kater datasets of a connection
POST /v1/sync/all
Reads the warehouse's tables of one connection and writes their models, then the Kater datasets that read them. `mode: dry_run` answers what would change and saves nothing. `mode: check` fails when anything would change. Needs the `settings:manage` permission.
Read the state of a connection's sync
POST /v1/sync/status
Reads when each sync of a connection last succeeded. A null time means that the sync never succeeded.
What people asked
Read the questions people asked Kater, each conversation, and the logs.
Read the themes of the questions people ask
GET /v1/admin/questions
Reads the themes of the questions that people in the organisation asked Kater in the window: how many, how that changed from the window before, the hours they ask at and the questions Kater could not answer. Needs the `audit:read` permission.
List the conversations people had with Kater
GET /v1/admin/conversations
Lists the conversations that people in the organisation had with Kater in the window, one page at a time. Keep some of them by their words, person, topic or status. Read the next page with the answer's `next`. Needs the `audit:read` permission.
Read one conversation's questions and calls
GET /v1/admin/conversations/{thread}
Reads one conversation: each question, what Kater answered, the calls Kater made to answer it and the objects it made. Needs the `audit:read` permission.
Read the logs, one page at a time
GET /v1/logs/query
Reads Kater's log events that the caller may read, one page at a time. Filter by level, words, time, path or request ID. To find the events of one failed request, send the request ID that its answer named. Read the next page with the answer's `cursor`.
Run an audit query on the logs
POST /v1/logs/audit
Runs one of Kater's audit queries on the organisation's logs and answers its rows, one page at a time. `template_name` selects the query, such as `recent_threads` or `slow_calls`. Read the next page with the answer's `next_cursor`. Needs the `audit:read` permission.