{ "openapi": "3.1.0", "info": { "title": "UI Router API", "description": "Defines the specification for the UI Catalog API", "contact": { "name": "Embucket, Inc.", "url": "https://embucket.com" }, "license": { "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, "version": "1.0.2" }, "paths": { "/ui/auth/account": { "get": { "tags": ["account"], "operationId": "getAccount", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AccountResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthErrorResponse" } } } } } } }, "/ui/auth/login": { "post": { "tags": ["auth"], "operationId": "login", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LoginPayload" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthErrorResponse" } } } } } } }, "/ui/auth/logout": { "post": { "tags": ["auth"], "operationId": "logout", "responses": { "200": { "description": "Successful Response" }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthErrorResponse" } } } } } } }, "/ui/auth/refresh": { "post": { "tags": ["auth"], "operationId": "refreshAuthToken", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AuthErrorResponse" } } } } } } }, "/ui/dashboard": { "get": { "tags": ["dashboard"], "operationId": "getDashboard", "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DashboardResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases": { "get": { "tags": ["databases"], "operationId": "getDatabases", "parameters": [ { "name": "offset", "in": "query", "description": "Databases offset", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Databases limit", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "search", "in": "query", "description": "Databases search", "required": false, "schema": { "type": "string" } }, { "name": "orderBy", "in": "query", "description": "Order by: database_name, volume_name, created_at (default), updated_at", "required": false, "schema": { "type": "string" } }, { "name": "orderDirection", "in": "query", "description": "Order direction: ASC, DESC (default)", "required": false, "schema": { "$ref": "#/components/schemas/OrderDirection" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabasesResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["databases"], "operationId": "createDatabase", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseCreatePayload" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseCreateResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Already Exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases/{databaseName}": { "get": { "tags": ["databases"], "operationId": "getDatabase", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DatabaseResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["databases"], "operationId": "deleteDatabase", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful Response" }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases/{databaseName}/schemas": { "get": { "tags": ["schemas"], "operationId": "getSchemas", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } }, { "name": "offset", "in": "query", "description": "Schemas offset", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Schemas limit", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "search", "in": "query", "description": "Schemas search", "required": false, "schema": { "type": "string" } }, { "name": "orderBy", "in": "query", "description": "Order by: schema_name, database_name, created_at (default), updated_at", "required": false, "schema": { "type": "string" } }, { "name": "orderDirection", "in": "query", "description": "Order direction: ASC, DESC (default)", "required": false, "schema": { "$ref": "#/components/schemas/OrderDirection" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SchemasResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["schemas"], "operationId": "createSchema", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SchemaCreatePayload" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SchemaCreateResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases/{databaseName}/schemas/{schemaName}": { "delete": { "tags": ["schemas"], "operationId": "deleteSchema", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } }, { "name": "schemaName", "in": "path", "description": "Schema Name", "required": true, "schema": { "type": "string" } } ], "responses": { "204": { "description": "Successful Response" }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Schema not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases/{databaseName}/schemas/{schemaName}/tables": { "get": { "tags": ["tables"], "operationId": "getTables", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } }, { "name": "schemaName", "in": "path", "description": "Schema Name", "required": true, "schema": { "type": "string" } }, { "name": "offset", "in": "query", "description": "Tables offset", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Tables limit", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "search", "in": "query", "description": "Tables search", "required": false, "schema": { "type": "string" } }, { "name": "orderBy", "in": "query", "description": "Order by: table_name, schema_name, database_name, volume_name, table_type, table_format, owner, created_at (default), updated_at", "required": false, "schema": { "type": "string" } }, { "name": "orderDirection", "in": "query", "description": "Order direction: ASC, DESC (default)", "required": false, "schema": { "$ref": "#/components/schemas/OrderDirection" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TablesResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Table not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns": { "get": { "tags": ["tables"], "operationId": "getTableColumns", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } }, { "name": "schemaName", "in": "path", "description": "Schema Name", "required": true, "schema": { "type": "string" } }, { "name": "tableName", "in": "path", "description": "Table Name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableColumnsResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Table not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/rows": { "get": { "tags": ["tables"], "operationId": "getTablePreviewData", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } }, { "name": "schemaName", "in": "path", "description": "Schema Name", "required": true, "schema": { "type": "string" } }, { "name": "tableName", "in": "path", "description": "Table Name", "required": true, "schema": { "type": "string" } }, { "name": "offset", "in": "query", "description": "Table preview offset", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Table preview limit", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TablePreviewDataResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Table not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["tables"], "operationId": "uploadFile", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } }, { "name": "schemaName", "in": "path", "description": "Schema Name", "required": true, "schema": { "type": "string" } }, { "name": "tableName", "in": "path", "description": "Table Name", "required": true, "schema": { "type": "string" } }, { "name": "header", "in": "query", "description": "Has header", "required": false, "schema": { "type": "boolean" }, "example": true }, { "name": "delimiter", "in": "query", "description": "an optional column delimiter, defaults to comma `','`", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "escape", "in": "query", "description": "an escape character", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "quote", "in": "query", "description": "a custom quote character, defaults to double quote `'\"'`", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "terminator", "in": "query", "description": "a custom terminator character, defaults to CRLF", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } }, { "name": "comment", "in": "query", "description": "a comment character", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } } ], "requestBody": { "description": "Upload data to the table in multipart/form-data format", "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/TableUploadPayload" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableUploadResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable content", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics": { "get": { "tags": ["tables"], "operationId": "getTableStatistics", "parameters": [ { "name": "databaseName", "in": "path", "description": "Database Name", "required": true, "schema": { "type": "string" } }, { "name": "schemaName", "in": "path", "description": "Schema Name", "required": true, "schema": { "type": "string" } }, { "name": "tableName", "in": "path", "description": "Table Name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TableStatisticsResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Table not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/navigation-trees": { "get": { "tags": ["navigation-trees"], "operationId": "getNavigationTrees", "parameters": [ { "name": "offset", "in": "query", "description": "Navigation trees offset", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Navigation trees limit", "required": false, "schema": { "type": "integer", "format": "int32", "minimum": 0 } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NavigationTreesResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/queries": { "get": { "tags": ["queries"], "operationId": "getQueries", "parameters": [ { "name": "minDurationMs", "in": "query", "description": "Minimal duration of queries in milliseconds", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "worksheetId", "in": "query", "description": "Worksheet id of the queries", "required": false, "schema": { "$ref": "#/components/schemas/i64" } }, { "name": "offset", "in": "query", "description": "Queries offset", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Queries limit", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "search", "in": "query", "description": "Queries search", "required": false, "schema": { "type": "string" } }, { "name": "orderBy", "in": "query", "description": "Order by: id, worksheet_id, result_count, status, start_time (default), end_time, duration_ms", "required": false, "schema": { "type": "string" } }, { "name": "orderDirection", "in": "query", "description": "Order direction: ASC, DESC (default)", "required": false, "schema": { "$ref": "#/components/schemas/OrderDirection" } } ], "responses": { "200": { "description": "Returns queries history", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueriesResponse" } } } }, "400": { "description": "Bad worksheet key", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["queries"], "operationId": "createQuery", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryCreatePayload" }, "examples": { "with context": { "value": { "worksheetId": null, "query": "CREATE TABLE test(a INT);", "context": { "database": "my_database", "schema": "public" } } }, "with fully qualified name": { "value": { "worksheetId": null, "query": "CREATE TABLE my_database.public.test(a INT);", "context": null } } } } }, "required": true }, "responses": { "200": { "description": "Returns result of the query", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryCreateResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/queries/{queryRecordId}": { "get": { "tags": ["queries"], "operationId": "getQuery", "parameters": [ { "name": "queryRecordId", "in": "path", "description": "Query Record Id", "required": true, "schema": { "$ref": "#/components/schemas/i64" } } ], "responses": { "200": { "description": "Returns result of the query", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QueryGetResponse" } } } }, "400": { "description": "Bad query record id", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/volumes": { "get": { "tags": ["volumes"], "operationId": "getVolumes", "parameters": [ { "name": "offset", "in": "query", "description": "Volumes offset", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Volumes limit", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "search", "in": "query", "description": "Volumes search", "required": false, "schema": { "type": "string" } }, { "name": "orderBy", "in": "query", "description": "Order by: volume_name, volume_type, created_at (default), updated_at", "required": false, "schema": { "type": "string" } }, { "name": "orderDirection", "in": "query", "description": "Order direction: ASC, DESC (default)", "required": false, "schema": { "$ref": "#/components/schemas/OrderDirection" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VolumesResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["volumes"], "operationId": "createVolume", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VolumeCreatePayload" } } }, "required": true }, "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VolumeCreateResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/volumes/{volumeName}": { "get": { "tags": ["volumes"], "operationId": "getVolume", "parameters": [ { "name": "volumeName", "in": "path", "description": "Volume name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful Response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/VolumeResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["volumes"], "operationId": "deleteVolume", "parameters": [ { "name": "volumeName", "in": "path", "description": "Volume name", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Successful Response" }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable entity", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/worksheets": { "get": { "tags": ["worksheets"], "operationId": "getWorksheets", "parameters": [ { "name": "offset", "in": "query", "description": "Worksheets offset", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "limit", "in": "query", "description": "Worksheets limit", "required": false, "schema": { "type": "integer", "minimum": 0 } }, { "name": "search", "in": "query", "description": "Worksheets search", "required": false, "schema": { "type": "string" } }, { "name": "orderBy", "in": "query", "description": "Order by: id, name, content, created_at (default), updated_at", "required": false, "schema": { "type": "string" } }, { "name": "orderDirection", "in": "query", "description": "Order direction: ASC, DESC (default)", "required": false, "schema": { "$ref": "#/components/schemas/OrderDirection" } } ], "responses": { "200": { "description": "Get list of worksheets", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorksheetsResponse" } } } }, "400": { "description": "Unknown", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "tags": ["worksheets"], "operationId": "createWorksheet", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorksheetCreatePayload" }, "examples": { "empty name": { "value": { "name": "", "content": "select 1" } }, "with name": { "value": { "name": "worksheet1", "content": "select 1" } } } } }, "required": true }, "responses": { "200": { "description": "Created worksheet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorksheetCreateResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "409": { "description": "Already Exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "422": { "description": "Unprocessable Entity" }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/ui/worksheets/{worksheetId}": { "get": { "tags": ["worksheets"], "operationId": "getWorksheet", "parameters": [ { "name": "worksheetId", "in": "path", "description": "Worksheet id", "required": true, "schema": { "$ref": "#/components/schemas/i64" } } ], "responses": { "200": { "description": "Returns worksheet", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorksheetResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Worksheet not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "tags": ["worksheets"], "operationId": "deleteWorksheet", "parameters": [ { "name": "worksheetId", "in": "path", "description": "Worksheet id", "required": true, "schema": { "$ref": "#/components/schemas/i64" } } ], "responses": { "200": { "description": "Worksheet deleted" }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Worksheet not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "patch": { "tags": ["worksheets"], "operationId": "updateWorksheet", "parameters": [ { "name": "worksheetId", "in": "path", "description": "Worksheet id", "required": true, "schema": { "$ref": "#/components/schemas/i64" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WorksheetUpdatePayload" }, "examples": { "rename": { "value": { "name": "new-worksheet" } }, "update content": { "value": { "content": "SELECT * from test;" } } } } }, "required": true }, "responses": { "200": { "description": "Worksheet updated" }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "headers": { "WWW-Authenticate": { "schema": { "type": "string" }, "description": "Bearer authentication scheme with error details" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "404": { "description": "Worksheet not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "500": { "description": "Internal server error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "schemas": { "AccountResponse": { "type": "object", "required": ["username"], "properties": { "username": { "type": "string" } } }, "AuthErrorResponse": { "type": "object", "required": ["message", "statusCode"], "properties": { "errorKind": { "oneOf": [{ "type": "null" }, { "$ref": "#/components/schemas/TokenErrorKind" }] }, "message": { "type": "string" }, "statusCode": { "type": "integer", "format": "int32", "minimum": 0 } } }, "AuthResponse": { "type": "object", "required": ["accessToken", "tokenType", "expiresIn"], "properties": { "accessToken": { "type": "string" }, "expiresIn": { "type": "integer", "format": "int32", "minimum": 0 }, "tokenType": { "type": "string" } } }, "AwsAccessKeyCredentials": { "type": "object", "required": ["awsAccessKeyId", "awsSecretAccessKey"], "properties": { "awsAccessKeyId": { "type": "string" }, "awsSecretAccessKey": { "type": "string" } } }, "AwsCredentials": { "oneOf": [ { "type": "object", "required": ["accessKey"], "properties": { "accessKey": { "$ref": "#/components/schemas/AwsAccessKeyCredentials" } } }, { "type": "object", "required": ["token"], "properties": { "token": { "type": "string" } } } ] }, "Column": { "type": "object", "required": ["name", "type"], "properties": { "name": { "type": "string" }, "type": { "type": "string" } } }, "Dashboard": { "type": "object", "required": ["totalDatabases", "totalSchemas", "totalTables", "totalQueries"], "properties": { "totalDatabases": { "type": "integer", "minimum": 0 }, "totalQueries": { "type": "integer", "minimum": 0 }, "totalSchemas": { "type": "integer", "minimum": 0 }, "totalTables": { "type": "integer", "minimum": 0 } } }, "DashboardResponse": { "$ref": "#/components/schemas/Dashboard" }, "Database": { "type": "object", "required": ["name", "volume", "createdAt", "updatedAt"], "properties": { "createdAt": { "type": "string" }, "name": { "type": "string" }, "updatedAt": { "type": "string" }, "volume": { "type": "string" } } }, "DatabaseCreatePayload": { "type": "object", "required": ["name", "volume"], "properties": { "name": { "type": "string" }, "volume": { "type": "string" } } }, "DatabaseCreateResponse": { "$ref": "#/components/schemas/Database" }, "DatabaseResponse": { "$ref": "#/components/schemas/Database" }, "DatabasesResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Database" } } } }, "ErrorResponse": { "type": "object", "required": ["message", "statusCode"], "properties": { "message": { "type": "string" }, "statusCode": { "type": "integer", "format": "int32", "minimum": 0 } } }, "FileVolume": { "type": "object", "required": ["path"], "properties": { "path": { "type": "string" } } }, "LoginPayload": { "type": "object", "required": ["username", "password"], "properties": { "password": { "type": "string" }, "username": { "type": "string" } } }, "NavigationTreeDatabase": { "type": "object", "required": ["name", "schemas"], "properties": { "name": { "type": "string" }, "schemas": { "type": "array", "items": { "$ref": "#/components/schemas/NavigationTreeSchema" } } } }, "NavigationTreeSchema": { "type": "object", "required": ["name", "tables", "views"], "properties": { "name": { "type": "string" }, "tables": { "type": "array", "items": { "$ref": "#/components/schemas/NavigationTreeTable" } }, "views": { "type": "array", "items": { "$ref": "#/components/schemas/NavigationTreeTable" } } } }, "NavigationTreeTable": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string" } } }, "NavigationTreesResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/NavigationTreeDatabase" } } } }, "OrderDirection": { "type": "string", "enum": ["ASC", "DESC"] }, "QueriesResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/QueryRecord" } } } }, "QueryCreatePayload": { "type": "object", "required": ["query"], "properties": { "context": { "type": ["object", "null"], "additionalProperties": { "type": "string" }, "propertyNames": { "type": "string" } }, "query": { "type": "string" }, "worksheetId": { "oneOf": [{ "type": "null" }, { "$ref": "#/components/schemas/i64" }] } } }, "QueryCreateResponse": { "$ref": "#/components/schemas/QueryRecord" }, "QueryGetResponse": { "$ref": "#/components/schemas/QueryRecord" }, "QueryRecord": { "type": "object", "required": [ "id", "query", "startTime", "endTime", "durationMs", "resultCount", "result", "status", "error" ], "properties": { "durationMs": { "type": "integer", "format": "int64" }, "endTime": { "type": "string", "format": "date-time" }, "error": { "type": "string" }, "id": { "$ref": "#/components/schemas/i64" }, "query": { "type": "string" }, "result": { "$ref": "#/components/schemas/ResultSet" }, "resultCount": { "type": "integer", "format": "int64" }, "startTime": { "type": "string", "format": "date-time" }, "status": { "$ref": "#/components/schemas/QueryStatus" }, "worksheetId": { "oneOf": [{ "type": "null" }, { "$ref": "#/components/schemas/i64" }] } } }, "QueryStatus": { "type": "string", "enum": ["running", "successful", "failed", "canceled", "timedOut"] }, "RefreshTokenResponse": { "type": "object", "required": ["accessToken"], "properties": { "accessToken": { "type": "string" } } }, "ResultSet": { "type": "object", "required": ["columns", "rows"], "properties": { "columns": { "type": "array", "items": { "$ref": "#/components/schemas/Column" } }, "rows": { "type": "array", "items": { "$ref": "#/components/schemas/Row" } } } }, "Row": { "type": "array", "items": {} }, "S3TablesVolume": { "type": "object", "required": ["credentials", "arn"], "properties": { "arn": { "type": "string" }, "credentials": { "$ref": "#/components/schemas/AwsCredentials" }, "endpoint": { "type": ["string", "null"] } } }, "S3Volume": { "type": "object", "properties": { "bucket": { "type": ["string", "null"] }, "credentials": { "oneOf": [{ "type": "null" }, { "$ref": "#/components/schemas/AwsCredentials" }] }, "endpoint": { "type": ["string", "null"] }, "region": { "type": ["string", "null"] } } }, "Schema": { "type": "object", "required": ["name", "database", "createdAt", "updatedAt"], "properties": { "createdAt": { "type": "string" }, "database": { "type": "string" }, "name": { "type": "string" }, "updatedAt": { "type": "string" } } }, "SchemaCreatePayload": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string" } } }, "SchemaCreateResponse": { "$ref": "#/components/schemas/Schema" }, "SchemasResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Schema" } } } }, "Table": { "type": "object", "required": [ "name", "schemaName", "databaseName", "volumeName", "owner", "tableFormat", "type", "totalRows", "totalBytes", "createdAt", "updatedAt" ], "properties": { "createdAt": { "type": "string" }, "databaseName": { "type": "string" }, "name": { "type": "string" }, "owner": { "type": "string" }, "schemaName": { "type": "string" }, "tableFormat": { "type": "string" }, "totalBytes": { "type": "integer", "format": "int64" }, "totalRows": { "type": "integer", "format": "int64" }, "type": { "type": "string" }, "updatedAt": { "type": "string" }, "volumeName": { "type": "string" } } }, "TableColumn": { "type": "object", "required": ["name", "type", "description", "nullable", "default"], "properties": { "default": { "type": "string" }, "description": { "type": "string" }, "name": { "type": "string" }, "nullable": { "type": "string" }, "type": { "type": "string" } } }, "TableColumnsResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/TableColumn" } } } }, "TablePreviewDataColumn": { "type": "object", "required": ["name", "rows"], "properties": { "name": { "type": "string" }, "rows": { "type": "array", "items": { "$ref": "#/components/schemas/TablePreviewDataRow" } } } }, "TablePreviewDataParameters": { "type": "object", "properties": { "limit": { "type": ["integer", "null"], "format": "int32", "minimum": 0 }, "offset": { "type": ["integer", "null"], "format": "int32", "minimum": 0 } } }, "TablePreviewDataResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/TablePreviewDataColumn" } } } }, "TablePreviewDataRow": { "type": "object", "required": ["data"], "properties": { "data": { "type": "string" } } }, "TableStatistics": { "type": "object", "required": ["name", "totalRows", "totalBytes", "createdAt", "updatedAt"], "properties": { "createdAt": { "type": "string", "format": "date-time" }, "name": { "type": "string" }, "totalBytes": { "type": "integer", "format": "int64" }, "totalRows": { "type": "integer", "format": "int64" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "TableStatisticsResponse": { "$ref": "#/components/schemas/TableStatistics" }, "TableUploadPayload": { "type": "object", "required": ["uploadFile"], "properties": { "uploadFile": { "type": "string", "format": "binary" } } }, "TableUploadResponse": { "type": "object", "required": ["count", "durationMs"], "properties": { "count": { "type": "integer", "minimum": 0 }, "durationMs": { "type": "integer", "minimum": 0 } } }, "TablesResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Table" } } } }, "TokenErrorKind": { "type": "string", "enum": [ "invalidToken", "invalidSignature", "invalidEcdsaKey", "invalidRsaKey", "rsaFailedSigning", "invalidAlgorithmName", "invalidKeyFormat", "missingRequiredClaim", "expiredSignature", "invalidIssuer", "invalidAudience", "invalidSubject", "immatureSignature", "invalidAlgorithm", "missingAlgorithm", "other" ] }, "UploadParameters": { "type": "object", "properties": { "comment": { "type": ["integer", "null"], "format": "int32", "minimum": 0 }, "delimiter": { "type": ["integer", "null"], "format": "int32", "minimum": 0 }, "escape": { "type": ["integer", "null"], "format": "int32", "minimum": 0 }, "header": { "type": ["boolean", "null"] }, "quote": { "type": ["integer", "null"], "format": "int32", "minimum": 0 }, "terminator": { "type": ["integer", "null"], "format": "int32", "minimum": 0 } } }, "Volume": { "type": "object", "required": ["name", "type", "createdAt", "updatedAt"], "properties": { "createdAt": { "type": "string" }, "name": { "type": "string" }, "type": { "type": "string" }, "updatedAt": { "type": "string" } } }, "VolumeCreatePayload": { "allOf": [ { "$ref": "#/components/schemas/VolumeType" }, { "type": "object", "required": ["name"], "properties": { "name": { "type": "string" } } } ] }, "VolumeCreateResponse": { "$ref": "#/components/schemas/Volume" }, "VolumeResponse": { "$ref": "#/components/schemas/Volume" }, "VolumeType": { "oneOf": [ { "allOf": [ { "$ref": "#/components/schemas/S3Volume" }, { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["s3"] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/S3TablesVolume" }, { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["s3Tables"] } } } ] }, { "allOf": [ { "$ref": "#/components/schemas/FileVolume" }, { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["file"] } } } ] }, { "type": "object", "required": ["type"], "properties": { "type": { "type": "string", "enum": ["memory"] } } } ] }, "VolumesResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Volume" } } } }, "Worksheet": { "type": "object", "required": ["id", "name", "content", "createdAt", "updatedAt"], "properties": { "content": { "type": "string" }, "createdAt": { "type": "string", "format": "date-time" }, "id": { "$ref": "#/components/schemas/i64" }, "name": { "type": "string" }, "updatedAt": { "type": "string", "format": "date-time" } } }, "WorksheetCreatePayload": { "type": "object", "required": ["name", "content"], "properties": { "content": { "type": "string" }, "name": { "type": "string" } } }, "WorksheetCreateResponse": { "$ref": "#/components/schemas/Worksheet" }, "WorksheetResponse": { "$ref": "#/components/schemas/Worksheet" }, "WorksheetUpdatePayload": { "type": "object", "properties": { "content": { "type": ["string", "null"] }, "name": { "type": ["string", "null"] } } }, "WorksheetsResponse": { "type": "object", "required": ["items"], "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/Worksheet" } } } }, "i64": { "type": "integer", "format": "int64" } } }, "tags": [ { "name": "volumes", "description": "Volumes endpoints" }, { "name": "databases", "description": "Databases endpoints" }, { "name": "schemas", "description": "Schemas endpoints" }, { "name": "tables", "description": "Tables endpoints." }, { "name": "worksheets", "description": "Worksheets endpoints" }, { "name": "queries", "description": "Queries endpoints" }, { "name": "navigation-trees", "description": "Navigation trees endpoints." }, { "name": "dashboard", "description": "Dashboard endpoints." }, { "name": "auth", "description": "Authentication endpoints" } ] }