{
 "openapi": "3.1.0",
 "info": {
  "title": "The Data-Bridge (TDB)",
  "description": "A secure, auditable API layer over your existing data sources. Register a data source once, query it anywhere.",
  "version": "0.24.0"
 },
 "paths": {
  "/v1/auth/token": {
   "post": {
    "tags": [
     "Auth"
    ],
    "summary": "Issue a JWT access token",
    "description": "Authenticate with username and password. Returns a Bearer JWT for use on all protected endpoints.",
    "operationId": "issue_token_v1_auth_token_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TokenRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/TokenResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/auth/keys": {
   "get": {
    "tags": [
     "API Keys"
    ],
    "summary": "List API keys",
    "operationId": "list_keys_v1_auth_keys_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ApiKeyListResponse"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "API Keys"
    ],
    "summary": "Create API key",
    "description": "Creates a new DB-managed API key. The raw key is returned once and cannot be retrieved again.",
    "operationId": "create_key_v1_auth_keys_post",
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/CreateApiKeyRequest"
       }
      }
     },
     "required": true
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/CreateApiKeyResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/v1/auth/keys/{key_id}": {
   "delete": {
    "tags": [
     "API Keys"
    ],
    "summary": "Revoke API key",
    "operationId": "revoke_key_v1_auth_keys__key_id__delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key Id"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/auth/keys/{key_id}/rotate": {
   "post": {
    "tags": [
     "API Keys"
    ],
    "summary": "Rotate API key",
    "description": "Revokes the current key and issues a replacement with the same name. The new raw key is returned once.",
    "operationId": "rotate_key_v1_auth_keys__key_id__rotate_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RotateApiKeyResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/auth/keys/{key_id}/rate-limit": {
   "put": {
    "tags": [
     "API Keys"
    ],
    "summary": "Set per-key rate limit",
    "description": "Override the rate limit for a specific key. Pass null for requests_per_minute to reset to the server default.",
    "operationId": "update_rate_limit_v1_auth_keys__key_id__rate_limit_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetRateLimitRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ApiKeyRecord"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/auth/keys/{key_id}/role": {
   "put": {
    "tags": [
     "API Keys"
    ],
    "summary": "Set key role",
    "description": "Update the RBAC role assigned to a DB-managed API key.",
    "operationId": "update_role_v1_auth_keys__key_id__role_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetRoleRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ApiKeyRecord"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/auth/keys/{key_id}/tools": {
   "put": {
    "tags": [
     "API Keys"
    ],
    "summary": "Set allowed MCP tools",
    "description": "Restrict which MCP tools a key may call and is listed. Pass null for tools to allow all tools (default). An unknown tool name is rejected with 400. Calls to disallowed tools return a JSON-RPC tool-error response.",
    "operationId": "update_allowed_tools_v1_auth_keys__key_id__tools_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetAllowedToolsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ApiKeyRecord"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/auth/keys/{key_id}/lean-mode": {
   "put": {
    "tags": [
     "API Keys"
    ],
    "summary": "Set a key's Lean Mode default",
    "description": "Default Lean Mode for MCP calls made with this key. A tool call's own arguments still win, and the key's setting wins over TDB_LEAN_MODE. Send {} to clear it. An invalid value is rejected with 400.",
    "operationId": "update_lean_mode_v1_auth_keys__key_id__lean_mode_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetLeanModeRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ApiKeyRecord"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/auth/keys/{key_id}/attributes": {
   "put": {
    "tags": [
     "API Keys"
    ],
    "summary": "Set a key's policy attributes",
    "description": "Attributes a column/row policy reads, such as the region a row filter keeps. Names are identifiers; values are strings of at most 200 characters; at most 20 attributes. Send {} to clear them.",
    "operationId": "update_attributes_v1_auth_keys__key_id__attributes_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "key_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Key Id"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SetAttributesRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ApiKeyRecord"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sources": {
   "post": {
    "tags": [
     "Source Registry"
    ],
    "summary": "Register a new data source",
    "description": "Register a data source so it can be queried through TDB.\n\n**source_type** values are validated against the internal connector\nregistry (ADR-001 step 2). New types can be added by an overlay\npackage calling `tdb.connectors.registry.register()` at startup.",
    "operationId": "register_source_v1_sources_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/SourceRegistrationRequest"
       }
      }
     }
    },
    "responses": {
     "201": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SourceRecord"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Source Registry"
    ],
    "summary": "List all registered sources",
    "operationId": "list_sources_v1_sources_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/SourceSummary"
         },
         "title": "Response List Sources V1 Sources Get"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sources/{source_id}": {
   "get": {
    "tags": [
     "Source Registry"
    ],
    "summary": "Get details of a specific source (UUID or name)",
    "operationId": "get_source_v1_sources__source_id__get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "source_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Source Id"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SourceRecord"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Source Registry"
    ],
    "summary": "Remove a registered source (UUID or name)",
    "operationId": "delete_source_v1_sources__source_id__delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "source_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Source Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "204": {
      "description": "Successful Response"
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sources/{source_id}/schema": {
   "get": {
    "tags": [
     "Source Registry"
    ],
    "summary": "Inspect column names and types for a registered source (UUID or name)",
    "description": "Returns the column names and inferred types for the registered source.\nNo rows are returned \u2014 schema introspection only.",
    "operationId": "get_source_schema_v1_sources__source_id__schema_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "source_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Source Id"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/SourceSchema"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sources/{ref}/annotations": {
   "get": {
    "tags": [
     "Sources"
    ],
    "summary": "List a source's schema annotations",
    "description": "Every annotation stored for the source.\n\nTargets are checked when they are written, but a schema moves underneath\nthem: a column that is renamed or dropped leaves an annotation that matches\nnothing and says nothing, surfacing only as a description that quietly stops\nappearing in `schema_source`. `?validate=true` re-runs the write-time check\nagainst the live schema and marks each annotation `stale` with the reason.\n\nAs on the write path, `validated: false` means the source could not be read\n\u2014 never that nothing matched. An unreachable database is not evidence that\nan annotation is wrong, so nothing is flagged stale on that path.",
    "operationId": "list_annotations_v1_sources__ref__annotations_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "ref",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Ref"
      }
     },
     {
      "name": "validate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Re-check each stored annotation against the source's live schema and flag the ones that no longer match. Off by default: it turns a registry read into a round-trip to the source.",
       "default": false,
       "title": "Validate"
      },
      "description": "Re-check each stored annotation against the source's live schema and flag the ones that no longer match. Off by default: it turns a registry read into a round-trip to the source."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response List Annotations V1 Sources  Ref  Annotations Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Sources"
    ],
    "summary": "Create or replace schema annotations",
    "description": "Upserts each annotation. Existing entries for the same table/column are\nreplaced; annotations not mentioned are left alone. Use DELETE to remove one.\n\nTargets are validated against the live schema by default: an annotation on a\nmisspelled column never matches anything and would otherwise fail silently,\nsurfacing as \"the description I wrote isn't showing up\" long after the typo.\nIf the source cannot be reached the write still succeeds and the response\nreports `validated: false` \u2014 an unreachable database is not evidence that an\nannotation is wrong.",
    "operationId": "put_annotations_v1_sources__ref__annotations_put",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "ref",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Ref"
      }
     },
     {
      "name": "validate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Check each table/column against the source's live schema and reject the request if one does not exist. Set false to annotate a column that has not shipped yet.",
       "default": true,
       "title": "Validate"
      },
      "description": "Check each table/column against the source's live schema and reject the request if one does not exist. Set false to annotate a column that has not shipped yet."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/AnnotationsRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Put Annotations V1 Sources  Ref  Annotations Put"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Sources"
    ],
    "summary": "Remove schema annotations",
    "operationId": "delete_annotations_v1_sources__ref__annotations_delete",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "ref",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Ref"
      }
     },
     {
      "name": "table",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "",
       "title": "Table"
      }
     },
     {
      "name": "column",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "default": "",
       "title": "Column"
      }
     },
     {
      "name": "all",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Remove every annotation for this source.",
       "default": false,
       "title": "All"
      },
      "description": "Remove every annotation for this source."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Delete Annotations V1 Sources  Ref  Annotations Delete"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/query": {
   "post": {
    "tags": [
     "Query"
    ],
    "summary": "Run a SQL query against a registered data source",
    "description": "Execute a **read-only** SQL SELECT against a registered source.\n\n### Example\n```json\n{\n  \"source_id\": \"abc-123\",\n  \"sql\": \"SELECT * FROM orders LIMIT 50\",\n  \"limit\": 50\n}\n```\n\nUse the table name that matches the connector: CSV sources are exposed as\n`data`, while database connectors (Postgres, MySQL, SQL Server, Snowflake)\ntake the **actual table name** from the source's `connection.table` \u2014 the\nSQL is passed through to the database unchanged apart from an appended\n`LIMIT`, so there is no `data` alias for database sources.",
    "operationId": "run_query_v1_query_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/QueryRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/QueryResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/mcp": {
   "post": {
    "tags": [
     "MCP"
    ],
    "summary": "MCP-compatible JSON-RPC 2.0 endpoint",
    "description": "Model Context Protocol endpoint (JSON-RPC 2.0).\n\nConnects Claude Desktop, Cursor, and other MCP clients directly to\nthe registered data source without extra configuration.\n\nSupported methods: `initialize`, `ping`, `tools/list`, `tools/call`, and\nfrom 2026-07-28 `server/discover`",
    "operationId": "mcp_endpoint_v1_mcp_post",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/v1/views": {
   "get": {
    "tags": [
     "Views"
    ],
    "summary": "List all loaded views",
    "description": "Return all view definitions loaded from TDB_VIEWS_DIR.",
    "operationId": "list_views_v1_views_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "items": {
          "$ref": "#/components/schemas/ViewInfo"
         },
         "type": "array",
         "title": "Response List Views V1 Views Get"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/v1/views/{name}": {
   "get": {
    "tags": [
     "Views"
    ],
    "summary": "Get a single view spec",
    "operationId": "get_view_v1_views__name__get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/ViewInfo"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/views/{name}/run": {
   "post": {
    "tags": [
     "Views"
    ],
    "summary": "Execute a view with parameters",
    "description": "Run a named view, supplying values for any declared parameters.\n\n### Example\n```json\n{\"parameters\": {\"status\": \"pending\"}, \"limit\": 100}\n```",
    "operationId": "run_view_endpoint_v1_views__name__run_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "name",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Name"
      }
     },
     {
      "name": "authorization",
      "in": "header",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "null"
        }
       ],
       "title": "Authorization"
      }
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/RunViewRequest"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/RunViewResponse"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/policies": {
   "get": {
    "tags": [
     "Policies"
    ],
    "summary": "Column and row policies in force",
    "operationId": "get_policies_v1_policies_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "validate",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Check each source's live schema.",
       "default": false,
       "title": "Validate"
      },
      "description": "Check each source's live schema."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Get Policies V1 Policies Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/sources/{ref}/policy-suggestions": {
   "get": {
    "tags": [
     "Policies"
    ],
    "summary": "Suggest column policies for a source's personal data",
    "operationId": "get_policy_suggestions_v1_sources__ref__policy_suggestions_get",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "ref",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "title": "Ref"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "additionalProperties": true,
         "title": "Response Get Policy Suggestions V1 Sources  Ref  Policy Suggestions Get"
        }
       }
      }
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/audit/verify": {
   "get": {
    "tags": [
     "Audit"
    ],
    "summary": "Verify audit log hash chain integrity",
    "description": "Reads the audit log and verifies every signed entry's hash and chain link.\n\nReturns ``{\"valid\": true, \"entries\": N}`` when the chain is intact,\nor ``{\"valid\": false, \"error\": \"...\", \"at_seq\": N}`` if tampering is detected.\n\nLegacy entries written before hash-chaining was enabled are skipped.",
    "operationId": "audit_verify_v1_audit_verify_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "additionalProperties": true,
         "type": "object",
         "title": "Response Audit Verify V1 Audit Verify Get"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/v1/audit/history": {
   "get": {
    "tags": [
     "Audit"
    ],
    "summary": "Verify the live log and every sealed segment",
    "description": "Verifies each sealed segment, the live log, and the anchors linking them.\n\n``/verify`` proves the *live* log has not been altered, but each segment\nrestarts its chain from genesis, so it cannot prove a whole segment was not\nremoved. This walks the ``chain_anchor`` entries to check the sequence is\ncomplete.\n\nPruning the oldest segments is a supported retention action and stays valid;\na gap in the middle does not.",
    "operationId": "audit_history_v1_audit_history_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "additionalProperties": true,
         "type": "object",
         "title": "Response Audit History V1 Audit History Get"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/v1/audit/rotate": {
   "post": {
    "tags": [
     "Audit"
    ],
    "summary": "Seal the audit log into a segment now",
    "description": "Seals the live audit log into a timestamped segment and starts a fresh chain.\n\nThe segment keeps its chain intact and stays independently verifiable. TDB\nnever deletes a segment \u2014 removing old ones is the operator's decision.\n\nReturns ``{\"rotated\": true, \"segment\": \"...\", \"entries_sealed\": N}``, or\n``{\"rotated\": false, \"reason\": \"log is empty\"}`` when there is nothing to seal.",
    "operationId": "audit_rotate_v1_audit_rotate_post",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "additionalProperties": true,
         "type": "object",
         "title": "Response Audit Rotate V1 Audit Rotate Post"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/v1/audit/export": {
   "post": {
    "tags": [
     "Audit"
    ],
    "summary": "Export audit log to a SIEM destination",
    "description": "Ships audit entries the destination has not yet received, to Splunk HEC or S3. Each destination keeps its own cursor, so a scheduled export is incremental rather than re-sending the whole log every run. Configure Splunk via TDB_SPLUNK_HEC_URL / TDB_SPLUNK_HEC_TOKEN, or S3 via TDB_S3_BUCKET. An unconfigured destination is a no-op and reports `disabled`. Pass `since_seq=0` to re-send history.\n\nRuns synchronously by default and returns what it shipped. Pass `wait=false` to get 202 immediately and let it run in the background \u2014 read the outcome afterwards from GET /v1/audit/export/status, which reports `last_run` per destination. Either way a destination exports one run at a time: an overlapping call gets 409, because two runs share a cursor and would ship the same entries twice.",
    "operationId": "trigger_export_v1_audit_export_post",
    "security": [
     {
      "HTTPBearer": []
     }
    ],
    "parameters": [
     {
      "name": "destination",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "description": "Where to send: 'splunk' or 's3'.",
       "default": "splunk",
       "title": "Destination"
      },
      "description": "Where to send: 'splunk' or 's3'."
     },
     {
      "name": "since_seq",
      "in": "query",
      "required": false,
      "schema": {
       "anyOf": [
        {
         "type": "integer",
         "minimum": 0
        },
        {
         "type": "null"
        }
       ],
       "description": "Ignore the stored cursor and export everything after this seq. Use 0 to re-send the entire log.",
       "title": "Since Seq"
      },
      "description": "Ignore the stored cursor and export everything after this seq. Use 0 to re-send the entire log."
     },
     {
      "name": "wait",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean",
       "description": "Wait for the export to finish and return its result. Pass false to return 202 immediately and run it in the background.",
       "default": true,
       "title": "Wait"
      },
      "description": "Wait for the export to finish and return its result. Pass false to return 202 immediately and run it in the background."
     }
    ],
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "202": {
      "description": "Accepted; running in the background."
     },
     "409": {
      "description": "An export to this destination is already running."
     },
     "422": {
      "description": "Validation Error",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/HTTPValidationError"
        }
       }
      }
     }
    }
   }
  },
  "/v1/audit/export/status": {
   "get": {
    "tags": [
     "Audit"
    ],
    "summary": "Show how far each SIEM destination has consumed the audit log",
    "operationId": "export_status_v1_audit_export_status_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {
         "additionalProperties": true,
         "type": "object",
         "title": "Response Export Status V1 Audit Export Status Get"
        }
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  },
  "/health": {
   "get": {
    "tags": [
     "Meta"
    ],
    "summary": "Health",
    "description": "Liveness probe \u2014 used by Docker / k8s health checks.",
    "operationId": "health_health_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    }
   }
  },
  "/v1/version": {
   "get": {
    "tags": [
     "Meta"
    ],
    "summary": "Version",
    "description": "Report the running version and build SHA (authenticated).\n\nUsed to confirm a deployment's exact patch level after a security update \u2014\ne.g. an operator comparing against the latest released image, with no\nphone-home. The unauthenticated `/` banner also carries `version`.",
    "operationId": "version_v1_version_get",
    "responses": {
     "200": {
      "description": "Successful Response",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "HTTPBearer": []
     }
    ]
   }
  }
 },
 "components": {
  "schemas": {
   "Annotation": {
    "properties": {
     "table": {
      "type": "string",
      "maxLength": 200,
      "title": "Table",
      "description": "Table this applies to. Omit for a single-table source.",
      "default": ""
     },
     "column": {
      "type": "string",
      "maxLength": 200,
      "title": "Column",
      "description": "Column this applies to. Omit to describe the table itself.",
      "default": ""
     },
     "description": {
      "type": "string",
      "maxLength": 2000,
      "minLength": 1,
      "title": "Description"
     }
    },
    "type": "object",
    "required": [
     "description"
    ],
    "title": "Annotation"
   },
   "AnnotationsRequest": {
    "properties": {
     "annotations": {
      "items": {
       "$ref": "#/components/schemas/Annotation"
      },
      "type": "array",
      "maxItems": 500,
      "minItems": 1,
      "title": "Annotations"
     }
    },
    "type": "object",
    "required": [
     "annotations"
    ],
    "title": "AnnotationsRequest"
   },
   "ApiKeyListResponse": {
    "properties": {
     "keys": {
      "items": {
       "$ref": "#/components/schemas/ApiKeyRecord"
      },
      "type": "array",
      "title": "Keys"
     }
    },
    "type": "object",
    "required": [
     "keys"
    ],
    "title": "ApiKeyListResponse"
   },
   "ApiKeyRecord": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "key_prefix": {
      "type": "string",
      "title": "Key Prefix"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
     },
     "expires_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Expires At"
     },
     "revoked_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Revoked At"
     },
     "last_used_at": {
      "anyOf": [
       {
        "type": "string",
        "format": "date-time"
       },
       {
        "type": "null"
       }
      ],
      "title": "Last Used At"
     },
     "rate_limit": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Rate Limit"
     },
     "role": {
      "type": "string",
      "title": "Role",
      "default": "read"
     },
     "allowed_tools": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Allowed Tools"
     },
     "lean_mode": {
      "anyOf": [
       {
        "additionalProperties": true,
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lean Mode"
     },
     "attributes": {
      "anyOf": [
       {
        "additionalProperties": {
         "type": "string"
        },
        "type": "object"
       },
       {
        "type": "null"
       }
      ],
      "title": "Attributes"
     },
     "created_by": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Created By"
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "key_prefix",
     "created_at",
     "expires_at",
     "revoked_at",
     "last_used_at",
     "rate_limit"
    ],
    "title": "ApiKeyRecord"
   },
   "CreateApiKeyRequest": {
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "Name"
     },
     "expires_in_days": {
      "anyOf": [
       {
        "type": "integer",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Expires In Days"
     },
     "rate_limit": {
      "anyOf": [
       {
        "type": "integer",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Rate Limit",
      "description": "Requests per minute. Omit to use server default (TDB_DEFAULT_RATE_LIMIT)."
     },
     "role": {
      "type": "string",
      "title": "Role",
      "description": "RBAC role for this key: 'read', 'readwrite', or 'admin'. Defaults to 'read' \u2014 a key handed to an AI agent should not be able to manage keys or sources unless that is asked for.",
      "default": "read"
     }
    },
    "type": "object",
    "required": [
     "name"
    ],
    "title": "CreateApiKeyRequest"
   },
   "CreateApiKeyResponse": {
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ApiKeyRecord"
     },
     "raw_key": {
      "type": "string",
      "title": "Raw Key"
     }
    },
    "type": "object",
    "required": [
     "key",
     "raw_key"
    ],
    "title": "CreateApiKeyResponse"
   },
   "HTTPValidationError": {
    "properties": {
     "detail": {
      "items": {
       "$ref": "#/components/schemas/ValidationError"
      },
      "type": "array",
      "title": "Detail"
     }
    },
    "type": "object",
    "title": "HTTPValidationError"
   },
   "ParameterInfo": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "type": {
      "type": "string",
      "title": "Type"
     },
     "description": {
      "type": "string",
      "title": "Description"
     },
     "required": {
      "type": "boolean",
      "title": "Required"
     },
     "default": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "integer"
       },
       {
        "type": "number"
       },
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Default"
     }
    },
    "type": "object",
    "required": [
     "name",
     "type",
     "description",
     "required",
     "default"
    ],
    "title": "ParameterInfo"
   },
   "QueryRequest": {
    "properties": {
     "source_id": {
      "type": "string",
      "title": "Source Id"
     },
     "sql": {
      "type": "string",
      "maxLength": 10000,
      "minLength": 1,
      "title": "Sql"
     },
     "limit": {
      "type": "integer",
      "minimum": 1.0,
      "title": "Limit",
      "description": "Max rows to return (default 100). The ceiling is the deployment's TDB_MAX_ROWS setting (default 1,000); a larger value is rejected with 400 rather than silently clamped.",
      "default": 100
     }
    },
    "type": "object",
    "required": [
     "source_id",
     "sql"
    ],
    "title": "QueryRequest"
   },
   "QueryResponse": {
    "properties": {
     "source_id": {
      "type": "string",
      "title": "Source Id"
     },
     "sql": {
      "type": "string",
      "title": "Sql"
     },
     "columns": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Columns"
     },
     "rows": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Rows"
     },
     "rows_returned": {
      "type": "integer",
      "title": "Rows Returned"
     },
     "truncated": {
      "type": "boolean",
      "title": "Truncated",
      "default": false
     },
     "executed_at": {
      "type": "string",
      "format": "date-time",
      "title": "Executed At"
     }
    },
    "type": "object",
    "required": [
     "source_id",
     "sql",
     "columns",
     "rows",
     "rows_returned"
    ],
    "title": "QueryResponse"
   },
   "RotateApiKeyResponse": {
    "properties": {
     "key": {
      "$ref": "#/components/schemas/ApiKeyRecord"
     },
     "raw_key": {
      "type": "string",
      "title": "Raw Key"
     }
    },
    "type": "object",
    "required": [
     "key",
     "raw_key"
    ],
    "title": "RotateApiKeyResponse"
   },
   "RunViewRequest": {
    "properties": {
     "parameters": {
      "additionalProperties": true,
      "type": "object",
      "title": "Parameters"
     },
     "limit": {
      "anyOf": [
       {
        "type": "integer",
        "minimum": 1.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Limit",
      "description": "Max rows (default 1,000, or TDB_MAX_ROWS if lower). Above the deployment's TDB_MAX_ROWS is refused with 400."
     }
    },
    "type": "object",
    "title": "RunViewRequest"
   },
   "RunViewResponse": {
    "properties": {
     "view": {
      "type": "string",
      "title": "View"
     },
     "source": {
      "type": "string",
      "title": "Source"
     },
     "columns": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Columns"
     },
     "rows": {
      "items": {
       "additionalProperties": true,
       "type": "object"
      },
      "type": "array",
      "title": "Rows"
     },
     "rows_returned": {
      "type": "integer",
      "title": "Rows Returned"
     },
     "truncated": {
      "type": "boolean",
      "title": "Truncated"
     },
     "executed_at": {
      "type": "string",
      "format": "date-time",
      "title": "Executed At"
     }
    },
    "type": "object",
    "required": [
     "view",
     "source",
     "columns",
     "rows",
     "rows_returned",
     "truncated",
     "executed_at"
    ],
    "title": "RunViewResponse"
   },
   "SchemaColumn": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "type": {
      "type": "string",
      "title": "Type"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "masked": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Masked"
     }
    },
    "type": "object",
    "required": [
     "name",
     "type"
    ],
    "title": "SchemaColumn"
   },
   "SetAllowedToolsRequest": {
    "properties": {
     "tools": {
      "anyOf": [
       {
        "items": {
         "type": "string"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tools",
      "description": "List of allowed MCP tool names for this key. Pass null to allow all tools (default). Example: ['query_source', 'schema_source']"
     }
    },
    "type": "object",
    "title": "SetAllowedToolsRequest"
   },
   "SetAttributesRequest": {
    "properties": {
     "attributes": {
      "additionalProperties": {
       "type": "string"
      },
      "type": "object",
      "title": "Attributes",
      "description": "Values column and row policies read as :name in a row filter, e.g. {\"region\": \"EMEA\"}. {} clears them."
     }
    },
    "type": "object",
    "title": "SetAttributesRequest"
   },
   "SetLeanModeRequest": {
    "properties": {
     "lean": {
      "anyOf": [
       {
        "type": "boolean"
       },
       {
        "type": "null"
       }
      ],
      "title": "Lean",
      "description": "true = table rows and {column: type} schemas."
     },
     "format": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Format",
      "description": "'objects' or 'table'."
     },
     "detail": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Detail",
      "description": "schema_source: 'tables', 'names', 'types' or 'full'."
     },
     "max_cell_chars": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ],
      "title": "Max Cell Chars",
      "description": "Cut longer text cells (min 50; 0 = off). Lossy."
     }
    },
    "type": "object",
    "title": "SetLeanModeRequest"
   },
   "SetRateLimitRequest": {
    "properties": {
     "requests_per_minute": {
      "anyOf": [
       {
        "type": "integer",
        "exclusiveMinimum": 0.0
       },
       {
        "type": "null"
       }
      ],
      "title": "Requests Per Minute",
      "description": "Set to null to fall back to the server default."
     }
    },
    "type": "object",
    "title": "SetRateLimitRequest"
   },
   "SetRoleRequest": {
    "properties": {
     "role": {
      "type": "string",
      "title": "Role",
      "description": "New role: 'read', 'readwrite', or 'admin'."
     }
    },
    "type": "object",
    "required": [
     "role"
    ],
    "title": "SetRoleRequest"
   },
   "SourceRecord": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "source_type": {
      "type": "string",
      "title": "Source Type"
     },
     "connection": {
      "additionalProperties": true,
      "type": "object",
      "title": "Connection"
     },
     "description": {
      "type": "string",
      "title": "Description",
      "default": ""
     },
     "tags": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Tags"
     },
     "registered_by": {
      "type": "string",
      "title": "Registered By",
      "default": ""
     },
     "registered_at": {
      "type": "string",
      "format": "date-time",
      "title": "Registered At"
     },
     "status": {
      "$ref": "#/components/schemas/SourceStatus",
      "default": "active"
     }
    },
    "type": "object",
    "required": [
     "name",
     "source_type",
     "connection"
    ],
    "title": "SourceRecord"
   },
   "SourceRegistrationRequest": {
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "Name"
     },
     "source_type": {
      "type": "string",
      "title": "Source Type"
     },
     "connection": {
      "additionalProperties": true,
      "type": "object",
      "title": "Connection"
     },
     "description": {
      "type": "string",
      "maxLength": 500,
      "title": "Description",
      "default": ""
     },
     "tags": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Tags"
     }
    },
    "type": "object",
    "required": [
     "name",
     "source_type",
     "connection"
    ],
    "title": "SourceRegistrationRequest"
   },
   "SourceSchema": {
    "properties": {
     "source_id": {
      "type": "string",
      "title": "Source Id"
     },
     "source_name": {
      "type": "string",
      "title": "Source Name"
     },
     "columns": {
      "items": {
       "$ref": "#/components/schemas/SchemaColumn"
      },
      "type": "array",
      "title": "Columns"
     },
     "tables": {
      "anyOf": [
       {
        "items": {
         "$ref": "#/components/schemas/TableSchema"
        },
        "type": "array"
       },
       {
        "type": "null"
       }
      ],
      "title": "Tables"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     },
     "source_description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Source Description"
     },
     "inspected_at": {
      "type": "string",
      "format": "date-time",
      "title": "Inspected At"
     }
    },
    "type": "object",
    "required": [
     "source_id",
     "source_name"
    ],
    "title": "SourceSchema"
   },
   "SourceStatus": {
    "type": "string",
    "enum": [
     "active",
     "inactive",
     "error"
    ],
    "title": "SourceStatus"
   },
   "SourceSummary": {
    "properties": {
     "id": {
      "type": "string",
      "title": "Id"
     },
     "name": {
      "type": "string",
      "title": "Name"
     },
     "source_type": {
      "type": "string",
      "title": "Source Type"
     },
     "description": {
      "type": "string",
      "title": "Description",
      "default": ""
     },
     "tags": {
      "items": {
       "type": "string"
      },
      "type": "array",
      "title": "Tags"
     },
     "registered_at": {
      "type": "string",
      "format": "date-time",
      "title": "Registered At"
     }
    },
    "type": "object",
    "required": [
     "id",
     "name",
     "source_type"
    ],
    "title": "SourceSummary"
   },
   "TableSchema": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "columns": {
      "items": {
       "$ref": "#/components/schemas/SchemaColumn"
      },
      "type": "array",
      "title": "Columns"
     },
     "description": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ],
      "title": "Description"
     }
    },
    "type": "object",
    "required": [
     "name",
     "columns"
    ],
    "title": "TableSchema",
    "description": "Column listing for one table \u2014 used in database-wide schema responses."
   },
   "TokenRequest": {
    "properties": {
     "username": {
      "type": "string",
      "title": "Username"
     },
     "password": {
      "type": "string",
      "title": "Password"
     }
    },
    "type": "object",
    "required": [
     "username",
     "password"
    ],
    "title": "TokenRequest"
   },
   "TokenResponse": {
    "properties": {
     "access_token": {
      "type": "string",
      "title": "Access Token"
     },
     "token_type": {
      "type": "string",
      "title": "Token Type",
      "default": "bearer"
     },
     "expires_in": {
      "type": "integer",
      "title": "Expires In"
     }
    },
    "type": "object",
    "required": [
     "access_token",
     "expires_in"
    ],
    "title": "TokenResponse"
   },
   "ValidationError": {
    "properties": {
     "loc": {
      "items": {
       "anyOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      },
      "type": "array",
      "title": "Location"
     },
     "msg": {
      "type": "string",
      "title": "Message"
     },
     "type": {
      "type": "string",
      "title": "Error Type"
     },
     "input": {
      "title": "Input"
     },
     "ctx": {
      "type": "object",
      "title": "Context"
     }
    },
    "type": "object",
    "required": [
     "loc",
     "msg",
     "type"
    ],
    "title": "ValidationError"
   },
   "ViewInfo": {
    "properties": {
     "name": {
      "type": "string",
      "title": "Name"
     },
     "description": {
      "type": "string",
      "title": "Description"
     },
     "source": {
      "type": "string",
      "title": "Source"
     },
     "parameters": {
      "items": {
       "$ref": "#/components/schemas/ParameterInfo"
      },
      "type": "array",
      "title": "Parameters"
     }
    },
    "type": "object",
    "required": [
     "name",
     "description",
     "source",
     "parameters"
    ],
    "title": "ViewInfo"
   }
  },
  "securitySchemes": {
   "HTTPBearer": {
    "type": "http",
    "scheme": "bearer"
   }
  }
 }
}
