{
  "components": {
    "schemas": {
      "AddMemberRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "AddMemberRequest",
        "type": "object"
      },
      "AddUserToGroupRequest": {
        "properties": {
          "group_id": {
            "title": "Group Id",
            "type": "string"
          }
        },
        "required": [
          "group_id"
        ],
        "title": "AddUserToGroupRequest",
        "type": "object"
      },
      "AdminActionRequest": {
        "properties": {
          "audience": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audience"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "title": "AdminActionRequest",
        "type": "object"
      },
      "AdminTokenItem": {
        "description": "Admin list row: adds owner identity + last IP for incident response.",
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "last_used_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used Ip"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "prefix": {
            "title": "Prefix",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "user_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Email"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "created_at",
          "expires_at",
          "last_used_at",
          "revoked_at",
          "user_id"
        ],
        "title": "AdminTokenItem",
        "type": "object"
      },
      "BannerResponse": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "BannerResponse",
        "type": "object"
      },
      "BatchActionRequest": {
        "properties": {
          "action": {
            "title": "Action",
            "type": "string"
          },
          "audience": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audience"
          },
          "item_ids": {
            "items": {
              "type": "string"
            },
            "title": "Item Ids",
            "type": "array"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason"
          }
        },
        "required": [
          "item_ids",
          "action"
        ],
        "title": "BatchActionRequest",
        "type": "object"
      },
      "Body_import_metrics_api_admin_metrics_import_post": {
        "properties": {
          "file": {
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_import_metrics_api_admin_metrics_import_post",
        "type": "object"
      },
      "Body_password_login_web_auth_password_login_web_post": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "next": {
            "default": "",
            "title": "Next",
            "type": "string"
          },
          "password": {
            "default": "",
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "Body_password_login_web_auth_password_login_web_post",
        "type": "object"
      },
      "Body_reset_confirm_auth_password_reset_confirm_post": {
        "properties": {
          "confirm_password": {
            "title": "Confirm Password",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "password": {
            "title": "Password",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "email",
          "token",
          "password",
          "confirm_password"
        ],
        "title": "Body_reset_confirm_auth_password_reset_confirm_post",
        "type": "object"
      },
      "Body_reset_request_auth_password_reset_post": {
        "properties": {
          "email": {
            "default": "",
            "title": "Email",
            "type": "string"
          }
        },
        "title": "Body_reset_request_auth_password_reset_post",
        "type": "object"
      },
      "Body_setup_confirm_auth_password_setup_confirm_post": {
        "properties": {
          "confirm_password": {
            "title": "Confirm Password",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "name": {
            "default": "",
            "title": "Name",
            "type": "string"
          },
          "password": {
            "title": "Password",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "email",
          "token",
          "password",
          "confirm_password"
        ],
        "title": "Body_setup_confirm_auth_password_setup_confirm_post",
        "type": "object"
      },
      "Body_setup_request_auth_password_setup_request_post": {
        "properties": {
          "email": {
            "default": "",
            "title": "Email",
            "type": "string"
          }
        },
        "title": "Body_setup_request_auth_password_setup_request_post",
        "type": "object"
      },
      "Body_upload_artifact_api_upload_artifacts_post": {
        "properties": {
          "file": {
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_artifact_api_upload_artifacts_post",
        "type": "object"
      },
      "Body_upload_session_api_upload_sessions_post": {
        "properties": {
          "file": {
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "type": "string"
          }
        },
        "required": [
          "file"
        ],
        "title": "Body_upload_session_api_upload_sessions_post",
        "type": "object"
      },
      "BootstrapRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "name": {
            "default": "",
            "title": "Name",
            "type": "string"
          },
          "password": {
            "default": "",
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "BootstrapRequest",
        "type": "object"
      },
      "BulkUpdateRequest": {
        "description": "Apply ``updates`` to every id in ``item_ids``. Issue #62.",
        "properties": {
          "item_ids": {
            "items": {
              "type": "string"
            },
            "title": "Item Ids",
            "type": "array"
          },
          "updates": {
            "additionalProperties": true,
            "title": "Updates",
            "type": "object"
          }
        },
        "required": [
          "item_ids",
          "updates"
        ],
        "title": "BulkUpdateRequest",
        "type": "object"
      },
      "ClaudeMdResponse": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "ClaudeMdResponse",
        "type": "object"
      },
      "ColumnMetadataItem": {
        "properties": {
          "basetype": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Basetype"
          },
          "column_name": {
            "title": "Column Name",
            "type": "string"
          },
          "confidence": {
            "default": "manual",
            "title": "Confidence",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          }
        },
        "required": [
          "column_name"
        ],
        "title": "ColumnMetadataItem",
        "type": "object"
      },
      "ColumnMetadataSave": {
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ColumnMetadataItem"
            },
            "title": "Columns",
            "type": "array"
          }
        },
        "required": [
          "columns"
        ],
        "title": "ColumnMetadataSave",
        "type": "object"
      },
      "ConfigureRequest": {
        "properties": {
          "allowed_domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Domain"
          },
          "bigquery_location": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bigquery Location"
          },
          "bigquery_project": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bigquery Project"
          },
          "data_source": {
            "title": "Data Source",
            "type": "string"
          },
          "instance_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Name"
          },
          "keboola_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keboola Token"
          },
          "keboola_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Keboola Url"
          }
        },
        "required": [
          "data_source"
        ],
        "title": "ConfigureRequest",
        "type": "object"
      },
      "CreateContradictionRequest": {
        "properties": {
          "explanation": {
            "title": "Explanation",
            "type": "string"
          },
          "item_a_id": {
            "title": "Item A Id",
            "type": "string"
          },
          "item_b_id": {
            "title": "Item B Id",
            "type": "string"
          },
          "severity": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Severity"
          },
          "suggested_resolution": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Suggested Resolution"
          }
        },
        "required": [
          "item_a_id",
          "item_b_id",
          "explanation"
        ],
        "title": "CreateContradictionRequest",
        "type": "object"
      },
      "CreateGrantRequest": {
        "properties": {
          "group_id": {
            "title": "Group Id",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          }
        },
        "required": [
          "group_id",
          "resource_type",
          "resource_id"
        ],
        "title": "CreateGrantRequest",
        "type": "object"
      },
      "CreateGroupRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateGroupRequest",
        "type": "object"
      },
      "CreateKnowledgeRequest": {
        "properties": {
          "category": {
            "title": "Category",
            "type": "string"
          },
          "content": {
            "title": "Content",
            "type": "string"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "entities": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entities"
          },
          "source_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Type"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "title",
          "content",
          "category"
        ],
        "title": "CreateKnowledgeRequest",
        "type": "object"
      },
      "CreateMarketplaceRequest": {
        "properties": {
          "branch": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Branch"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          },
          "token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "name",
          "slug",
          "url"
        ],
        "title": "CreateMarketplaceRequest",
        "type": "object"
      },
      "CreateTokenRequest": {
        "properties": {
          "expires_in_days": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": 90,
            "title": "Expires In Days"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "CreateTokenRequest",
        "type": "object"
      },
      "CreateTokenResponse": {
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "prefix": {
            "title": "Prefix",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "token",
          "expires_at",
          "created_at"
        ],
        "title": "CreateTokenResponse",
        "type": "object"
      },
      "CreateUserRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "send_invite": {
            "default": false,
            "title": "Send Invite",
            "type": "boolean"
          }
        },
        "required": [
          "email",
          "name"
        ],
        "title": "CreateUserRequest",
        "type": "object"
      },
      "DatasetSettingRequest": {
        "properties": {
          "dataset": {
            "title": "Dataset",
            "type": "string"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          }
        },
        "required": [
          "dataset",
          "enabled"
        ],
        "title": "DatasetSettingRequest",
        "type": "object"
      },
      "DeployScriptRequest": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "schedule": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "name",
          "source"
        ],
        "title": "DeployScriptRequest",
        "type": "object"
      },
      "EditRequest": {
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "EditRequest",
        "type": "object"
      },
      "EffectiveAccessItem": {
        "properties": {
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          },
          "via_groups": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "title": "Via Groups",
            "type": "array"
          }
        },
        "required": [
          "resource_type",
          "resource_id",
          "via_groups"
        ],
        "title": "EffectiveAccessItem",
        "type": "object"
      },
      "EffectiveAccessResponse": {
        "properties": {
          "is_admin": {
            "title": "Is Admin",
            "type": "boolean"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/EffectiveAccessItem"
            },
            "title": "Items",
            "type": "array"
          }
        },
        "required": [
          "is_admin",
          "items"
        ],
        "title": "EffectiveAccessResponse",
        "type": "object"
      },
      "GrantResponse": {
        "properties": {
          "assigned_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned At"
          },
          "assigned_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned By"
          },
          "group_id": {
            "title": "Group Id",
            "type": "string"
          },
          "group_name": {
            "title": "Group Name",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "resource_id": {
            "title": "Resource Id",
            "type": "string"
          },
          "resource_type": {
            "title": "Resource Type",
            "type": "string"
          }
        },
        "required": [
          "id",
          "group_id",
          "group_name",
          "resource_type",
          "resource_id"
        ],
        "title": "GrantResponse",
        "type": "object"
      },
      "GroupBrief": {
        "properties": {
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_system": {
            "default": false,
            "title": "Is System",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "origin": {
            "default": "custom",
            "title": "Origin",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "GroupBrief",
        "type": "object"
      },
      "GroupResponse": {
        "properties": {
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "grant_count": {
            "default": 0,
            "title": "Grant Count",
            "type": "integer"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "is_google_managed": {
            "default": false,
            "title": "Is Google Managed",
            "type": "boolean"
          },
          "is_system": {
            "default": false,
            "title": "Is System",
            "type": "boolean"
          },
          "mapped_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mapped Email"
          },
          "member_count": {
            "default": 0,
            "title": "Member Count",
            "type": "integer"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "origin": {
            "default": "custom",
            "title": "Origin",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "GroupResponse",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "HybridQueryRequest": {
        "properties": {
          "register_bq": {
            "additionalProperties": {
              "type": "string"
            },
            "default": {},
            "title": "Register Bq",
            "type": "object"
          },
          "sql": {
            "title": "Sql",
            "type": "string"
          }
        },
        "required": [
          "sql"
        ],
        "title": "HybridQueryRequest",
        "type": "object"
      },
      "LocalMdRequest": {
        "properties": {
          "content": {
            "title": "Content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "LocalMdRequest",
        "type": "object"
      },
      "MagicLinkRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "MagicLinkRequest",
        "type": "object"
      },
      "MagicLinkVerify": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "email",
          "token"
        ],
        "title": "MagicLinkVerify",
        "type": "object"
      },
      "MarketplaceResponse": {
        "properties": {
          "branch": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Branch"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "has_token": {
            "default": false,
            "title": "Has Token",
            "type": "boolean"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_commit_sha": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Commit Sha"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "last_synced_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Synced At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "plugin_count": {
            "default": 0,
            "title": "Plugin Count",
            "type": "integer"
          },
          "registered_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registered At"
          },
          "registered_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registered By"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "url"
        ],
        "title": "MarketplaceResponse",
        "type": "object"
      },
      "MemberResponse": {
        "properties": {
          "active": {
            "default": true,
            "title": "Active",
            "type": "boolean"
          },
          "added_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added At"
          },
          "added_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added By"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "source": {
            "title": "Source",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "email",
          "source"
        ],
        "title": "MemberResponse",
        "type": "object"
      },
      "MetricCreate": {
        "properties": {
          "category": {
            "title": "Category",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "dimensions": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dimensions"
          },
          "display_name": {
            "title": "Display Name",
            "type": "string"
          },
          "expression": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expression"
          },
          "filters": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filters"
          },
          "grain": {
            "default": "monthly",
            "title": "Grain",
            "type": "string"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "notes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "source": {
            "default": "manual",
            "title": "Source",
            "type": "string"
          },
          "sql": {
            "title": "Sql",
            "type": "string"
          },
          "sql_variants": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sql Variants"
          },
          "synonyms": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Synonyms"
          },
          "table_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Table Name"
          },
          "tables": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tables"
          },
          "time_column": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Time Column"
          },
          "type": {
            "default": "sum",
            "title": "Type",
            "type": "string"
          },
          "unit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit"
          },
          "validation": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation"
          }
        },
        "required": [
          "id",
          "name",
          "display_name",
          "category",
          "sql"
        ],
        "title": "MetricCreate",
        "type": "object"
      },
      "PasswordLoginRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "password": {
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email",
          "password"
        ],
        "title": "PasswordLoginRequest",
        "type": "object"
      },
      "PasswordSetupRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "password": {
            "title": "Password",
            "type": "string"
          },
          "token": {
            "title": "Token",
            "type": "string"
          }
        },
        "required": [
          "email",
          "token",
          "password"
        ],
        "title": "PasswordSetupRequest",
        "type": "object"
      },
      "PatchItemRequest": {
        "description": "Partial update for a knowledge item via PATCH /api/memory/admin/{id}.\n\nReplaces the narrow ``EditRequest`` (title + content only). Any field\nleft as ``None`` is unchanged. Domain is validated against\n``VALID_DOMAINS`` when supplied.",
        "properties": {
          "audience": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Audience"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain"
          },
          "tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "PatchItemRequest",
        "type": "object"
      },
      "PersonalFlagRequest": {
        "properties": {
          "is_personal": {
            "title": "Is Personal",
            "type": "boolean"
          }
        },
        "required": [
          "is_personal"
        ],
        "title": "PersonalFlagRequest",
        "type": "object"
      },
      "PluginResponse": {
        "properties": {
          "author_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author Name"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "homepage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Homepage"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "source_spec": {
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ],
            "title": "Source Spec"
          },
          "source_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Type"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          }
        },
        "required": [
          "name"
        ],
        "title": "PluginResponse",
        "type": "object"
      },
      "QueryRequest": {
        "properties": {
          "limit": {
            "default": 1000,
            "title": "Limit",
            "type": "integer"
          },
          "sql": {
            "title": "Sql",
            "type": "string"
          }
        },
        "required": [
          "sql"
        ],
        "title": "QueryRequest",
        "type": "object"
      },
      "QueryResponse": {
        "properties": {
          "columns": {
            "items": {},
            "title": "Columns",
            "type": "array"
          },
          "row_count": {
            "title": "Row Count",
            "type": "integer"
          },
          "rows": {
            "items": {},
            "title": "Rows",
            "type": "array"
          },
          "truncated": {
            "default": false,
            "title": "Truncated",
            "type": "boolean"
          }
        },
        "required": [
          "columns",
          "rows",
          "row_count"
        ],
        "title": "QueryResponse",
        "type": "object"
      },
      "RegisterTableRequest": {
        "properties": {
          "bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bucket"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "folder": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Folder"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "primary_key": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Key"
          },
          "profile_after_sync": {
            "default": true,
            "deprecated": true,
            "description": "DEPRECATED: not consumed by the runtime (Agent 1 finding 2026-05-01). Profiler runs unconditionally on every synced table; this flag has no effect. Field stays for back-compat.",
            "title": "Profile After Sync",
            "type": "boolean"
          },
          "query_mode": {
            "default": "local",
            "title": "Query Mode",
            "type": "string"
          },
          "source_query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Query"
          },
          "source_table": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Table"
          },
          "source_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Type"
          },
          "sync_schedule": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sync Schedule"
          },
          "sync_strategy": {
            "default": "full_refresh",
            "deprecated": true,
            "description": "DEPRECATED: catalog/profiler metadata only. No extractor reads this field; every sync is a full overwrite regardless of value. profiler.is_partitioned() consumes it for parquet-layout detection. Field stays for back-compat; will be removed in a future major release.",
            "title": "Sync Strategy",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "title": "RegisterTableRequest",
        "type": "object"
      },
      "ResolveContradictionRequest": {
        "properties": {
          "resolution": {
            "title": "Resolution",
            "type": "string"
          }
        },
        "required": [
          "resolution"
        ],
        "title": "ResolveContradictionRequest",
        "type": "object"
      },
      "ResolveDuplicateRequest": {
        "description": "Resolve a duplicate-candidate relation row.\n\n``resolution`` is one of ``duplicate`` / ``different`` / ``dismissed``\n(decision 2 in issue #62 \u2014 no auto-merge action; merging is a separate\nlarger feature).",
        "properties": {
          "resolution": {
            "title": "Resolution",
            "type": "string"
          }
        },
        "required": [
          "resolution"
        ],
        "title": "ResolveDuplicateRequest",
        "type": "object"
      },
      "RunScriptRequest": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "source": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source"
          }
        },
        "title": "RunScriptRequest",
        "type": "object"
      },
      "ServerConfigUpdateRequest": {
        "description": "Patch payload for POST /api/admin/server-config.\n\nOnly the sections listed in `_EDITABLE_SECTIONS` are accepted; anything\nelse is rejected with 400. `confirm_danger` must be true if the patch\ntouches any danger-zone section (auth.*, server.*).",
        "properties": {
          "confirm_danger": {
            "default": false,
            "description": "Must be true to apply changes touching auth.* or server.*",
            "title": "Confirm Danger",
            "type": "boolean"
          },
          "sections": {
            "additionalProperties": {
              "additionalProperties": true,
              "type": "object"
            },
            "description": "Per-section patch dict (e.g. {'instance': {'name': 'X'}})",
            "title": "Sections",
            "type": "object"
          }
        },
        "title": "ServerConfigUpdateRequest",
        "type": "object"
      },
      "SetPasswordRequest": {
        "properties": {
          "password": {
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "password"
        ],
        "title": "SetPasswordRequest",
        "type": "object"
      },
      "SyncSettingsUpdate": {
        "properties": {
          "datasets": {
            "additionalProperties": true,
            "title": "Datasets",
            "type": "object"
          }
        },
        "required": [
          "datasets"
        ],
        "title": "SyncSettingsUpdate",
        "type": "object"
      },
      "TableSubscriptionUpdate": {
        "properties": {
          "table_mode": {
            "default": "all",
            "title": "Table Mode",
            "type": "string"
          },
          "tables": {
            "additionalProperties": true,
            "default": {},
            "title": "Tables",
            "type": "object"
          }
        },
        "title": "TableSubscriptionUpdate",
        "type": "object"
      },
      "TemplateGetResponse": {
        "properties": {
          "content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content"
          },
          "default": {
            "title": "Default",
            "type": "string"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated By"
          }
        },
        "required": [
          "content",
          "default"
        ],
        "title": "TemplateGetResponse",
        "type": "object"
      },
      "TemplatePreviewRequest": {
        "properties": {
          "content": {
            "maxLength": 200000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "TemplatePreviewRequest",
        "type": "object"
      },
      "TemplatePutRequest": {
        "properties": {
          "content": {
            "maxLength": 200000,
            "minLength": 1,
            "title": "Content",
            "type": "string"
          }
        },
        "required": [
          "content"
        ],
        "title": "TemplatePutRequest",
        "type": "object"
      },
      "TokenListItem": {
        "properties": {
          "created_at": {
            "title": "Created At",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "prefix": {
            "title": "Prefix",
            "type": "string"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "created_at",
          "expires_at",
          "last_used_at",
          "revoked_at"
        ],
        "title": "TokenListItem",
        "type": "object"
      },
      "TokenRequest": {
        "properties": {
          "email": {
            "title": "Email",
            "type": "string"
          },
          "password": {
            "default": "",
            "title": "Password",
            "type": "string"
          }
        },
        "required": [
          "email"
        ],
        "title": "TokenRequest",
        "type": "object"
      },
      "TokenResponse": {
        "properties": {
          "access_token": {
            "title": "Access Token",
            "type": "string"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "role": {
            "title": "Role",
            "type": "string"
          },
          "token_type": {
            "default": "bearer",
            "title": "Token Type",
            "type": "string"
          },
          "user_id": {
            "title": "User Id",
            "type": "string"
          }
        },
        "required": [
          "access_token",
          "user_id",
          "email",
          "role"
        ],
        "title": "TokenResponse",
        "type": "object"
      },
      "UpdateGroupRequest": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "UpdateGroupRequest",
        "type": "object"
      },
      "UpdateMarketplaceRequest": {
        "properties": {
          "branch": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Branch"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "title": "UpdateMarketplaceRequest",
        "type": "object"
      },
      "UpdateTableRequest": {
        "properties": {
          "bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bucket"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "primary_key": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Key"
          },
          "profile_after_sync": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "deprecated": true,
            "description": "DEPRECATED: not consumed by the runtime. See RegisterTableRequest.profile_after_sync.",
            "title": "Profile After Sync"
          },
          "query_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query Mode"
          },
          "source_query": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Query"
          },
          "source_table": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Table"
          },
          "source_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Type"
          },
          "sync_schedule": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sync Schedule"
          },
          "sync_strategy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "deprecated": true,
            "description": "DEPRECATED: catalog/profiler metadata only. See RegisterTableRequest.sync_strategy.",
            "title": "Sync Strategy"
          }
        },
        "title": "UpdateTableRequest",
        "type": "object"
      },
      "UpdateUserRequest": {
        "properties": {
          "active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Active"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          }
        },
        "title": "UpdateUserRequest",
        "type": "object"
      },
      "UserMembershipResponse": {
        "properties": {
          "added_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added At"
          },
          "added_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Added By"
          },
          "group_id": {
            "title": "Group Id",
            "type": "string"
          },
          "group_name": {
            "title": "Group Name",
            "type": "string"
          },
          "is_system": {
            "default": false,
            "title": "Is System",
            "type": "boolean"
          },
          "origin": {
            "default": "custom",
            "title": "Origin",
            "type": "string"
          },
          "source": {
            "title": "Source",
            "type": "string"
          }
        },
        "required": [
          "group_id",
          "group_name",
          "source"
        ],
        "title": "UserMembershipResponse",
        "type": "object"
      },
      "UserResponse": {
        "properties": {
          "active": {
            "default": true,
            "title": "Active",
            "type": "boolean"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "deactivated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deactivated At"
          },
          "email": {
            "title": "Email",
            "type": "string"
          },
          "groups": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/GroupBrief"
            },
            "title": "Groups",
            "type": "array"
          },
          "id": {
            "title": "Id",
            "type": "string"
          },
          "invite_email_sent": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invite Email Sent"
          },
          "invite_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invite Url"
          },
          "is_admin": {
            "default": false,
            "title": "Is Admin",
            "type": "boolean"
          },
          "is_sso_user": {
            "default": false,
            "title": "Is Sso User",
            "type": "boolean"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "role": {
            "title": "Role",
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "role",
          "created_at"
        ],
        "title": "UserResponse",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "VerifyRequest": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          }
        },
        "required": [
          "code"
        ],
        "title": "VerifyRequest",
        "type": "object"
      },
      "VoteRequest": {
        "properties": {
          "vote": {
            "title": "Vote",
            "type": "integer"
          }
        },
        "required": [
          "vote"
        ],
        "title": "VoteRequest",
        "type": "object"
      }
    }
  },
  "info": {
    "description": "Data distribution platform for AI analytical systems",
    "title": "AI Data Analyst",
    "version": "2.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/": {
      "get": {
        "operationId": "index__get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Index",
        "tags": [
          "web"
        ]
      }
    },
    "/activity-center": {
      "get": {
        "operationId": "activity_center_activity_center_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Activity Center",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/access": {
      "get": {
        "description": "Resource access management \u2014 master-detail layout with the group list\non the left and per-resource-type checkbox tree on the right. Supports\n``?group=<id>`` deep-link from the group detail page.\n\nUnderlying entity is `resource_grants`; the UI label \"Resource access\"\nmatches what admins think about (who has access) rather than the table\nname (grants).",
        "operationId": "admin_access_page_admin_access_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Access Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/agent-prompt": {
      "get": {
        "operationId": "admin_agent_prompt_page_admin_agent_prompt_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Agent Prompt Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/grants": {
      "get": {
        "description": "Backward-compat redirect for the page's previous URL.",
        "operationId": "admin_grants_redirect_admin_grants_get",
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Admin Grants Redirect",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/groups": {
      "get": {
        "description": "Group list view \u2014 full-width table of user_groups with origin chips,\nmember/grant counts, and edit/delete affordances for non-system rows.",
        "operationId": "admin_groups_page_admin_groups_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Groups Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/groups/{group_id}": {
      "get": {
        "description": "Single-group detail page \u2014 header + members table. Resource grants\nlive on /admin/grants (deep-linked from here).",
        "operationId": "admin_group_detail_page_admin_groups__group_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Group Detail Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/marketplaces": {
      "get": {
        "description": "Admin page for marketplace git repositories (register / sync / delete).",
        "operationId": "admin_marketplaces_page_admin_marketplaces_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Marketplaces Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/server-config": {
      "get": {
        "description": "Server configuration editor \u2014 instance.yaml fields grouped by section.\n\nShell-only page. The form is populated client-side from\nGET /api/admin/server-config (which redacts secrets) and submitted\nsection-by-section to POST /api/admin/server-config. Auth/server\nsections require an explicit confirmation dialog before save (see\n``_DANGER_SECTIONS`` in the API). Saves trigger the \"restart required\"\nbanner \u2014 hot-reload is out of scope for #91.",
        "operationId": "admin_server_config_page_admin_server_config_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Server Config Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/tables": {
      "get": {
        "operationId": "admin_tables_admin_tables_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Tables",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/tokens": {
      "get": {
        "description": "Admin \u2014 list of ALL tokens for incident response + offboarding.\n\nAdmin-only. No create form here (admins mint their own PATs via /tokens).\nURL param ?user=<email> pre-fills the owner filter (deep-link from\n/admin/users \"Tokens\" action).",
        "operationId": "admin_tokens_page_admin_tokens_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Tokens Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/users": {
      "get": {
        "description": "Admin page for user management.",
        "operationId": "admin_users_page_admin_users_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Users Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/users/{user_id}": {
      "get": {
        "description": "Per-user detail page \u2014 core role + module capabilities + effective-roles debug.\n\nRenders shell HTML; the JS bootstraps all role data via the admin REST API\n(/api/admin/internal-roles, /api/admin/users/{id}/role-grants,\n/api/admin/users/{id}/effective-roles). Server-side we only need the\ntarget user's email + name so the page header renders before the API\nround-trips finish; everything role-related is loaded client-side so an\nadmin reload picks up state changes from a sibling tab without a\nfull-page reload elsewhere.",
        "operationId": "admin_user_detail_page_admin_users__user_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin User Detail Page",
        "tags": [
          "web"
        ]
      }
    },
    "/admin/workspace-prompt": {
      "get": {
        "operationId": "admin_workspace_prompt_page_admin_workspace_prompt_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Workspace Prompt Page",
        "tags": [
          "web"
        ]
      }
    },
    "/api/admin/access-overview": {
      "get": {
        "description": "One-shot snapshot for the /admin/access page.\n\nReturns:\n  - ``groups``: every user_group with member + grant counts\n  - ``grants``: every (group_id, resource_type, resource_id) row\n  - ``resources``: per-resource-type hierarchical layout, where each\n    type has a list of *blocks* (parent entities, e.g. a marketplace)\n    and each block has *items* (concrete grantable resources).\n\nUI stitches the three pieces into the two-column layout: groups on\nthe left, resources tree on the right with per-item checkboxes whose\nstate derives from ``grants``.",
        "operationId": "access_overview_api_admin_access_overview_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Access Overview Api Admin Access Overview Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Access Overview",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/configure": {
      "post": {
        "description": "Configure data source and instance settings via API.\n\nWrites config to instance.yaml and persists secrets to .env_overlay.\nAI agents and the /setup wizard use this instead of manual file editing.",
        "operationId": "configure_instance_api_admin_configure_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfigureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Configure Instance",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/discover-and-register": {
      "post": {
        "description": "Discover tables from configured source and auto-register them.\n\nCombines discover-tables + register-table into one call.\nSkips already-registered tables. Used by /setup wizard and AI agents.",
        "operationId": "discover_and_register_api_admin_discover_and_register_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Discover And Register",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/discover-tables": {
      "get": {
        "description": "Discover available tables from the configured data source.\n\nFor ``data_source.type='keboola'`` returns the full Storage API table\nlist (single round-trip). For ``data_source.type='bigquery'``:\n\n- Without ``dataset``: list datasets in the configured project.\n- With ``dataset=name``: list tables (BASE TABLE + VIEW) in that dataset.\n\nTwo-step shape avoids paying the per-dataset list_tables cost up-front\non projects with hundreds of datasets \u2014 the UI populates the dataset\ndropdown first, then fetches tables only for the selected dataset.",
        "operationId": "discover_tables_api_admin_discover_tables_get",
        "parameters": [
          {
            "in": "query",
            "name": "dataset",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Dataset"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Discover Tables",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/grants": {
      "get": {
        "operationId": "list_grants_api_admin_grants_get",
        "parameters": [
          {
            "in": "query",
            "name": "resource_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource Type"
            }
          },
          {
            "in": "query",
            "name": "group_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Group Id"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GrantResponse"
                  },
                  "title": "Response List Grants Api Admin Grants Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Grants",
        "tags": [
          "access"
        ]
      },
      "post": {
        "operationId": "create_grant_api_admin_grants_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGrantRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GrantResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Grant",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/grants/{grant_id}": {
      "delete": {
        "operationId": "delete_grant_api_admin_grants__grant_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "grant_id",
            "required": true,
            "schema": {
              "title": "Grant Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Grant",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/groups": {
      "get": {
        "operationId": "list_groups_api_admin_groups_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/GroupResponse"
                  },
                  "title": "Response List Groups Api Admin Groups Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Groups",
        "tags": [
          "access"
        ]
      },
      "post": {
        "operationId": "create_group_api_admin_groups_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Group",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/groups/{group_id}": {
      "delete": {
        "operationId": "delete_group_api_admin_groups__group_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Group",
        "tags": [
          "access"
        ]
      },
      "get": {
        "description": "Single-group payload for the /admin/groups/{id} detail page header.",
        "operationId": "get_group_api_admin_groups__group_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Group",
        "tags": [
          "access"
        ]
      },
      "patch": {
        "operationId": "update_group_api_admin_groups__group_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GroupResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Group",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/groups/{group_id}/members": {
      "get": {
        "operationId": "list_members_api_admin_groups__group_id__members_get",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MemberResponse"
                  },
                  "title": "Response List Members Api Admin Groups  Group Id  Members Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Members",
        "tags": [
          "access"
        ]
      },
      "post": {
        "operationId": "add_member_api_admin_groups__group_id__members_post",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add Member",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/groups/{group_id}/members/{user_id}": {
      "delete": {
        "operationId": "remove_member_api_admin_groups__group_id__members__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove Member",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/metadata/{table_id}": {
      "get": {
        "description": "Return column metadata for a table.",
        "operationId": "get_table_metadata_api_admin_metadata__table_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Table Metadata",
        "tags": [
          "metadata"
        ]
      },
      "post": {
        "description": "Save column metadata for a table. Admin only.",
        "operationId": "save_table_metadata_api_admin_metadata__table_id__post",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ColumnMetadataSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Save Table Metadata",
        "tags": [
          "metadata"
        ]
      }
    },
    "/api/admin/metadata/{table_id}/push": {
      "post": {
        "description": "Push column metadata to Keboola Storage API. Admin only.",
        "operationId": "push_metadata_to_source_api_admin_metadata__table_id__push_post",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Push Metadata To Source",
        "tags": [
          "metadata"
        ]
      }
    },
    "/api/admin/metrics": {
      "post": {
        "description": "Create or update a metric definition (admin only).",
        "operationId": "create_or_update_metric_api_admin_metrics_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MetricCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Or Update Metric",
        "tags": [
          "metrics"
        ]
      }
    },
    "/api/admin/metrics/import": {
      "post": {
        "description": "Import metrics from uploaded YAML file.",
        "operationId": "import_metrics_api_admin_metrics_import_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_import_metrics_api_admin_metrics_import_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Import Metrics",
        "tags": [
          "metrics"
        ]
      }
    },
    "/api/admin/metrics/{metric_id}": {
      "delete": {
        "description": "Delete a metric definition by ID (admin only).",
        "operationId": "delete_metric_api_admin_metrics__metric_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "metric_id",
            "required": true,
            "schema": {
              "title": "Metric Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Metric",
        "tags": [
          "metrics"
        ]
      }
    },
    "/api/admin/register-table": {
      "post": {
        "description": "Register a new table in the system.\n\nBehavior by source_type:\n- **bigquery**: validates BQ-specific shape (dataset / source_table /\n  identifier safety / project_id format), forces query_mode='remote' and\n  profile_after_sync=False, then synchronously rebuilds extract.duckdb +\n  master views with a wall-clock budget. Returns 200 with the view name\n  on success, 202 on budget overrun (rebuild continues in a\n  BackgroundTask), or 500 if the synchronous rebuild ran but reported\n  an error (e.g. auth failure, missing project, unsafe identifier).\n- other source types: insert-only, no post-register hook. Returns 201.\n\nDefined as a plain ``def`` (not ``async def``) so FastAPI runs it in a\nthreadpool \u2014 the synchronous-materialize path waits on\n``threading.Event.wait()``, which would otherwise block the asyncio\nevent loop and stall every other request for up to ``_BQ_SYNC_REGISTER_\nTIMEOUT_S``. ``Depends(...)``, ``BackgroundTasks``, and\n``JSONResponse`` all work the same in sync handlers; the rest of the\nadmin module mixes both styles already.\n\nThe route does NOT carry a default ``status_code`` \u2014 each branch returns\nits own JSONResponse with the right code. A blanket ``status_code=201``\non the decorator would mislead OpenAPI consumers about the BQ branch.\n\nAlways: 409 on view-name collision against the existing registry, audit\nlog entry on success.",
        "operationId": "register_table_api_admin_register_table_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "BigQuery row registered + materialized synchronously"
          },
          "201": {
            "description": "Non-BigQuery row registered (no post-insert materialize)"
          },
          "202": {
            "description": "BigQuery row registered; materialize continues in background"
          },
          "409": {
            "description": "Table id or view name already in use"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "500": {
            "description": "BigQuery row registered but post-insert rebuild failed"
          }
        },
        "summary": "Register Table",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/register-table/precheck": {
      "post": {
        "description": "Validate a register-table payload + (BQ only) confirm the source table exists.\n\nNo DB write. Used by the UI to surface row count + size + column count\nin the modal before the operator clicks Register, and by the CLI's\n``--dry-run`` to print what *would* be registered without touching\nstate. Identical Pydantic validation to register-table; for BQ rows we\nadditionally make a ``bigquery.Client(project).get_table(...)`` call\nand surface the GCP error verbatim.\n\nDefined as a plain ``def`` (not ``async def``) so FastAPI runs it in a\nthreadpool \u2014 the BQ branch makes synchronous ``bigquery.Client(...)``\n/``client.get_table(...)`` calls, which would otherwise block the\nasyncio event loop and stall every other request for the duration of\nthe GCE round-trip. Mirrors the same conversion done for\n``register_table`` (see comment on that route). ``Depends(...)`` works\nidentically in sync handlers.",
        "operationId": "register_table_precheck_api_admin_register_table_precheck_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterTableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Register Table Precheck",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/registry": {
      "get": {
        "description": "Get full table registry.\n\nEach table row is enriched with `last_sync_error` from sync_state so\noperators can see WHY a row isn't materializing without trawling\nscheduler logs. None for rows that have never errored or have already\nrecovered (status='ok'); the per-row error message string otherwise.",
        "operationId": "list_registry_api_admin_registry_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Registry",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/registry/{table_id}": {
      "delete": {
        "description": "Unregister a table from the system.\n\nFor BQ rows, schedules a background rebuild so the dropped row's\nmaster view is removed from analytics.duckdb (rather than hanging\naround until the next scheduled sync).\n\nFor materialized rows, also removes the canonical parquet at\n`${DATA_DIR}/extracts/<source_type>/data/<id>.parquet` and clears\nthe matching `sync_state` row. Without these two cleanups, the\nmanifest endpoint kept advertising the dropped table to `da sync`\n(sync_state-driven) and the orchestrator's next rebuild could\nresurrect a master view from the leftover parquet (E2E sub-agent\nfinding 2026-05-01).",
        "operationId": "unregister_table_api_admin_registry__table_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Unregister Table",
        "tags": [
          "admin"
        ]
      },
      "put": {
        "description": "Update a registered table's configuration.\n\nFor BQ rows, schedules a background rebuild so the master view picks\nup changes (e.g. a renamed dataset) without waiting for the next\nscheduled sync.",
        "operationId": "update_table_api_admin_registry__table_id__put",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTableRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Table",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/resource-types": {
      "get": {
        "description": "List the resource types defined in app.resource_types.\n\nNo DB call \u2014 these come from the ``ResourceType`` StrEnum. The shape\nis ``[{key, display_name, description, id_format}]`` so the admin UI\ncan render the create-grant form's resource_type dropdown plus a\nplaceholder hint for the ``resource_id`` input.",
        "operationId": "get_resource_types_api_admin_resource_types_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "title": "Response Get Resource Types Api Admin Resource Types Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Resource Types",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/server-config": {
      "get": {
        "description": "Return the current instance.yaml with secrets redacted.\n\nUsed by the /admin/server-config UI to prefill its form. The redacted\npayload mirrors the actual file shape, so the UI doesn't need to know\nthe schema \u2014 it iterates over the editable sections and renders the\nfields it finds. Empty sections still show in the response so the form\nknows to render their headers.",
        "operationId": "get_server_config_api_admin_server_config_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Server Config",
        "tags": [
          "admin"
        ]
      },
      "post": {
        "description": "Patch instance.yaml from the /admin/server-config editor.\n\nAccepts a partial patch keyed by section. Validates sections, refuses\ndanger-zone edits without explicit confirmation, deep-merges into the\ncurrent overlay, writes the file, and emits one audit entry per save\nwith a sanitized diff. Returns ``restart_required=true`` so the UI can\nshow the restart banner \u2014 hot-reload is a separate issue (see #91 Out\nof scope).",
        "operationId": "update_server_config_api_admin_server_config_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerConfigUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Server Config",
        "tags": [
          "admin"
        ]
      }
    },
    "/api/admin/users/{user_id}/effective-access": {
      "get": {
        "description": "List resources the user effectively has access to, with which group\ngrants each one. ``is_admin`` reflects the real Admin-group check but\nno longer short-circuits the response \u2014 admins get the same explicit\ngrant breakdown as everyone else, so the admin viewing a target user\ncan see precisely what's been granted via which group rather than a\nflat \"Full access\" pill that hides the wiring.\n\nNote: actual authorization at runtime still gives Admin-group members\ngod-mode (see ``app.auth.access.is_user_admin``); this endpoint is a\ndebugging/audit view of the explicit grant graph, not the enforcement\nsurface.",
        "operationId": "user_effective_access_api_admin_users__user_id__effective_access_get",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EffectiveAccessResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "User Effective Access",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/users/{user_id}/memberships": {
      "get": {
        "description": "Groups a user belongs to, joined with group metadata for display.\n\nIncludes ``source`` so the UI can distinguish admin-managed memberships\n(deletable from this page) from Google-synced or system-seeded ones\n(read-only \u2014 managed by their own writer).",
        "operationId": "list_user_memberships_api_admin_users__user_id__memberships_get",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UserMembershipResponse"
                  },
                  "title": "Response List User Memberships Api Admin Users  User Id  Memberships Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List User Memberships",
        "tags": [
          "access"
        ]
      },
      "post": {
        "description": "Add a user to a group from the user-centric page.\n\nMirror of POST /api/admin/groups/{id}/members but keyed on the user.\nAlways writes ``source='admin'`` so the row survives Google sync.",
        "operationId": "add_user_to_group_api_admin_users__user_id__memberships_post",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddUserToGroupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserMembershipResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Add User To Group",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/users/{user_id}/memberships/{group_id}": {
      "delete": {
        "description": "Remove a user from a group from the user-centric page.\n\nOnly deletes admin-source rows (Google-sync / system-seed managed\nelsewhere). Last-admin guard: refuse to remove anyone from Admin\nwhen they are the only active admin \u2014 recovery from zero admins\nrequires direct DB access.",
        "operationId": "remove_user_from_group_api_admin_users__user_id__memberships__group_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "group_id",
            "required": true,
            "schema": {
              "title": "Group Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Remove User From Group",
        "tags": [
          "access"
        ]
      }
    },
    "/api/admin/welcome-template": {
      "delete": {
        "operationId": "admin_reset_template_api_admin_welcome_template_delete",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Reset Template",
        "tags": [
          "welcome"
        ]
      },
      "get": {
        "operationId": "admin_get_template_api_admin_welcome_template_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateGetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Get Template",
        "tags": [
          "welcome"
        ]
      },
      "put": {
        "operationId": "admin_put_template_api_admin_welcome_template_put",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Put Template",
        "tags": [
          "welcome"
        ]
      }
    },
    "/api/admin/welcome-template/preview": {
      "post": {
        "description": "Render arbitrary template content against the live context for the\ncalling admin, without persisting. Used by the /admin/agent-prompt editor's\nPreview button so admins can see their edits before saving.",
        "operationId": "admin_preview_template_api_admin_welcome_template_preview_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BannerResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Preview Template",
        "tags": [
          "welcome"
        ]
      }
    },
    "/api/admin/workspace-prompt-template": {
      "delete": {
        "operationId": "admin_reset_workspace_template_api_admin_workspace_prompt_template_delete",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Reset Workspace Template",
        "tags": [
          "claude_md"
        ]
      },
      "get": {
        "operationId": "admin_get_workspace_template_api_admin_workspace_prompt_template_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateGetResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Get Workspace Template",
        "tags": [
          "claude_md"
        ]
      },
      "put": {
        "description": "Save an admin override for the analyst CLAUDE.md template.\n\nTwo-pass Jinja2 validation (autoescape=False, StrictUndefined):\n- Pass 1: render with an authenticated user stub \u2014 catches undefined\n  placeholders and syntax errors.\n- Pass 2: render with a minimal anon-style user stub \u2014 catches templates\n  that hard-depend on admin-only context fields.",
        "operationId": "admin_put_workspace_template_api_admin_workspace_prompt_template_put",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Put Workspace Template",
        "tags": [
          "claude_md"
        ]
      }
    },
    "/api/admin/workspace-prompt-template/preview": {
      "post": {
        "description": "Render arbitrary template content against the live RBAC context for the\ncalling admin, without persisting. Used by the /admin/workspace-prompt editor's\nPreview button so admins can see their edits before saving.",
        "operationId": "admin_preview_workspace_template_api_admin_workspace_prompt_template_preview_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaudeMdResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Preview Workspace Template",
        "tags": [
          "claude_md"
        ]
      }
    },
    "/api/catalog/metrics/{metric_path}": {
      "get": {
        "deprecated": true,
        "description": "Deprecated: use GET /api/metrics/{metric_id} instead.",
        "operationId": "get_metric_api_catalog_metrics__metric_path__get",
        "parameters": [
          {
            "in": "path",
            "name": "metric_path",
            "required": true,
            "schema": {
              "title": "Metric Path",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Metric",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/catalog/profile/{table_name}": {
      "get": {
        "description": "Get profiler data for a specific table.",
        "operationId": "get_table_profile_api_catalog_profile__table_name__get",
        "parameters": [
          {
            "in": "path",
            "name": "table_name",
            "required": true,
            "schema": {
              "title": "Table Name",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Table Profile",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/catalog/profile/{table_name}/refresh": {
      "post": {
        "description": "Re-generate profile for a table on demand.",
        "operationId": "refresh_profile_api_catalog_profile__table_name__refresh_post",
        "parameters": [
          {
            "in": "path",
            "name": "table_name",
            "required": true,
            "schema": {
              "title": "Table Name",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Refresh Profile",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/catalog/tables": {
      "get": {
        "description": "List all available tables from table_registry.",
        "operationId": "list_catalog_tables_api_catalog_tables_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Catalog Tables",
        "tags": [
          "catalog"
        ]
      }
    },
    "/api/data/{table_id}/download": {
      "get": {
        "description": "Stream a parquet file for download. Supports ETag for caching.",
        "operationId": "download_table_api_data__table_id__download_get",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Download Table",
        "tags": [
          "data"
        ]
      }
    },
    "/api/health": {
      "get": {
        "description": "Minimal health check for load balancers / compose healthcheck. No auth required.",
        "operationId": "health_check_api_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Health Check",
        "tags": [
          "health"
        ]
      }
    },
    "/api/health/detailed": {
      "get": {
        "description": "Structured health check with deployment metadata. Requires authentication.",
        "operationId": "health_check_detailed_api_health_detailed_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Health Check Detailed",
        "tags": [
          "health"
        ]
      }
    },
    "/api/marketplaces": {
      "get": {
        "operationId": "list_marketplaces_api_marketplaces_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MarketplaceResponse"
                  },
                  "title": "Response List Marketplaces Api Marketplaces Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Marketplaces",
        "tags": [
          "marketplaces"
        ]
      },
      "post": {
        "operationId": "create_marketplace_api_marketplaces_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMarketplaceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Marketplace",
        "tags": [
          "marketplaces"
        ]
      }
    },
    "/api/marketplaces/sync-all": {
      "post": {
        "description": "Sync every registered marketplace.\n\nWired up so the scheduler service can drive the nightly refresh over\nHTTP. The previous implementation called ``src.marketplace.sync_marketplaces``\nin-process from the scheduler container, which conflicted with the app's\nlong-lived ``system.duckdb`` handle (DuckDB allows only one writer per\nfile across processes). Routing through the app inherits the existing\nconnection without contention.\n\nDeclared ``def`` (not ``async def``) so FastAPI runs it in a thread\npool \u2014 :func:`sync_marketplaces` does blocking I/O (subprocess git\nclones with ``GIT_TIMEOUT_SEC=300`` per repo, DuckDB writes, a\nprocess-wide threading.Lock) and would freeze the event loop for the\nduration of a bulk sync if it ran on the asyncio thread. Health\nchecks, login redirects, and every other concurrent request keep\nserving while the bulk sync churns through the registry.\n\nOne audit row per call summarises the outcome \u2014 per-marketplace details\nlive in ``marketplace_registry`` and the per-call result payload below.",
        "operationId": "trigger_sync_all_api_marketplaces_sync_all_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Sync All",
        "tags": [
          "marketplaces"
        ]
      }
    },
    "/api/marketplaces/{marketplace_id}": {
      "delete": {
        "operationId": "delete_marketplace_api_marketplaces__marketplace_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "marketplace_id",
            "required": true,
            "schema": {
              "title": "Marketplace Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "purge",
            "required": false,
            "schema": {
              "default": false,
              "title": "Purge",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete Marketplace",
        "tags": [
          "marketplaces"
        ]
      },
      "patch": {
        "operationId": "update_marketplace_api_marketplaces__marketplace_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "marketplace_id",
            "required": true,
            "schema": {
              "title": "Marketplace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMarketplaceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketplaceResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Marketplace",
        "tags": [
          "marketplaces"
        ]
      }
    },
    "/api/marketplaces/{marketplace_id}/plugins": {
      "get": {
        "description": "Return the cached plugin list for a marketplace.\n\nRows come from `marketplace_plugins`, which is refreshed from\n`.claude-plugin/marketplace.json` on every successful sync. An\nunsynced marketplace will return an empty list.",
        "operationId": "list_plugins_api_marketplaces__marketplace_id__plugins_get",
        "parameters": [
          {
            "in": "path",
            "name": "marketplace_id",
            "required": true,
            "schema": {
              "title": "Marketplace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PluginResponse"
                  },
                  "title": "Response List Plugins Api Marketplaces  Marketplace Id  Plugins Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Plugins",
        "tags": [
          "marketplaces"
        ]
      }
    },
    "/api/marketplaces/{marketplace_id}/sync": {
      "post": {
        "operationId": "trigger_sync_api_marketplaces__marketplace_id__sync_post",
        "parameters": [
          {
            "in": "path",
            "name": "marketplace_id",
            "required": true,
            "schema": {
              "title": "Marketplace Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Sync",
        "tags": [
          "marketplaces"
        ]
      }
    },
    "/api/me/effective-access": {
      "get": {
        "description": "Same payload as /api/admin/users/{id}/effective-access but scoped to\nthe calling user. Drives the /profile page's read-only access summary \u2014\nso non-admin callers can self-audit without elevation. Admins get the\nsame explicit grant breakdown as everyone else (no short-circuit) so\nthe profile page audits the actual grant graph; runtime authorization\nstill gives Admin god-mode regardless of this list.",
        "operationId": "my_effective_access_api_me_effective_access_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EffectiveAccessResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "My Effective Access",
        "tags": [
          "me"
        ]
      }
    },
    "/api/memory": {
      "get": {
        "description": "List knowledge items with filtering, pagination, search.",
        "operationId": "list_knowledge_api_memory_get",
        "parameters": [
          {
            "in": "query",
            "name": "status_filter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status Filter"
            }
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "in": "query",
            "name": "domain",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Domain"
            }
          },
          {
            "in": "query",
            "name": "source_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Source Type"
            }
          },
          {
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "in": "query",
            "name": "exclude_personal",
            "required": false,
            "schema": {
              "default": true,
              "title": "Exclude Personal",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "updated_at",
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Knowledge",
        "tags": [
          "memory"
        ]
      },
      "post": {
        "operationId": "create_knowledge_api_memory_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKnowledgeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Knowledge",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/approve": {
      "post": {
        "operationId": "admin_approve_api_memory_admin_approve_post",
        "parameters": [
          {
            "in": "query",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Approve",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/audit": {
      "get": {
        "description": "Get governance audit log.\n\nFilters ``corporate_memory.<action>`` rows AND legacy ``km_<action>``\nrows. The dual prefix is here because rows already in the audit log keep\nthe legacy ``km_*`` action name (no migration of historical audit rows \u2014\nthey are write-once); new rows use the ``corporate_memory.*`` namespace.\nSee issue #62 decision E.",
        "operationId": "admin_audit_api_memory_admin_audit_get",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Action"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Audit",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/batch": {
      "post": {
        "description": "Batch governance action on multiple items.",
        "operationId": "admin_batch_api_memory_admin_batch_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Batch",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/bulk-update": {
      "post": {
        "description": "Apply ``updates`` to every id in ``item_ids``. Per-id audit rows.\n\nReturns a per-id status map plus rolled-up convenience lists (200 even on\npartial failure \u2014 the body distinguishes successes from misses).",
        "operationId": "admin_bulk_update_api_memory_admin_bulk_update_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkUpdateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Bulk Update",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/contradictions": {
      "get": {
        "description": "List knowledge contradictions for admin review.\n\nBy default (`exclude_personal=True`), personal items are replaced with\n{id, hidden: true} so the contradiction record is still visible for\ngovernance but personal content is not exposed. Pass exclude_personal=false\nto opt in to full content (KM_ADMIN only \u2014 see ADR Decision 1).",
        "operationId": "admin_contradictions_api_memory_admin_contradictions_get",
        "parameters": [
          {
            "in": "query",
            "name": "resolved",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resolved"
            }
          },
          {
            "in": "query",
            "name": "exclude_personal",
            "required": false,
            "schema": {
              "default": true,
              "title": "Exclude Personal",
              "type": "boolean"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Contradictions",
        "tags": [
          "memory"
        ]
      },
      "post": {
        "description": "Admin endpoint for manually recording a contradiction between two knowledge items.",
        "operationId": "admin_create_contradiction_api_memory_admin_contradictions_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateContradictionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Create Contradiction",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/contradictions/{contradiction_id}/resolve": {
      "post": {
        "description": "Resolve a knowledge contradiction.",
        "operationId": "admin_resolve_contradiction_api_memory_admin_contradictions__contradiction_id__resolve_post",
        "parameters": [
          {
            "in": "path",
            "name": "contradiction_id",
            "required": true,
            "schema": {
              "title": "Contradiction Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveContradictionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Resolve Contradiction",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/duplicate-candidates": {
      "get": {
        "description": "List duplicate-candidate relations for admin review.\n\nPass ``resolved=true`` or ``resolved=false`` to filter; omit both to fetch\nevery state (the original UI default). The web UI keeps surfacing the\nactionable backlog by passing ``resolved=false`` explicitly.\n\nWith ``exclude_personal=true`` (default) personal items in the pair are\nreplaced with ``{id, hidden: true}`` \u2014 the relation row is still visible\nso admins can resolve it, but content stays inside the personal-item\nprivacy boundary (ADR Decision 1 precedent).",
        "operationId": "admin_duplicate_candidates_api_memory_admin_duplicate_candidates_get",
        "parameters": [
          {
            "in": "query",
            "name": "resolved",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resolved"
            }
          },
          {
            "in": "query",
            "name": "exclude_personal",
            "required": false,
            "schema": {
              "default": true,
              "title": "Exclude Personal",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Duplicate Candidates",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/duplicate-candidates/resolve": {
      "post": {
        "description": "Resolve a duplicate-candidate relation.\n\nAdmin chooses: ``duplicate`` (acknowledge), ``different`` (false\npositive), or ``dismissed`` (don't surface again, but no judgment).\nIdempotent re-resolve is rejected with 400 \u2014 the audit trail wants one\ndecision per pair.",
        "operationId": "admin_resolve_duplicate_candidate_api_memory_admin_duplicate_candidates_resolve_post",
        "parameters": [
          {
            "in": "query",
            "name": "item_a_id",
            "required": true,
            "schema": {
              "title": "Item A Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "item_b_id",
            "required": true,
            "schema": {
              "title": "Item B Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveDuplicateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Resolve Duplicate Candidate",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/edit": {
      "post": {
        "operationId": "admin_edit_api_memory_admin_edit_post",
        "parameters": [
          {
            "in": "query",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Edit",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/mandate": {
      "post": {
        "operationId": "admin_mandate_api_memory_admin_mandate_post",
        "parameters": [
          {
            "in": "query",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Mandate",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/pending": {
      "get": {
        "description": "Get pending items queue for admin review.",
        "operationId": "admin_pending_api_memory_admin_pending_get",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Pending",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/reject": {
      "post": {
        "operationId": "admin_reject_api_memory_admin_reject_post",
        "parameters": [
          {
            "in": "query",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Reject",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/revoke": {
      "post": {
        "operationId": "admin_revoke_api_memory_admin_revoke_post",
        "parameters": [
          {
            "in": "query",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Revoke",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/admin/{item_id}": {
      "patch": {
        "description": "Partial update \u2014 accepts category/domain/tags/audience/title/content.\n\nReplaces the narrow ``POST /api/memory/admin/edit`` (kept one release as\na thin alias). Audit row tagged ``corporate_memory.update_item`` records\nwhich fields changed (not the full diff \u2014 keep audit rows compact).",
        "operationId": "admin_patch_item_api_memory_admin__item_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchItemRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Patch Item",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/bundle": {
      "get": {
        "description": "Token-budgeted bundle of knowledge items for AI agent injection.\n\nMandatory items are always included regardless of the token budget.\nApproved items are confidence\u00d7recency-ranked and included until the budget\nis exhausted. Audience-filtered by the caller's group memberships (admins\nsee everything).",
        "operationId": "get_bundle_api_memory_bundle_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Bundle",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/my-contributions": {
      "get": {
        "description": "Get knowledge items contributed by the current user.",
        "operationId": "get_my_contributions_api_memory_my_contributions_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get My Contributions",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/my-votes": {
      "get": {
        "description": "Get current user's votes on all items.",
        "operationId": "get_my_votes_api_memory_my_votes_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get My Votes",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/stats": {
      "get": {
        "description": "Get corporate memory statistics.\n\nAggregations exclude personal items for non-privileged callers \u2014 otherwise\n`total` and the `by_*` counts would change in observable ways when a\ncolleague flags or unflags a personal item, leaking existence info per\nADR Decision 1.\n\nUses SQL aggregation rather than ``repo.list_items()`` to keep the\nendpoint cheap on large knowledge bases (the loader path materializes\nevery row + parses JSON tags/contributors per row, which blocks the\nevent loop on N>1k items). Audience filter mirrors what list_items\napplies: ``audience IS NULL OR audience = 'all'`` plus, for non-admins,\nmembership in any of the caller's group-prefixed audiences.",
        "operationId": "get_stats_api_memory_stats_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Stats",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/tree": {
      "get": {
        "description": "Server-side grouping for the Browse / Group-by tree (issue #62).\n\nReturns ``{groups: [{key, label, count, items: [...]}]}`` already\nRBAC-filtered + chip-filtered. The same ``_effective_groups`` and\n``_can_view_item`` helpers used by ``GET /api/memory`` apply, so a\nnon-admin caller never sees personal items belonging to others, and\naudience-restricted items only surface for members of the audience\ngroup.\n\nOn the ``tag`` axis a single item appears once per tag it holds \u2014 that\nis the intended \"overlapping bucket\" affordance. Every other axis puts\neach item in its single canonical bucket.",
        "operationId": "get_tree_api_memory_tree_get",
        "parameters": [
          {
            "in": "query",
            "name": "axis",
            "required": false,
            "schema": {
              "default": "domain",
              "title": "Axis",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status_filter",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status Filter"
            }
          },
          {
            "in": "query",
            "name": "source_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Source Type"
            }
          },
          {
            "in": "query",
            "name": "audience",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Audience"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "has_duplicate",
            "required": false,
            "schema": {
              "default": false,
              "title": "Has Duplicate",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "exclude_personal",
            "required": false,
            "schema": {
              "default": true,
              "title": "Exclude Personal",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "title": "Page",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "required": false,
            "schema": {
              "default": 50,
              "title": "Per Page",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Tree",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/{item_id}/personal": {
      "post": {
        "description": "Toggle personal/excluded flag on a knowledge item (only by the contributor).",
        "operationId": "toggle_personal_flag_api_memory__item_id__personal_post",
        "parameters": [
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PersonalFlagRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Toggle Personal Flag",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/{item_id}/provenance": {
      "get": {
        "description": "Get source provenance for a knowledge item.",
        "operationId": "get_provenance_api_memory__item_id__provenance_get",
        "parameters": [
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Provenance",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/memory/{item_id}/vote": {
      "post": {
        "operationId": "vote_knowledge_api_memory__item_id__vote_post",
        "parameters": [
          {
            "in": "path",
            "name": "item_id",
            "required": true,
            "schema": {
              "title": "Item Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Vote Knowledge",
        "tags": [
          "memory"
        ]
      }
    },
    "/api/metrics": {
      "get": {
        "description": "List all metric definitions, optionally filtered by category.",
        "operationId": "list_metrics_api_metrics_get",
        "parameters": [
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Metrics",
        "tags": [
          "metrics"
        ]
      }
    },
    "/api/metrics/{metric_id}": {
      "get": {
        "description": "Get a single metric definition by ID.",
        "operationId": "get_metric_api_metrics__metric_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "metric_id",
            "required": true,
            "schema": {
              "title": "Metric Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Metric",
        "tags": [
          "metrics"
        ]
      }
    },
    "/api/query": {
      "post": {
        "description": "Execute SQL against the server analytics DuckDB.",
        "operationId": "execute_query_api_query_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QueryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Execute Query",
        "tags": [
          "query"
        ]
      }
    },
    "/api/query/hybrid": {
      "post": {
        "operationId": "hybrid_query_api_query_hybrid_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HybridQueryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Hybrid Query",
        "tags": [
          "query"
        ]
      }
    },
    "/api/scripts": {
      "get": {
        "description": "List deployed scripts. Admin-only.",
        "operationId": "list_scripts_api_scripts_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Scripts",
        "tags": [
          "scripts"
        ]
      }
    },
    "/api/scripts/deploy": {
      "post": {
        "description": "Deploy a Python script to be run on the server (optionally on schedule). Admin-only.\n\nValidates the source against the safety blocklist BEFORE persisting \u2014\ncloses the Devin claim-fail-retry loop where a script with blocked\npatterns would land in script_registry, fail every scheduler tick, and\nre-claim itself perpetually.",
        "operationId": "deploy_script_api_scripts_deploy_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeployScriptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deploy Script",
        "tags": [
          "scripts"
        ]
      }
    },
    "/api/scripts/run": {
      "post": {
        "description": "Run an ad-hoc Python script (not deployed). Admin-only.",
        "operationId": "run_adhoc_script_api_scripts_run_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunScriptRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run Adhoc Script",
        "tags": [
          "scripts"
        ]
      }
    },
    "/api/scripts/run-due": {
      "post": {
        "description": "Run every deployed script whose ``schedule`` says it is due.\n\nIterates ``script_registry``, skips rows without a schedule (those run\nonly via explicit POST /{id}/run), evaluates ``is_table_due(schedule,\nlast_run)``, and atomically claims each due row via\n``ScriptRepository.claim_for_run``. Execution is queued as a\n``BackgroundTask`` so the response returns immediately \u2014 the sidecar\nmust not block waiting on a long-running script.\n\nConcurrency: ``claim_for_run`` flips ``last_status`` to ``'running'``\ninside the same UPDATE; a script already in that state is skipped on\nsubsequent ticks until the BackgroundTask writes a terminal status via\n``record_run_result``. There is no max-runtime detection in this PR \u2014\nif a BackgroundTask crashes without writing a terminal status, the\nscript stays stuck in ``'running'`` until an operator clears it\nmanually (``UPDATE script_registry SET last_status = NULL WHERE id =\n?``). Documenting this as an accepted v0 limitation; revisit if it\nbites in practice.",
        "operationId": "run_due_scripts_api_scripts_run_due_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run Due Scripts",
        "tags": [
          "scripts"
        ]
      }
    },
    "/api/scripts/{script_id}": {
      "delete": {
        "operationId": "undeploy_script_api_scripts__script_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "script_id",
            "required": true,
            "schema": {
              "title": "Script Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Undeploy Script",
        "tags": [
          "scripts"
        ]
      }
    },
    "/api/scripts/{script_id}/run": {
      "post": {
        "description": "Run a deployed script by ID. Admin-only.",
        "operationId": "run_deployed_script_api_scripts__script_id__run_post",
        "parameters": [
          {
            "in": "path",
            "name": "script_id",
            "required": true,
            "schema": {
              "title": "Script Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Run Deployed Script",
        "tags": [
          "scripts"
        ]
      }
    },
    "/api/settings": {
      "get": {
        "description": "Get current user's sync settings.\n\nThe legacy ``permissions`` field that mirrored ``dataset_permissions``\nwas removed in v19 \u2014 table access is now via ``resource_grants``,\nqueryable through ``GET /api/me/effective-access``.",
        "operationId": "get_settings_api_settings_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Settings",
        "tags": [
          "settings"
        ]
      }
    },
    "/api/settings/dataset": {
      "put": {
        "description": "Enable or disable a dataset for sync.\n\nGate: the user must have a matching ``resource_grants`` row (or be\nAdmin). The user_sync_settings layer is per-user preference, not\nauthorization \u2014 gating the toggle here stops users from enabling\nsync on tables they cannot read.",
        "operationId": "update_dataset_setting_api_settings_dataset_put",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DatasetSettingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Dataset Setting",
        "tags": [
          "settings"
        ]
      }
    },
    "/api/sync/manifest": {
      "get": {
        "description": "Return hash-based manifest of all synced data, filtered per user.",
        "operationId": "sync_manifest_api_sync_manifest_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sync Manifest",
        "tags": [
          "sync"
        ]
      }
    },
    "/api/sync/settings": {
      "get": {
        "description": "Get user's dataset sync settings.",
        "operationId": "get_sync_settings_api_sync_settings_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Sync Settings",
        "tags": [
          "sync"
        ]
      },
      "post": {
        "description": "Update user's dataset sync settings.\n\nA dataset can only be enabled when the user has access (via\n``resource_grants(group, \"table\", dataset)`` or Admin membership). The\nuser_sync_settings layer is per-user preference, not authorization \u2014\nthe gate stops users from enabling sync on tables they cannot read.",
        "operationId": "update_sync_settings_api_sync_settings_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SyncSettingsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Sync Settings",
        "tags": [
          "sync"
        ]
      }
    },
    "/api/sync/table-subscriptions": {
      "get": {
        "description": "Get user's per-table subscription settings.",
        "operationId": "get_table_subscriptions_api_sync_table_subscriptions_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Table Subscriptions",
        "tags": [
          "sync"
        ]
      },
      "post": {
        "description": "Update per-table subscription preferences.",
        "operationId": "update_table_subscriptions_api_sync_table_subscriptions_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TableSubscriptionUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update Table Subscriptions",
        "tags": [
          "sync"
        ]
      }
    },
    "/api/sync/trigger": {
      "post": {
        "description": "Trigger data sync from configured source. Admin only. Runs in background.",
        "operationId": "trigger_sync_api_sync_trigger_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Tables"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Trigger Sync",
        "tags": [
          "sync"
        ]
      }
    },
    "/api/telegram/status": {
      "get": {
        "description": "Get current Telegram link status.",
        "operationId": "telegram_status_api_telegram_status_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Telegram Status",
        "tags": [
          "telegram"
        ]
      }
    },
    "/api/telegram/unlink": {
      "post": {
        "description": "Unlink Telegram account.",
        "operationId": "telegram_unlink_api_telegram_unlink_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Telegram Unlink",
        "tags": [
          "telegram"
        ]
      }
    },
    "/api/telegram/verify": {
      "post": {
        "description": "Verify a code to link Telegram account.",
        "operationId": "telegram_verify_api_telegram_verify_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Telegram Verify",
        "tags": [
          "telegram"
        ]
      }
    },
    "/api/upload/artifacts": {
      "post": {
        "description": "Upload an artifact (HTML report, PNG chart, etc.).",
        "operationId": "upload_artifact_api_upload_artifacts_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_artifact_api_upload_artifacts_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Artifact",
        "tags": [
          "upload"
        ]
      }
    },
    "/api/upload/local-md": {
      "post": {
        "description": "Upload CLAUDE.local.md content for corporate memory processing.",
        "operationId": "upload_local_md_api_upload_local_md_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalMdRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Local Md",
        "tags": [
          "upload"
        ]
      }
    },
    "/api/upload/sessions": {
      "post": {
        "description": "Upload a Claude session transcript (JSONL).",
        "operationId": "upload_session_api_upload_sessions_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_session_api_upload_sessions_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Upload Session",
        "tags": [
          "upload"
        ]
      }
    },
    "/api/users": {
      "get": {
        "operationId": "list_users_api_users_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/UserResponse"
                  },
                  "title": "Response List Users Api Users Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Users",
        "tags": [
          "users"
        ]
      },
      "post": {
        "operationId": "create_user_api_users_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create User",
        "tags": [
          "users"
        ]
      }
    },
    "/api/users/{user_id}": {
      "delete": {
        "operationId": "delete_user_api_users__user_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Delete User",
        "tags": [
          "users"
        ]
      },
      "get": {
        "description": "Single-user payload used by the /admin/users/{id} detail page header\nand the account-status block. Same shape as the list endpoint, so the\npage can reuse the same response shape.",
        "operationId": "get_user_api_users__user_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get User",
        "tags": [
          "users"
        ]
      },
      "patch": {
        "operationId": "update_user_api_users__user_id__patch",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Update User",
        "tags": [
          "users"
        ]
      }
    },
    "/api/users/{user_id}/activate": {
      "post": {
        "operationId": "activate_user_api_users__user_id__activate_post",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Activate User",
        "tags": [
          "users"
        ]
      }
    },
    "/api/users/{user_id}/deactivate": {
      "post": {
        "operationId": "deactivate_user_api_users__user_id__deactivate_post",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Deactivate User",
        "tags": [
          "users"
        ]
      }
    },
    "/api/users/{user_id}/reset-password": {
      "post": {
        "description": "Generate a reset token and (best-effort) email it to the user.",
        "operationId": "reset_password_api_users__user_id__reset_password_post",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reset Password",
        "tags": [
          "users"
        ]
      }
    },
    "/api/users/{user_id}/set-password": {
      "post": {
        "operationId": "set_password_api_users__user_id__set_password_post",
        "parameters": [
          {
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "title": "User Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Set Password",
        "tags": [
          "users"
        ]
      }
    },
    "/api/v2/catalog": {
      "get": {
        "operationId": "catalog_api_v2_catalog_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Catalog",
        "tags": [
          "v2"
        ]
      }
    },
    "/api/v2/sample/{table_id}": {
      "get": {
        "operationId": "sample_api_v2_sample__table_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "n",
            "required": false,
            "schema": {
              "default": 5,
              "maximum": 100,
              "minimum": 1,
              "title": "N",
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Sample",
        "tags": [
          "v2"
        ]
      }
    },
    "/api/v2/scan": {
      "post": {
        "operationId": "scan_endpoint_api_v2_scan_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Raw",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Scan Endpoint",
        "tags": [
          "v2"
        ]
      }
    },
    "/api/v2/scan/estimate": {
      "post": {
        "operationId": "scan_estimate_endpoint_api_v2_scan_estimate_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": true,
                "title": "Raw",
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Scan Estimate Endpoint",
        "tags": [
          "v2"
        ]
      }
    },
    "/api/v2/schema/{table_id}": {
      "get": {
        "operationId": "schema_api_v2_schema__table_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "table_id",
            "required": true,
            "schema": {
              "title": "Table Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Schema",
        "tags": [
          "v2"
        ]
      }
    },
    "/api/version": {
      "get": {
        "description": "Lightweight version info \u2014 cacheable, no DB touch. Used by UI footer badge.",
        "operationId": "version_info_api_version_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Version Info",
        "tags": [
          "health"
        ]
      }
    },
    "/api/welcome": {
      "get": {
        "description": "Return the rendered CLAUDE.md for the authenticated analyst.\n\nThe CLI calls this endpoint during ``da analyst setup`` to write\n``<workspace>/CLAUDE.md``. The content is RBAC-filtered per the\ncalling user.\n\n``server_url`` query param lets the CLI pass the origin it knows so\nthe rendered content references the correct server URL rather than the\nrequest host (which may differ behind a proxy).",
        "operationId": "get_welcome_api_welcome_get",
        "parameters": [
          {
            "description": "Server URL used in rendered CLAUDE.md",
            "in": "query",
            "name": "server_url",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Server URL used in rendered CLAUDE.md",
              "title": "Server Url"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClaudeMdResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Welcome",
        "tags": [
          "claude_md"
        ]
      }
    },
    "/auth/admin/tokens": {
      "get": {
        "operationId": "admin_list_tokens_auth_admin_tokens_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdminTokenItem"
                  },
                  "title": "Response Admin List Tokens Auth Admin Tokens Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin List Tokens",
        "tags": [
          "tokens-admin"
        ]
      }
    },
    "/auth/admin/tokens/{token_id}": {
      "delete": {
        "operationId": "admin_revoke_token_auth_admin_tokens__token_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "token_id",
            "required": true,
            "schema": {
              "title": "Token Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Admin Revoke Token",
        "tags": [
          "tokens-admin"
        ]
      }
    },
    "/auth/bootstrap": {
      "post": {
        "description": "Bootstrap the first admin account.\n\nAllowed when no user has a password_hash yet. This covers:\n(a) No users exist at all.\n(b) Only seed users (created by SEED_ADMIN_EMAIL at startup) exist, which\n    have no password and cannot log in \u2014 bootstrap lets the operator\n    activate them with a password.\n\nIf a user with the given email already exists (e.g. as a seed), this\nendpoint sets its password_hash (or clears it, if no password was supplied \u2014\nuseful for OAuth-only flows) and promotes it to admin.\n\nDeactivates as soon as any user has a password_hash.",
        "operationId": "bootstrap_auth_bootstrap_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BootstrapRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Bootstrap",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/email/send-link": {
      "post": {
        "description": "Send a magic link to the user's email.\n\nWhen SMTP/SendGrid is not configured, or LOCAL_DEV_MODE=1, the link is\nlogged to stderr and returned in the response body so a developer can\nclick it without an email transport.",
        "operationId": "send_magic_link_auth_email_send_link_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MagicLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Send Magic Link",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/email/verify": {
      "get": {
        "description": "Click-through variant \u2014 verifies token, sets cookie, redirects to /dashboard.\n\nThis is the URL we embed in outgoing emails (and the dev-fallback link), so\nclicking it in a mail client logs the user in without a separate API call.\n\nRate limited 10/min per IP for the same reason as the POST variant \u2014\ndon't let the click-through path bypass the brute-force throttle.",
        "operationId": "verify_magic_link_get_auth_email_verify_get",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "required": true,
            "schema": {
              "title": "Email",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": true,
            "schema": {
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Magic Link Get",
        "tags": [
          "auth"
        ]
      },
      "post": {
        "description": "Verify a magic link token and issue JWT (JSON API for programmatic clients).\n\nRate limited 10/min per IP to slow brute-forcing the 32-byte\n``reset_token`` (the same column doubles as the magic-link token).",
        "operationId": "verify_magic_link_auth_email_verify_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MagicLinkVerify"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Verify Magic Link",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/google/callback": {
      "get": {
        "description": "Handle Google OAuth callback.",
        "operationId": "google_callback_auth_google_callback_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Google Callback",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/google/login": {
      "get": {
        "description": "Redirect to Google OAuth.\n\nHonors `?next=<path>` by stashing the sanitized value in the session so the\ncallback can redirect there instead of the default /dashboard. The session\nis the right stash \u2014 OAuth flow is stateful and the `state` param is\nmanaged by Authlib.",
        "operationId": "google_login_auth_google_login_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Google Login",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/password/login": {
      "post": {
        "description": "Login with email + password.",
        "operationId": "password_login_auth_password_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Password Login",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/password/login/web": {
      "post": {
        "description": "Web form login \u2014 sets cookie and redirects to `next` (or /dashboard).",
        "operationId": "password_login_web_auth_password_login_web_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_password_login_web_auth_password_login_web_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Password Login Web",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/password/reset": {
      "get": {
        "description": "Render the 'set new password' form when arriving via reset link.",
        "operationId": "reset_page_auth_password_reset_get",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "default": "",
              "title": "Email",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": false,
            "schema": {
              "default": "",
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reset Page",
        "tags": [
          "auth"
        ]
      },
      "post": {
        "description": "Request a password-reset link. Anti-enumeration: same response regardless.\n\nRate limited at the same 5/min as ``/auth/email/send-link`` \u2014 the\nattack surface is identical (single IP rotates random recipient\naddresses, anti-enumeration response shape masks which addresses\nlanded, attacker burns SMTP / SendGrid quota + spams real users).",
        "operationId": "reset_request_auth_password_reset_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_reset_request_auth_password_reset_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reset Request",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/password/reset/confirm": {
      "post": {
        "description": "Submit a new password using a reset token.\n\nRate limited 10/min per IP to slow brute-force guessing of the 32-byte\nURL-safe ``reset_token`` \u2014 the token is high-entropy but logs / proxy\nreferer leaks have surfaced partial tokens before, and there's no\nreason to allow unbounded attempts.",
        "operationId": "reset_confirm_auth_password_reset_confirm_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_reset_confirm_auth_password_reset_confirm_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Reset Confirm",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/password/setup": {
      "get": {
        "description": "Render the initial 'set password + name' form when arriving via invite link.\n\nNote: we render the form based on URL params only, without a DB lookup, so\nthe response is identical for valid and invalid email/token combinations\n(anti-enumeration). Token validity is checked at POST /setup/confirm.",
        "operationId": "setup_page_auth_password_setup_get",
        "parameters": [
          {
            "in": "query",
            "name": "email",
            "required": false,
            "schema": {
              "default": "",
              "title": "Email",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "token",
            "required": false,
            "schema": {
              "default": "",
              "title": "Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Setup Page",
        "tags": [
          "auth"
        ]
      },
      "post": {
        "description": "Set initial password using setup token (JSON API).\n\nRate limited 10/min per IP \u2014 same throttle as the form sibling\n``/setup/confirm``. Without this, the new web-form throttle is\nbypassable: an attacker brute-forcing the ``setup_token`` just\nswitches to this JSON path and resumes at unbounded RPS.",
        "operationId": "password_setup_auth_password_setup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordSetupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Password Setup",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/password/setup/confirm": {
      "post": {
        "description": "Web form: complete initial password setup via setup token.\n\nRate limited 10/min per IP \u2014 same rationale as ``/reset/confirm``:\nhigh-entropy ``setup_token`` should still not be brute-forceable at\nunbounded RPS in case a partial token leaks via logs / referer.",
        "operationId": "setup_confirm_auth_password_setup_confirm_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_setup_confirm_auth_password_setup_confirm_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Setup Confirm",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/password/setup/request": {
      "post": {
        "description": "Self-service 'Request Access' \u2014 emails a setup link if user is pre-approved and unset.\n\nSame 5/min rate limit as ``/auth/password/reset`` and ``/send-link``\n\u2014 same email-bombing surface (anti-enumeration response, sends mail\non each request).",
        "operationId": "setup_request_auth_password_setup_request_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_setup_request_auth_password_setup_request_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Setup Request",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/token": {
      "post": {
        "description": "Issue a JWT token. Requires password authentication.",
        "operationId": "create_token_auth_token_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Token",
        "tags": [
          "auth"
        ]
      }
    },
    "/auth/tokens": {
      "get": {
        "operationId": "list_tokens_auth_tokens_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TokenListItem"
                  },
                  "title": "Response List Tokens Auth Tokens Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List Tokens",
        "tags": [
          "tokens"
        ]
      },
      "post": {
        "operationId": "create_token_auth_tokens_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateTokenResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Create Token",
        "tags": [
          "tokens"
        ]
      }
    },
    "/auth/tokens/{token_id}": {
      "delete": {
        "operationId": "revoke_token_auth_tokens__token_id__delete",
        "parameters": [
          {
            "in": "path",
            "name": "token_id",
            "required": true,
            "schema": {
              "title": "Token Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Revoke Token",
        "tags": [
          "tokens"
        ]
      },
      "get": {
        "operationId": "get_token_auth_tokens__token_id__get",
        "parameters": [
          {
            "in": "path",
            "name": "token_id",
            "required": true,
            "schema": {
              "title": "Token Id",
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenListItem"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Get Token",
        "tags": [
          "tokens"
        ]
      }
    },
    "/catalog": {
      "get": {
        "operationId": "catalog_catalog_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Catalog",
        "tags": [
          "web"
        ]
      }
    },
    "/cli/download": {
      "get": {
        "operationId": "cli_download_cli_download_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Cli Download",
        "tags": [
          "cli"
        ]
      }
    },
    "/cli/install.sh": {
      "get": {
        "description": "Shell installer \u2014 bakes this server's URL into the generated config.",
        "operationId": "cli_install_script_cli_install_sh_get",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Cli Install Script",
        "tags": [
          "cli"
        ]
      }
    },
    "/cli/latest": {
      "get": {
        "description": "Metadata for the currently-shipped CLI wheel.\n\nConsumed by `da` CLI's auto-update check so it can warn when a newer\nversion is on the server. Public + cacheable \u2014 no secrets here.\nReturns `version=None` when the server has no wheel yet (dev image that\ndidn't run `uv build`).",
        "operationId": "cli_latest_cli_latest_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Cli Latest",
        "tags": [
          "cli"
        ]
      }
    },
    "/cli/wheel/{wheel_name}": {
      "get": {
        "description": "Serve the currently-present wheel at a PEP 427-compliant URL.\n\nOnly the exact filename of the current wheel is honoured; any other\n`wheel_name` returns 404. No filesystem lookup is done from user input \u2014\nthe path param is only compared against `_find_wheel().name`.",
        "operationId": "cli_wheel_versioned_cli_wheel__wheel_name__get",
        "parameters": [
          {
            "in": "path",
            "name": "wheel_name",
            "required": true,
            "schema": {
              "title": "Wheel Name",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cli Wheel Versioned",
        "tags": [
          "cli"
        ]
      }
    },
    "/corporate-memory": {
      "get": {
        "operationId": "corporate_memory_corporate_memory_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Corporate Memory",
        "tags": [
          "web"
        ]
      }
    },
    "/corporate-memory/admin": {
      "get": {
        "operationId": "corporate_memory_admin_corporate_memory_admin_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Corporate Memory Admin",
        "tags": [
          "web"
        ]
      }
    },
    "/dashboard": {
      "get": {
        "operationId": "dashboard_dashboard_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Dashboard",
        "tags": [
          "web"
        ]
      }
    },
    "/first-time-setup": {
      "get": {
        "description": "First-time setup wizard. Redirects to login if users already exist.",
        "operationId": "setup_wizard_first_time_setup_get",
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Setup Wizard",
        "tags": [
          "web"
        ]
      }
    },
    "/install": {
      "get": {
        "description": "Backwards-compat redirect: /install \u2192 /setup (302).\n\nUsing 302 (temporary) rather than 301 (permanent) so browsers/proxies\ndon't cache indefinitely \u2014 if the path ever changes again, cached 301s\nrequire manual cache clearing to recover.",
        "operationId": "install_redirect_install_get",
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Install Redirect",
        "tags": [
          "web"
        ]
      }
    },
    "/login": {
      "get": {
        "operationId": "login_page_login_get",
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Login Page",
        "tags": [
          "web"
        ]
      }
    },
    "/login/email": {
      "get": {
        "description": "Email magic link login form.",
        "operationId": "login_email_page_login_email_get",
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Login Email Page",
        "tags": [
          "web"
        ]
      }
    },
    "/login/password": {
      "get": {
        "description": "Password login form (email + password).",
        "operationId": "login_password_page_login_password_get",
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Login Password Page",
        "tags": [
          "web"
        ]
      }
    },
    "/marketplace.zip": {
      "get": {
        "operationId": "marketplace_zip_marketplace_zip_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Marketplace Zip",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/marketplace/info": {
      "get": {
        "operationId": "marketplace_info_marketplace_info_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Marketplace Info",
        "tags": [
          "marketplace"
        ]
      }
    },
    "/me/debug": {
      "get": {
        "operationId": "me_debug_page_me_debug_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Me Debug Page",
        "tags": [
          "me-debug"
        ]
      }
    },
    "/me/debug/refetch-groups": {
      "post": {
        "description": "Re-issue ``fetch_user_groups`` for the current user and return a\ndiff against the cached ``user_group_members`` snapshot, *without*\nwriting anything. The \"real\" sync runs only at OAuth callback \u2014\nforcing a write here would let any logged-in user trigger a Google\nAdmin SDK call on demand, which is both noisy and a quota footgun.",
        "operationId": "me_debug_refetch_groups_me_debug_refetch_groups_post",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Me Debug Refetch Groups",
        "tags": [
          "me-debug"
        ]
      }
    },
    "/profile": {
      "get": {
        "description": "User profile \u2014 self-service view of identity and group memberships.\n\nRenders the user's account info plus a list of group memberships joined\nagainst ``user_groups`` (with the source label so users can tell which\nwere added by an admin, by Google sync, or seeded at deploy).",
        "operationId": "profile_page_profile_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Profile Page",
        "tags": [
          "web"
        ]
      }
    },
    "/setup": {
      "get": {
        "description": "Setup instructions for the local agent (CLI + Claude Code).\n\nWhen an admin override is saved, the override replaces the auto-generated\nsetup_instructions output everywhere (both the /setup page display and the\ndashboard clipboard CTA).  When no override is set, the live default from\nsetup_instructions.resolve_lines() is used.",
        "operationId": "setup_page_setup_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Setup Page",
        "tags": [
          "web"
        ]
      }
    },
    "/tokens": {
      "get": {
        "description": "My tokens \u2014 ANY signed-in user (incl. admins' own).\n\nAlways shows the user's own PATs. Create + reveal + revoke-own flow.\nAdmins who need the org-wide view go to /admin/tokens.",
        "operationId": "my_tokens_page_tokens_get",
        "parameters": [
          {
            "in": "header",
            "name": "authorization",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "My Tokens Page",
        "tags": [
          "web"
        ]
      }
    },
    "/webhooks/jira": {
      "post": {
        "description": "Receive and process Jira webhook notifications.",
        "operationId": "receive_jira_webhook_webhooks_jira_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Receive Jira Webhook",
        "tags": [
          "jira-webhooks"
        ]
      }
    },
    "/webhooks/jira/health": {
      "get": {
        "description": "Health check for Jira webhook endpoint.",
        "operationId": "jira_webhook_health_webhooks_jira_health_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Jira Webhook Health Webhooks Jira Health Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Jira Webhook Health",
        "tags": [
          "jira-webhooks"
        ]
      }
    }
  }
}
