{
  "openapi": "3.1.0",
  "info": {
    "title": "Archust Platform API",
    "version": "0.2.0",
    "description": "Nền tảng AI content đa tenant — tRPC + REST. Base path `/api/trpc` map sang REST logic `/v1/*` bên dưới. Auth qua Clerk JWT (`Authorization: Bearer <token>` + `x-clerk-org-id`). Mọi endpoint tenant-scoped đều cần `tenantId` resolve từ Clerk org. Nguồn: `server/routers/*` (60 routers, 500+ procedure) + `app/api/**` (18 REST).\n\nĐược generate từ Archust @ 0.2.0 cho archust-docs. Regenerate khi routers đổi.",
    "contact": {
      "name": "Archust",
      "url": "https://github.com/jihto/Archust"
    },
    "license": {
      "name": "Private"
    }
  },
  "servers": [
    {
      "url": "https://app.archust.com",
      "description": "Production"
    },
    {
      "url": "https://staging.archust.com",
      "description": "Staging"
    },
    {
      "url": "http://localhost:3000",
      "description": "Local"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Documents",
      "description": "Kho tài liệu & RAG (`documents` + `doc_chunks`)"
    },
    {
      "name": "Jobs",
      "description": "Công việc & lịch (`jobs` + `jobInstances`)"
    },
    {
      "name": "Job Instances",
      "description": "Phiên chạy theo lịch"
    },
    {
      "name": "Drafts",
      "description": "Vòng đời bản nháp & duyệt"
    },
    {
      "name": "Workflows",
      "description": "Luồng pipeline sinh bài"
    },
    {
      "name": "Publishers",
      "description": "Kết nối CMS (WordPress/Webflow/Ghost/Shopify/Haravan/Webhook)"
    },
    {
      "name": "Chat",
      "description": "Sinh hội thoại & SSE stream"
    },
    {
      "name": "SEO",
      "description": "SEO Control Center, GSC, audit, actions, rank, geo, AI visibility"
    },
    {
      "name": "SEO Plans",
      "description": "Lập kế hoạch tháng"
    },
    {
      "name": "Website Scan",
      "description": "Crawler & snapshot"
    },
    {
      "name": "Media",
      "description": "Tài sản & bản quyền"
    },
    {
      "name": "Analytics",
      "description": "Thống kê content / automation / AI usage"
    },
    {
      "name": "Billing & Credits",
      "description": "Stripe, gói credit, quota, reservations"
    },
    {
      "name": "Team & Settings",
      "description": "Thành viên, brand voice, strategy, rules"
    },
    {
      "name": "Notifications & Activity",
      "description": "Thông báo, audit, watches"
    },
    {
      "name": "Support & Contact",
      "description": "Ticket & liên hệ công khai"
    },
    {
      "name": "Public",
      "description": "Public unauthenticated"
    },
    {
      "name": "Webhooks",
      "description": "Clerk / Stripe inbound + internal workers"
    },
    {
      "name": "Admin",
      "description": "Chỉ superadmin (service-role) — tóm tắt"
    },
    {
      "name": "System",
      "description": "Sức khỏe, diagnostics, vitals"
    }
  ],
  "paths": {
    "/v1/documents": {
      "get": {
        "operationId": "documents.list",
        "tags": [
          "Documents"
        ],
        "summary": "List documents (paginated)",
        "description": "tRPC `documents.list` — `protectedProcedure`. Cache 60s qua `tenantKey`. Yêu cầu tenant member.",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "pending",
                "processing",
                "ready",
                "error"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "fileType",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "pdf",
                "docx",
                "txt",
                "md",
                "url"
              ],
              "default": "all"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "upload",
                "website_scan"
              ],
              "default": "all"
            }
          },
          {
            "name": "sortBy",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "created_at",
                "filename"
              ],
              "default": "created_at"
            }
          },
          {
            "name": "sortOrder",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100000,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedDocuments"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-trpc": {
          "path": "documents.list",
          "type": "query",
          "inputSchema": "documentListInputSchema"
        }
      },
      "post": {
        "operationId": "documents.create",
        "tags": [
          "Documents"
        ],
        "summary": "Create document record (pre-upload)",
        "description": "tRPC `documents.create` — `tenantEditor`. Validate `storagePath` prefix `${orgId}/` and inserts with `status=pending`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "storagePath",
                  "fileType"
                ],
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "storagePath": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024,
                    "example": "org_xxx/my.pdf"
                  },
                  "fileType": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "docx",
                      "doc",
                      "txt",
                      "md",
                      "html",
                      "htm"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        },
        "x-trpc": {
          "path": "documents.create",
          "type": "mutation"
        }
      }
    },
    "/v1/documents/stats": {
      "get": {
        "operationId": "documents.getStats",
        "tags": [
          "Documents"
        ],
        "summary": "Document counts by status",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "pending": {
                      "type": "integer"
                    },
                    "processing": {
                      "type": "integer"
                    },
                    "ready": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.getStats",
          "type": "query"
        }
      }
    },
    "/v1/documents/{id}": {
      "get": {
        "operationId": "documents.getById",
        "tags": [
          "Documents"
        ],
        "summary": "Get document by id",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Document"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        },
        "x-trpc": {
          "path": "documents.getById",
          "type": "query"
        }
      },
      "delete": {
        "operationId": "documents.delete",
        "tags": [
          "Documents"
        ],
        "summary": "Soft-delete document (tenantAdmin)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.delete",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/documents/{id}/content": {
      "get": {
        "operationId": "documents.getContent",
        "tags": [
          "Documents"
        ],
        "summary": "Get document preview content (storage + doc_chunks fallback)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "file_type": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string",
                      "description": "Truncated 250k bytes"
                    },
                    "contentError": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.getContent",
          "type": "query"
        }
      }
    },
    "/v1/documents/{id}/knowledge-metadata": {
      "patch": {
        "operationId": "documents.updateKnowledgeMetadata",
        "tags": [
          "Documents"
        ],
        "summary": "Update knowledge metadata (primary guard)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "metadata"
                ],
                "properties": {
                  "metadata": {
                    "$ref": "#/components/schemas/DocumentKnowledgeMetadata"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "knowledge": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Only one primary allowed"
          }
        },
        "x-trpc": {
          "path": "documents.updateKnowledgeMetadata",
          "type": "mutation",
          "auth": "tenantEditor"
        }
      }
    },
    "/v1/documents/{id}/rename": {
      "post": {
        "operationId": "documents.rename",
        "tags": [
          "Documents"
        ],
        "summary": "Rename document (extension guard)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename"
                ],
                "properties": {
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.rename",
          "type": "mutation"
        }
      }
    },
    "/v1/documents/{id}/archive": {
      "post": {
        "operationId": "documents.archive",
        "tags": [
          "Documents"
        ],
        "summary": "Archive document",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.archive",
          "type": "mutation"
        }
      }
    },
    "/v1/documents/{id}/retry": {
      "post": {
        "operationId": "documents.retryIngestion",
        "tags": [
          "Documents"
        ],
        "summary": "Retry failed ingestion",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.retryIngestion",
          "type": "mutation"
        }
      }
    },
    "/v1/documents/confirm-upload": {
      "post": {
        "operationId": "documents.confirmUpload",
        "tags": [
          "Documents"
        ],
        "summary": "Confirm upload, validate, hash, dedup, reserve credits, trigger ingest-document function",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "fileType",
                  "storagePath"
                ],
                "properties": {
                  "filename": {
                    "type": "string"
                  },
                  "fileType": {
                    "type": "string",
                    "enum": [
                      "pdf",
                      "docx",
                      "doc",
                      "txt",
                      "md",
                      "html",
                      "htm"
                    ]
                  },
                  "storagePath": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Document"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "unchanged": {
                          "type": "boolean",
                          "description": "Hash dedup hit"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.confirmUpload",
          "type": "mutation",
          "cost": "documents.ingest credits reservation"
        }
      }
    },
    "/v1/documents/bulk-delete": {
      "post": {
        "operationId": "documents.bulkDelete",
        "tags": [
          "Documents"
        ],
        "summary": "Bulk soft-delete (1-100, tenantAdmin)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ids"
                ],
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "minItems": 1,
                    "maxItems": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "deleted": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "documents.bulkDelete",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/jobs": {
      "get": {
        "operationId": "jobs.list",
        "tags": [
          "Jobs"
        ],
        "summary": "List jobs",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Job"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.list",
          "type": "query"
        }
      },
      "post": {
        "operationId": "jobs.create",
        "tags": [
          "Jobs"
        ],
        "summary": "Create job",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJobInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.create",
          "type": "mutation",
          "auth": "tenantEditor"
        }
      }
    },
    "/v1/jobs/page": {
      "get": {
        "operationId": "jobs.page",
        "tags": [
          "Jobs"
        ],
        "summary": "Paginated jobs",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Job"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "page": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.page",
          "type": "query"
        }
      }
    },
    "/v1/jobs/stats": {
      "get": {
        "operationId": "jobs.stats",
        "tags": [
          "Jobs"
        ],
        "summary": "Job counts by status",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "active": {
                      "type": "integer"
                    },
                    "paused": {
                      "type": "integer"
                    },
                    "processing": {
                      "type": "integer"
                    },
                    "error": {
                      "type": "integer"
                    },
                    "completed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.stats",
          "type": "query"
        }
      }
    },
    "/v1/jobs/calendar": {
      "get": {
        "operationId": "jobs.calendar",
        "tags": [
          "Jobs"
        ],
        "summary": "Calendar jobs in range",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.calendar",
          "type": "query"
        }
      }
    },
    "/v1/jobs/scheduling-config": {
      "get": {
        "operationId": "jobs.schedulingConfig",
        "tags": [
          "Jobs"
        ],
        "summary": "Get tenant timezone",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timezone": {
                      "type": "string",
                      "example": "Asia/Ho_Chi_Minh"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.schedulingConfig",
          "type": "query"
        }
      },
      "patch": {
        "operationId": "jobs.updateTimezone",
        "tags": [
          "Jobs"
        ],
        "summary": "Update timezone (tenantAdmin)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "timezone"
                ],
                "properties": {
                  "timezone": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.updateTimezone",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/jobs/{id}": {
      "get": {
        "operationId": "jobs.getById",
        "tags": [
          "Jobs"
        ],
        "summary": "Get job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.getById",
          "type": "query"
        }
      },
      "patch": {
        "operationId": "jobs.update",
        "tags": [
          "Jobs"
        ],
        "summary": "Update job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "cronExpression": {
                    "type": "string"
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobs.update",
            "type": "mutation",
            "auth": "tenantEditor"
          }
        },
        "delete": {
          "operationId": "jobs.delete",
          "tags": [
            "Jobs"
          ],
          "summary": "Delete job (tenantAdmin)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobs.delete",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/jobs/{id}/clone": {
        "post": {
          "operationId": "jobs.clone",
          "tags": [
            "Jobs"
          ],
          "summary": "Clone job (paused)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "maxLength": 100
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Job"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobs.clone",
            "type": "mutation"
          }
        }
      },
      "/v1/jobs/{id}/trigger": {
        "post": {
          "operationId": "jobs.trigger",
          "tags": [
            "Jobs"
          ],
          "summary": "Manual trigger -> job_instances pending + generation run",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobs.trigger",
            "type": "mutation"
          }
        }
      },
      "/v1/jobs/{id}/pause": {
        "post": {
          "operationId": "jobs.pause",
          "tags": [
            "Jobs"
          ],
          "summary": "Pause job",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobs.pause",
            "type": "mutation"
          }
        }
      },
      "/v1/jobs/{id}/resume": {
        "post": {
          "operationId": "jobs.resume",
          "tags": [
            "Jobs"
          ],
          "summary": "Resume + recompute next_run_at",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobs.resume",
            "type": "mutation"
          }
        }
      },
      "/v1/jobs/{id}/runs": {
        "get": {
          "operationId": "jobs.getRunHistory",
          "tags": [
            "Jobs"
          ],
          "summary": "Run history (drafts)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 10
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Draft"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobs.getRunHistory",
            "type": "query"
          }
        }
      },
      "/v1/jobs/{id}/analytics": {
        "get": {
          "operationId": "jobs.getAnalytics",
          "tags": [
            "Jobs"
          ],
          "summary": "Job analytics",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "totalDrafts": {
                        "type": "integer"
                      },
                      "approvedDrafts": {
                        "type": "integer"
                      },
                      "publishedDrafts": {
                        "type": "integer"
                      },
                      "avgSeoScore": {
                        "type": "number"
                      },
                      "publishSuccessRate": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobs.getAnalytics",
            "type": "query"
          }
        }
      },
      "/v1/jobs/{id}/instances": {
        "get": {
          "operationId": "jobs.listInstances",
          "tags": [
            "Job Instances"
          ],
          "summary": "List job instances",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/JobInstance"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobs.listInstances",
            "type": "query"
          }
        }
      },
      "/v1/jobs/bulk/{action}": {
        "post": {
          "operationId": "jobs.bulk",
          "tags": [
            "Jobs"
          ],
          "summary": "Bulk pause/resume/trigger/delete (1-50)",
          "parameters": [
            {
              "name": "action",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "enum": [
                  "pause",
                  "resume",
                  "trigger",
                  "delete"
                ]
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jobIds"
                  ],
                  "properties": {
                    "jobIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "minItems": 1,
                      "maxItems": 50
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobs.bulkPause/bulkResume/bulkTrigger/bulkDelete",
            "type": "mutation"
          }
        }
      },
      "/v1/job-instances": {
        "get": {
          "operationId": "jobInstances.list",
          "tags": [
            "Job Instances"
          ],
          "summary": "List instances by date range",
          "parameters": [
            {
              "name": "startDate",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "date-time"
              }
            },
            {
              "name": "endDate",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "date-time"
              }
            },
            {
              "name": "jobId",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "status",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/JobInstance"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobInstances.list",
            "type": "query"
          }
        },
        "post": {
          "operationId": "jobInstances.create",
          "tags": [
            "Job Instances"
          ],
          "summary": "Create instance",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "jobId",
                    "scheduledDate"
                  ],
                  "properties": {
                    "jobId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "scheduledDate": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "dayMode": {
                      "type": "string",
                      "enum": [
                        "generate",
                        "select_existing"
                      ]
                    },
                    "keywords": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "contentInstructions": {
                      "type": "string"
                    },
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "documentIds": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/JobInstance"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobInstances.create",
            "type": "mutation"
          }
        }
      },
      "/v1/job-instances/{id}": {
        "get": {
          "operationId": "jobInstances.getById",
          "tags": [
            "Job Instances"
          ],
          "summary": "Get instance",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/JobInstance"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobInstances.getById",
            "type": "query"
          }
        },
        "patch": {
          "operationId": "jobInstances.update",
          "tags": [
            "Job Instances"
          ],
          "summary": "Update instance",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keywords": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "contentInstructions": {
                      "type": "string"
                    },
                    "dayMode": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobInstances.update",
            "type": "mutation"
          }
        }
      },
      "/v1/job-instances/{id}/progress": {
        "get": {
          "operationId": "jobInstances.getProgress",
          "tags": [
            "Job Instances"
          ],
          "summary": "Run progress DTO",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "step": {
                        "type": "string"
                      },
                      "percent": {
                        "type": "number"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "jobInstances.getProgress",
            "type": "query"
          }
        }
      },
      "/v1/job-instances/{id}/skip": {
        "post": {
          "operationId": "jobInstances.skip",
          "tags": [
            "Job Instances"
          ],
          "summary": "Skip instance",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobInstances.skip",
            "type": "mutation"
          }
        }
      },
      "/v1/job-instances/{id}/generate": {
        "post": {
          "operationId": "jobInstances.generate",
          "tags": [
            "Job Instances"
          ],
          "summary": "Materialize generation run",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "jobInstances.generate",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts": {
        "get": {
          "operationId": "drafts.list",
          "tags": [
            "Drafts"
          ],
          "summary": "List drafts (paginated)",
          "parameters": [
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "default": 1
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 20
              }
            },
            {
              "name": "status",
              "in": "query",
              "schema": {
                "type": "string",
                "enum": [
                  "generating",
                  "reviewing",
                  "approved",
                  "rejected",
                  "published",
                  "archived"
                ]
              }
            },
            {
              "name": "search",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "jobId",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "data": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/Draft"
                        }
                      },
                      "total": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "drafts.list",
            "type": "query"
          }
        },
        "post": {
          "operationId": "drafts.createDraft",
          "tags": [
            "Drafts"
          ],
          "summary": "Create draft manually",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "title"
                  ],
                  "properties": {
                    "title": {
                      "type": "string",
                      "minLength": 1
                    },
                    "content": {
                      "type": "string",
                      "default": "<p></p>"
                    },
                    "jobId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "instanceId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Draft"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "drafts.createDraft",
            "type": "mutation",
            "auth": "tenantEditor"
          }
        }
      },
      "/v1/drafts/stats": {
        "get": {
          "operationId": "drafts.getStats",
          "tags": [
            "Drafts"
          ],
          "summary": "Draft counts",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "total": {
                        "type": "integer"
                      },
                      "byStatus": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "drafts.getStats",
            "type": "query"
          }
        }
      },
      "/v1/drafts/publishable": {
        "get": {
          "operationId": "drafts.publishable",
          "tags": [
            "Drafts"
          ],
          "summary": "List publishable drafts",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Draft"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "drafts.publishable",
            "type": "query"
          }
        }
      },
      "/v1/drafts/{id}": {
        "get": {
          "operationId": "drafts.getById",
          "tags": [
            "Drafts"
          ],
          "summary": "Get draft",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/Draft"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "drafts.getById",
            "type": "query"
          }
        },
        "patch": {
          "operationId": "drafts.update",
          "tags": [
            "Drafts"
          ],
          "summary": "Update draft",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string"
                    },
                    "excerpt": {
                      "type": "string"
                    },
                    "seo_meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.update",
            "type": "mutation",
            "auth": "tenantEditor"
          }
        },
        "delete": {
          "operationId": "drafts.delete",
          "tags": [
            "Drafts"
          ],
          "summary": "Soft delete (tenantAdmin)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.delete",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/drafts/{id}/approve": {
        "post": {
          "operationId": "drafts.approve",
          "tags": [
            "Drafts"
          ],
          "summary": "Approve draft",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.approve",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/{id}/reject": {
        "post": {
          "operationId": "drafts.reject",
          "tags": [
            "Drafts"
          ],
          "summary": "Reject with reason",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "reason"
                  ],
                  "properties": {
                    "reason": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.reject",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/{id}/publish": {
        "post": {
          "operationId": "drafts.publish",
          "tags": [
            "Drafts"
          ],
          "summary": "Publish draft -> publisher_attempts",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publisherConnectionId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "publishAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.publish",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/{id}/status": {
        "post": {
          "operationId": "drafts.updateStatus",
          "tags": [
            "Drafts"
          ],
          "summary": "Update status enum",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "generating",
                        "reviewing",
                        "approved",
                        "rejected",
                        "published",
                        "archived"
                      ]
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.updateStatus",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/{id}/regenerate": {
        "post": {
          "operationId": "drafts.regenerate",
          "tags": [
            "Drafts"
          ],
          "summary": "Regenerate draft",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.regenerate",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/{id}/versions": {
        "get": {
          "operationId": "drafts.getVersionHistory",
          "tags": [
            "Drafts"
          ],
          "summary": "Version history",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.getVersionHistory",
            "type": "query"
          }
        }
      },
      "/v1/drafts/{id}/versions/{version}/restore": {
        "post": {
          "operationId": "drafts.restoreVersion",
          "tags": [
            "Drafts"
          ],
          "summary": "Restore version",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "version",
              "in": "path",
              "required": true,
              "schema": {
                "type": "integer"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.restoreVersion",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/{id}/comments": {
        "get": {
          "operationId": "drafts.listComments",
          "tags": [
            "Drafts"
          ],
          "summary": "List review comments",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.listComments",
            "type": "query"
          }
        },
        "post": {
          "operationId": "drafts.createComment",
          "tags": [
            "Drafts"
          ],
          "summary": "Create comment",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "body"
                  ],
                  "properties": {
                    "body": {
                      "type": "string"
                    },
                    "anchor": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created"
            }
          },
          "x-trpc": {
            "path": "drafts.createComment",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/comments/{commentId}/resolve": {
        "post": {
          "operationId": "drafts.resolveComment",
          "tags": [
            "Drafts"
          ],
          "summary": "Resolve comment",
          "parameters": [
            {
              "name": "commentId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.resolveComment",
            "type": "mutation"
          }
        }
      },
      "/v1/drafts/{id}/assignment": {
        "get": {
          "operationId": "drafts.getAssignment",
          "tags": [
            "Drafts"
          ],
          "summary": "Get review assignment",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.getAssignment",
            "type": "query"
          }
        },
        "post": {
          "operationId": "drafts.assign",
          "tags": [
            "Drafts"
          ],
          "summary": "Assign reviewer (tenantAdmin)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "assigneeId"
                  ],
                  "properties": {
                    "assigneeId": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "drafts.assign",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/publishers": {
        "get": {
          "operationId": "publishers.list",
          "tags": [
            "Publishers"
          ],
          "summary": "List publishers",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PublisherConnection"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "publishers.list",
            "type": "query"
          }
        },
        "post": {
          "operationId": "publishers.create",
          "tags": [
            "Publishers"
          ],
          "summary": "Create publisher connection (tenantAdmin)",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "platform",
                    "name",
                    "siteUrl",
                    "credentials"
                  ],
                  "properties": {
                    "platform": {
                      "type": "string",
                      "enum": [
                        "wordpress",
                        "webflow",
                        "ghost",
                        "shopify",
                        "wordpress_com",
                        "webhook",
                        "haravan"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "siteUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "credentials": {
                      "type": "string",
                      "description": "Encrypted; stored as credentials_enc"
                    },
                    "webhookUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/PublisherConnection"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "publishers.create",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/publishers/paginated": {
        "get": {
          "operationId": "publishers.listPaginated",
          "tags": [
            "Publishers"
          ],
          "summary": "List publishers paginated",
          "parameters": [
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 1
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 20
              }
            },
            {
              "name": "platform",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "search",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "publishers.listPaginated",
            "type": "query"
          }
        }
      },
      "/v1/publishers/{id}": {
        "get": {
          "operationId": "publishers.getById",
          "tags": [
            "Publishers"
          ],
          "summary": "Get publisher",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/PublisherConnection"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "publishers.getById",
            "type": "query"
          }
        },
        "patch": {
          "operationId": "publishers.update",
          "tags": [
            "Publishers"
          ],
          "summary": "Update publisher (tenantAdmin)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "siteUrl": {
                      "type": "string"
                    },
                    "credentials": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "publishers.update",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        },
        "delete": {
          "operationId": "publishers.delete",
          "tags": [
            "Publishers"
          ],
          "summary": "Delete publisher (tenantAdmin)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "publishers.delete",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/publishers/{id}/history": {
        "get": {
          "operationId": "publishers.history",
          "tags": [
            "Publishers"
          ],
          "summary": "Publisher attempts history",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer"
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "publishers.history",
            "type": "query"
          }
        }
      },
      "/v1/publishers/{id}/test-connection": {
        "post": {
          "operationId": "publishers.testConnection",
          "tags": [
            "Publishers"
          ],
          "summary": "Test connection",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "success": {
                        "type": "boolean"
                      },
                      "lastTestedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "publishers.testConnection",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/publishers/{id}/webhook-mapping": {
        "get": {
          "operationId": "publishers.getWebhookMapping",
          "tags": [
            "Publishers"
          ],
          "summary": "Get webhook field mapping",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "publishers.getWebhookMapping",
            "type": "query"
          }
        },
        "put": {
          "operationId": "publishers.updateWebhookMapping",
          "tags": [
            "Publishers"
          ],
          "summary": "Update webhook mapping (tenantAdmin)",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fieldMapping": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "publishers.updateWebhookMapping",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/publishers/attempts/{attemptId}": {
        "get": {
          "operationId": "publishers.attemptPayload",
          "tags": [
            "Publishers"
          ],
          "summary": "Get attempt payload",
          "parameters": [
            {
              "name": "attemptId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "publishers.attemptPayload",
            "type": "query"
          }
        }
      },
      "/v1/chat/conversations": {
        "get": {
          "operationId": "chat.listConversations",
          "tags": [
            "Chat"
          ],
          "summary": "List conversations",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ChatConversation"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "chat.listConversations",
            "type": "query"
          }
        },
        "post": {
          "operationId": "chat.createConversation",
          "tags": [
            "Chat"
          ],
          "summary": "Create conversation",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "title"
                  ],
                  "properties": {
                    "title": {
                      "type": "string",
                      "maxLength": 200
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created",
              "content": {
                "application/json": {
                  "schema": {
                    "$ref": "#/components/schemas/ChatConversation"
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "chat.createConversation",
            "type": "mutation"
          }
        }
      },
      "/v1/chat/conversations/{id}": {
        "get": {
          "operationId": "chat.getHistory",
          "tags": [
            "Chat"
          ],
          "summary": "Get conversation history",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ChatMessage"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "chat.getHistory",
            "type": "query"
          }
        },
        "delete": {
          "operationId": "chat.deleteConversation",
          "tags": [
            "Chat"
          ],
          "summary": "Delete conversation",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "chat.deleteConversation",
            "type": "mutation"
          }
        },
        "patch": {
          "operationId": "chat.renameConversation",
          "tags": [
            "Chat"
          ],
          "summary": "Rename conversation",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "title"
                  ],
                  "properties": {
                    "title": {
                      "type": "string",
                      "maxLength": 200
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "chat.renameConversation",
            "type": "mutation"
          }
        }
      },
      "/v1/chat/stream": {
        "post": {
          "operationId": "chat.stream",
          "tags": [
            "Chat"
          ],
          "summary": "SSE chat stream (REST)",
          "description": "REST `POST /api/chat/stream` — brandVoice -> LLM, writes `content_generation_runs` + `chat_messages`. Auth via Clerk.",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "conversationId",
                    "prompt"
                  ],
                  "properties": {
                    "conversationId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "messageId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "prompt": {
                      "type": "string"
                    },
                    "brief": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "SSE stream",
              "content": {
                "text/event-stream": {
                  "schema": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "/v1/chat/generate-draft": {
        "post": {
          "operationId": "chat.generateDraft",
          "tags": [
            "Chat"
          ],
          "summary": "Generate draft via chat",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "conversationId",
                    "prompt"
                  ],
                  "properties": {
                    "conversationId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "prompt": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "chat.generateDraft",
            "type": "mutation"
          }
        }
      },
      "/v1/chat/websearch-quota": {
        "get": {
          "operationId": "chat.getWebsearchQuota",
          "tags": [
            "Chat"
          ],
          "summary": "Websearch quota",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "used": {
                        "type": "integer"
                      },
                      "quota": {
                        "type": "integer"
                      },
                      "remaining": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "chat.getWebsearchQuota",
            "type": "query"
          }
        }
      },
      "/v1/seo/dashboard": {
        "get": {
          "operationId": "seo.getDashboard",
          "tags": [
            "SEO"
          ],
          "summary": "SEO dashboard composite",
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.getDashboard",
            "type": "query"
          }
        }
      },
      "/v1/seo/overview": {
        "get": {
          "operationId": "seo.getOverview",
          "tags": [
            "SEO"
          ],
          "summary": "SEO overview range",
          "parameters": [
            {
              "name": "range",
              "in": "query",
              "schema": {
                "type": "string",
                "enum": [
                  "7d",
                  "28d",
                  "90d"
                ]
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.getOverview",
            "type": "query"
          }
        }
      },
      "/v1/seo/control-center": {
        "get": {
          "operationId": "seo.getControlCenter",
          "tags": [
            "SEO"
          ],
          "summary": "Control center",
          "parameters": [
            {
              "name": "siteId",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.getControlCenter",
            "type": "query"
          }
        }
      },
      "/v1/seo/sites": {
        "get": {
          "operationId": "seo.listSites",
          "tags": [
            "SEO"
          ],
          "summary": "List SEO sites",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "siteUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "seo.listSites",
            "type": "query"
          }
        }
      },
      "/v1/seo/pages": {
        "get": {
          "operationId": "seo.listPages",
          "tags": [
            "SEO"
          ],
          "summary": "List pages",
          "parameters": [
            {
              "name": "siteId",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 1
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 20
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.listPages",
            "type": "query"
          }
        }
      },
      "/v1/seo/issues": {
        "get": {
          "operationId": "seo.listIssues",
          "tags": [
            "SEO"
          ],
          "summary": "List issues",
          "parameters": [
            {
              "name": "siteId",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "severity",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.listIssues",
            "type": "query"
          }
        }
      },
      "/v1/seo/recommendations": {
        "get": {
          "operationId": "seo.listRecommendations",
          "tags": [
            "SEO"
          ],
          "summary": "List recommendations",
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.listRecommendations",
            "type": "query"
          }
        }
      },
      "/v1/seo/actions": {
        "get": {
          "operationId": "seo.listActions",
          "tags": [
            "SEO"
          ],
          "summary": "List actions",
          "parameters": [
            {
              "name": "status",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.listActions",
            "type": "query"
          }
        },
        "post": {
          "operationId": "seo.createAction",
          "tags": [
            "SEO"
          ],
          "summary": "Create action",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "siteId",
                    "title"
                  ],
                  "properties": {
                    "siteId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "title": {
                      "type": "string"
                    },
                    "issueId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created"
            }
          },
          "x-trpc": {
            "path": "seo.createAction",
            "type": "mutation"
          }
        }
      },
      "/v1/seo/actions/{id}/status": {
        "patch": {
          "operationId": "seo.updateActionStatus",
          "tags": [
            "SEO"
          ],
          "summary": "Update action status",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "backlog",
                        "in_progress",
                        "blocked",
                        "done",
                        "cancelled"
                      ]
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.updateActionStatus",
            "type": "mutation"
          }
        }
      },
      "/v1/seo/audits/run": {
        "post": {
          "operationId": "seo.runFullAudit",
          "tags": [
            "SEO"
          ],
          "summary": "Run full audit",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "siteUrl": {
                      "type": "string",
                      "format": "uri"
                    },
                    "maxPages": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Queued"
            }
          },
          "x-trpc": {
            "path": "seo.runFullAudit",
            "type": "mutation"
          }
        }
      },
      "/v1/seo/audits/{id}/status": {
        "get": {
          "operationId": "seo.getAuditStatus",
          "tags": [
            "SEO"
          ],
          "summary": "Get audit status",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.getAuditStatus",
            "type": "query"
          }
        }
      },
      "/v1/seo/gsc/auth-url": {
        "get": {
          "operationId": "seo.getGscAuthUrl",
          "tags": [
            "SEO"
          ],
          "summary": "GSC OAuth URL",
          "parameters": [
            {
              "name": "redirectUri",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "clientId",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "seo.getGscAuthUrl",
            "type": "query"
          }
        }
      },
      "/v1/seo/gsc/connect": {
        "post": {
          "operationId": "seo.connectGsc",
          "tags": [
            "SEO"
          ],
          "summary": "Connect GSC",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "code"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "clientId": {
                      "type": "string"
                    },
                    "clientSecret": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.connectGsc",
            "type": "mutation"
          }
        }
      },
      "/v1/seo/geo/prompts": {
        "get": {
          "operationId": "seo.listGeoPrompts",
          "tags": [
            "SEO"
          ],
          "summary": "Geo prompts (derived)",
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        },
        "post": {
          "operationId": "seo.createGeoPrompt",
          "tags": [
            "SEO"
          ],
          "summary": "Create geo prompt",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "siteId",
                    "prompt"
                  ],
                  "properties": {
                    "siteId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "prompt": {
                      "type": "string"
                    },
                    "intent": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created"
            }
          },
          "x-trpc": {
            "path": "seo.createGeoPrompt",
            "type": "mutation"
          }
        }
      },
      "/v1/seo/rank-tracking": {
        "get": {
          "operationId": "seo.getRankTracking",
          "tags": [
            "SEO"
          ],
          "summary": "Get rank tracking",
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.getRankTracking",
            "type": "query"
          }
        },
        "post": {
          "operationId": "seo.saveTrackedKeywords",
          "tags": [
            "SEO"
          ],
          "summary": "Save tracked keywords (max 100)",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "trackedKeywords": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "maxItems": 100
                    },
                    "competitors": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.saveTrackedKeywords",
            "type": "mutation"
          }
        }
      },
      "/v1/seo/scan": {
        "post": {
          "operationId": "seo.runOnPageScan",
          "tags": [
            "SEO"
          ],
          "summary": "Run on-page scan",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "seo.runOnPageScan",
            "type": "mutation"
          }
        }
      },
      "/v1/website-scan/scan": {
        "post": {
          "operationId": "websiteScan.scanWebsite",
          "tags": [
            "Website Scan"
          ],
          "summary": "Crawl website",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "maxPages": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Queued"
            }
          },
          "x-trpc": {
            "path": "websiteScan.scanWebsite",
            "type": "mutation"
          }
        }
      },
      "/v1/website-scan/status": {
        "get": {
          "operationId": "websiteScan.getActiveScan",
          "tags": [
            "Website Scan"
          ],
          "summary": "Active scan",
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "websiteScan.getActiveScan",
            "type": "query"
          }
        }
      },
      "/v1/website-scan/history": {
        "get": {
          "operationId": "websiteScan.getHistory",
          "tags": [
            "Website Scan"
          ],
          "summary": "Scan history",
          "parameters": [
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 20
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "websiteScan.getHistory",
            "type": "query"
          }
        }
      },
      "/v1/website-scan/snapshots": {
        "get": {
          "operationId": "websiteScan.listIntelligenceSnapshots",
          "tags": [
            "Website Scan"
          ],
          "summary": "Intelligence snapshots",
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "websiteScan.listIntelligenceSnapshots",
            "type": "query"
          }
        }
      },
      "/v1/media": {
        "get": {
          "operationId": "media.list",
          "tags": [
            "Media"
          ],
          "summary": "List media assets",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "media.list",
            "type": "query"
          }
        },
        "post": {
          "operationId": "media.upload",
          "tags": [
            "Media"
          ],
          "summary": "Upload media (base64)",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "file",
                    "filename"
                  ],
                  "properties": {
                    "file": {
                      "type": "string",
                      "description": "base64"
                    },
                    "filename": {
                      "type": "string"
                    },
                    "mimeType": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Uploaded"
            }
          },
          "x-trpc": {
            "path": "media.upload",
            "type": "mutation"
          }
        }
      },
      "/v1/media/upload-session": {
        "post": {
          "operationId": "media.createUploadSession",
          "tags": [
            "Media"
          ],
          "summary": "Create upload session (signed URL)",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "filename",
                    "mimeType",
                    "size"
                  ],
                  "properties": {
                    "filename": {
                      "type": "string"
                    },
                    "mimeType": {
                      "type": "string",
                      "enum": [
                        "image/png",
                        "image/jpeg",
                        "image/webp"
                      ]
                    },
                    "size": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "media.createUploadSession",
            "type": "mutation"
          }
        }
      },
      "/v1/workflows/{jobId}": {
        "get": {
          "operationId": "workflows.list",
          "tags": [
            "Workflows"
          ],
          "summary": "List workflows for job",
          "parameters": [
            {
              "name": "jobId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "workflows.list",
            "type": "query"
          }
        }
      },
      "/v1/workflows/{jobId}/projection": {
        "get": {
          "operationId": "workflows.getProjection",
          "tags": [
            "Workflows"
          ],
          "summary": "Get workflow projection",
          "parameters": [
            {
              "name": "jobId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "jobInstanceId",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "workflows.getProjection",
            "type": "query"
          }
        }
      },
      "/v1/workflows/instances/{instanceId}/nodes/{nodeKey}/retry": {
        "post": {
          "operationId": "workflows.retryNode",
          "tags": [
            "Workflows"
          ],
          "summary": "Retry node (knowledge/research/writer...)",
          "parameters": [
            {
              "name": "instanceId",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "name": "nodeKey",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "enum": [
                  "knowledge",
                  "research",
                  "writer",
                  "publisher",
                  "approval"
                ]
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "workflows.retryNode",
            "type": "mutation"
          }
        }
      },
      "/v1/analytics/overview": {
        "get": {
          "operationId": "analytics.overview",
          "tags": [
            "Analytics"
          ],
          "summary": "Analytics overview",
          "parameters": [
            {
              "name": "period",
              "in": "query",
              "schema": {
                "type": "string",
                "enum": [
                  "month"
                ],
                "default": "month"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "analytics.overview",
            "type": "query"
          }
        }
      },
      "/v1/analytics/posts": {
        "get": {
          "operationId": "analytics.posts",
          "tags": [
            "Analytics"
          ],
          "summary": "Posts analytics paginated",
          "parameters": [
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer"
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer"
              }
            },
            {
              "name": "from",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "date"
              }
            },
            {
              "name": "to",
              "in": "query",
              "schema": {
                "type": "string",
                "format": "date"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "analytics.posts",
            "type": "query"
          }
        }
      },
      "/v1/billing/current-plan": {
        "get": {
          "operationId": "billing.currentPlan",
          "tags": [
            "Billing & Credits"
          ],
          "summary": "Current plan + quota",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "plan": {
                        "type": "string",
                        "enum": [
                          "starter",
                          "pro",
                          "enterprise"
                        ]
                      },
                      "postsQuota": {
                        "type": "integer"
                      },
                      "postsUsed": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "billing.currentPlan",
            "type": "query"
          }
        }
      },
      "/v1/billing/portal": {
        "post": {
          "operationId": "billing.createPortalSession",
          "tags": [
            "Billing & Credits"
          ],
          "summary": "Create Stripe portal session",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "billing.createPortalSession",
            "type": "mutation"
          }
        }
      },
      "/v1/credits/balance": {
        "get": {
          "operationId": "credits.balance",
          "tags": [
            "Billing & Credits"
          ],
          "summary": "Credit balance",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "balance": {
                        "type": "number"
                      },
                      "tenantId": {
                        "type": "string",
                        "format": "uuid"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "credits.balance",
            "type": "query"
          }
        }
      },
      "/v1/credits/transactions": {
        "get": {
          "operationId": "credits.transactions",
          "tags": [
            "Billing & Credits"
          ],
          "summary": "Credit transactions",
          "parameters": [
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 20
              }
            },
            {
              "name": "offset",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 0
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "credits.transactions",
            "type": "query"
          }
        }
      },
      "/v1/credits/quote": {
        "post": {
          "operationId": "credits.quote",
          "tags": [
            "Billing & Credits"
          ],
          "summary": "Quote credits for operation",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "operationKey"
                  ],
                  "properties": {
                    "operationKey": {
                      "type": "string",
                      "enum": [
                        "chat.message",
                        "generation.blog",
                        "documents.ingest"
                      ]
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "credits.quote",
            "type": "mutation"
          }
        }
      },
      "/v1/credits/checkout": {
        "post": {
          "operationId": "credits.createCheckoutSession",
          "tags": [
            "Billing & Credits"
          ],
          "summary": "Stripe checkout for package",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "packageId"
                  ],
                  "properties": {
                    "packageId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "url": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "credits.createCheckoutSession",
            "type": "mutation"
          }
        }
      },
      "/v1/notifications": {
        "get": {
          "operationId": "notifications.list",
          "tags": [
            "Notifications & Activity"
          ],
          "summary": "List notifications",
          "parameters": [
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 1
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 20
              }
            },
            {
              "name": "unreadOnly",
              "in": "query",
              "schema": {
                "type": "boolean"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "notifications.list",
            "type": "query"
          }
        },
        "post": {
          "operationId": "notifications.markAllRead",
          "tags": [
            "Notifications & Activity"
          ],
          "summary": "Mark all read",
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "notifications.markAllRead",
            "type": "mutation"
          }
        }
      },
      "/v1/notifications/{id}/read": {
        "post": {
          "operationId": "notifications.markRead",
          "tags": [
            "Notifications & Activity"
          ],
          "summary": "Mark one read",
          "parameters": [
            {
              "name": "id",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "format": "uuid"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "notifications.markRead",
            "type": "mutation"
          }
        }
      },
      "/v1/activity-log": {
        "get": {
          "operationId": "activityLog.list",
          "tags": [
            "Notifications & Activity"
          ],
          "summary": "Tenant audit log",
          "parameters": [
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer",
                "default": 1
              }
            },
            {
              "name": "limit",
              "in": "query",
              "schema": {
                "type": "integer",
                "minimum": 1,
                "maximum": 100,
                "default": 20
              }
            },
            {
              "name": "type",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "actionType",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "activityLog.list",
            "type": "query"
          }
        }
      },
      "/v1/team/members": {
        "get": {
          "operationId": "team.listMembers",
          "tags": [
            "Team & Settings"
          ],
          "summary": "List org members (tenantAdmin)",
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "team.listMembers",
            "type": "query",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/team/invite": {
        "post": {
          "operationId": "team.invite",
          "tags": [
            "Team & Settings"
          ],
          "summary": "Invite member",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "email",
                    "role"
                  ],
                  "properties": {
                    "email": {
                      "type": "string",
                      "format": "email"
                    },
                    "role": {
                      "type": "string",
                      "enum": [
                        "org:admin",
                        "org:member"
                      ]
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "team.invite",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/settings/brand-voice": {
        "get": {
          "operationId": "settings.getBrandVoice",
          "tags": [
            "Team & Settings"
          ],
          "summary": "Get brand voice",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "companyName": {
                        "type": "string"
                      },
                      "tone": {
                        "type": "string"
                      },
                      "industry": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "x-trpc": {
            "path": "settings.getBrandVoice",
            "type": "query"
          }
        },
        "put": {
          "operationId": "settings.saveBrandVoice",
          "tags": [
            "Team & Settings"
          ],
          "summary": "Save brand voice (tenantAdmin)",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "companyName": {
                      "type": "string"
                    },
                    "website": {
                      "type": "string"
                    },
                    "tone": {
                      "type": "string"
                    },
                    "industry": {
                      "type": "string"
                    },
                    "keywords": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "settings.saveBrandVoice",
            "type": "mutation",
            "auth": "tenantAdmin"
          }
        }
      },
      "/v1/support/tickets": {
        "get": {
          "operationId": "support.list",
          "tags": [
            "Support & Contact"
          ],
          "summary": "List support tickets",
          "parameters": [
            {
              "name": "status",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "page",
              "in": "query",
              "schema": {
                "type": "integer"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          },
          "x-trpc": {
            "path": "support.list",
            "type": "query"
          }
        },
        "post": {
          "operationId": "support.create",
          "tags": [
            "Support & Contact"
          ],
          "summary": "Create ticket",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "title",
                    "description"
                  ],
                  "properties": {
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "priority": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "Created"
            }
          },
          "x-trpc": {
            "path": "support.create",
            "type": "mutation"
          }
        }
      },
      "/api/blogs": {
        "get": {
          "operationId": "publicBlogs",
          "tags": [
            "Public"
          ],
          "summary": "Public published blogs by tenant",
          "description": "REST `GET /api/blogs` — public, resolves tenant via `x-tenant-id` header or default. Returns `status=published` drafts.",
          "security": [],
          "parameters": [
            {
              "name": "x-tenant-id",
              "in": "header",
              "schema": {
                "type": "string",
                "format": "uuid"
              },
              "description": "Tenant id for public blog domain mapping"
            }
          ],
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Draft"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "/api/upload/job-image": {
        "post": {
          "operationId": "uploadJobImage",
          "tags": [
            "Media"
          ],
          "summary": "Upload job image (multipart)",
          "description": "REST `POST /api/upload/job-image` — Clerk auth, Supabase Storage `job-images` bucket `${tenantId}/filename`, 4MB limit, image/* only.",
          "requestBody": {
            "required": true,
            "content": {
              "multipart/form-data": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "file": {
                      "type": "string",
                      "format": "binary"
                    }
                  },
                  "required": [
                    "file"
                  ]
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "publicUrl": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "/api/trpc/{trpc}": {
        "get": {
          "operationId": "trpc.get",
          "tags": [
            "System"
          ],
          "summary": "tRPC GET handler (batch)",
          "description": "All tRPC queries via GET `/api/trpc/<path>?batch=1&input=...` — prefer logical REST paths above for docs.",
          "parameters": [
            {
              "name": "trpc",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "example": "documents.list"
              }
            },
            {
              "name": "batch",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "input",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        },
        "post": {
          "operationId": "trpc.post",
          "tags": [
            "System"
          ],
          "summary": "tRPC POST handler (mutations)",
          "parameters": [
            {
              "name": "trpc",
              "in": "path",
              "required": true,
              "schema": {
                "type": "string",
                "example": "jobs.create"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/api/webhooks/clerk": {
        "post": {
          "operationId": "webhooks.clerk",
          "tags": [
            "Webhooks"
          ],
          "summary": "Clerk webhook (Svix)",
          "security": [],
          "parameters": [
            {
              "name": "svix-id",
              "in": "header",
              "required": true,
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "svix-timestamp",
              "in": "header",
              "required": true,
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "svix-signature",
              "in": "header",
              "required": true,
              "schema": {
                "type": "string"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "user.created",
                        "organization.created",
                        "organization.updated",
                        "organization.deleted",
                        "session.created"
                      ]
                    },
                    "data": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/api/webhooks/stripe": {
        "post": {
          "operationId": "webhooks.stripe",
          "tags": [
            "Webhooks"
          ],
          "summary": "Stripe webhook",
          "security": [],
          "parameters": [
            {
              "name": "stripe-signature",
              "in": "header",
              "required": true,
              "schema": {
                "type": "string"
              }
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "checkout.session.completed",
                        "customer.subscription.updated",
                        "customer.subscription.deleted",
                        "invoice.payment_succeeded"
                      ]
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/api/internal/publisher-worker": {
        "post": {
          "operationId": "internal.publisherWorker",
          "tags": [
            "Webhooks"
          ],
          "summary": "Internal publisher worker (lease & execute)",
          "security": [
            {
              "internalSecret": []
            }
          ],
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tenantId",
                    "draftId",
                    "publisherConnectionId",
                    "attemptId"
                  ],
                  "properties": {
                    "tenantId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "draftId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "publisherConnectionId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "attemptId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/api/health/tenant": {
        "get": {
          "operationId": "health.tenant",
          "tags": [
            "System"
          ],
          "summary": "Tenant context health",
          "responses": {
            "200": {
              "description": "OK",
              "content": {
                "application/json": {
                  "schema": {
                    "type": "object",
                    "properties": {
                      "healthy": {
                        "type": "boolean"
                      },
                      "tenantFound": {
                        "type": "boolean"
                      },
                      "orgMappingMatches": {
                        "type": "boolean"
                      },
                      "tenantId": {
                        "type": "string",
                        "format": "uuid",
                        "nullable": true
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "/api/diagnostics": {
        "get": {
          "operationId": "diagnostics.get",
          "tags": [
            "System"
          ],
          "summary": "Diagnostics probe (DB + Redis + Supabase)",
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        },
        "post": {
          "operationId": "diagnostics.post",
          "tags": [
            "System"
          ],
          "summary": "Ingest diagnostics event",
          "requestBody": {
            "required": true,
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "responses": {
            "200": {
              "description": "OK"
            }
          }
        }
      },
      "/api/admin/tenants/export": {
        "get": {
          "operationId": "admin.tenantsExport",
          "tags": [
            "Admin"
          ],
          "summary": "Export tenants CSV (superadmin)",
          "security": [
            {
              "bearerAuth": []
            }
          ],
          "parameters": [
            {
              "name": "search",
              "in": "query",
              "schema": {
                "type": "string"
              }
            },
            {
              "name": "plan",
              "in": "query",
              "schema": {
                "type": "string"
              }
            }
          ],
          "responses": {
            "200": {
              "description": "CSV/JSON stream"
            }
          }
        }
      }
    },
    "/v1/jobs/{id}/clone": {
      "post": {
        "operationId": "jobs.clone",
        "tags": [
          "Jobs"
        ],
        "summary": "Clone job (paused)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Job"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.clone",
          "type": "mutation"
        }
      }
    },
    "/v1/jobs/{id}/trigger": {
      "post": {
        "operationId": "jobs.trigger",
        "tags": [
          "Jobs"
        ],
        "summary": "Manual trigger",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.trigger",
          "type": "mutation"
        }
      }
    },
    "/v1/jobs/{id}/pause": {
      "post": {
        "operationId": "jobs.pause",
        "tags": [
          "Jobs"
        ],
        "summary": "Pause job",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.pause",
          "type": "mutation"
        }
      }
    },
    "/v1/jobs/{id}/resume": {
      "post": {
        "operationId": "jobs.resume",
        "tags": [
          "Jobs"
        ],
        "summary": "Resume",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.resume",
          "type": "mutation"
        }
      }
    },
    "/v1/jobs/{id}/runs": {
      "get": {
        "operationId": "jobs.getRunHistory",
        "tags": [
          "Jobs"
        ],
        "summary": "Run history",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Draft"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.getRunHistory",
          "type": "query"
        }
      }
    },
    "/v1/jobs/{id}/analytics": {
      "get": {
        "operationId": "jobs.getAnalytics",
        "tags": [
          "Jobs"
        ],
        "summary": "Job analytics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalDrafts": {
                      "type": "integer"
                    },
                    "approvedDrafts": {
                      "type": "integer"
                    },
                    "publishedDrafts": {
                      "type": "integer"
                    },
                    "avgSeoScore": {
                      "type": "number"
                    },
                    "publishSuccessRate": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.getAnalytics",
          "type": "query"
        }
      }
    },
    "/v1/jobs/{id}/instances": {
      "get": {
        "operationId": "jobs.listInstances",
        "tags": [
          "Job Instances"
        ],
        "summary": "List instances",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobInstance"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobs.listInstances",
          "type": "query"
        }
      }
    },
    "/v1/jobs/bulk/{action}": {
      "post": {
        "operationId": "jobs.bulk",
        "tags": [
          "Jobs"
        ],
        "summary": "Bulk pause/resume/trigger/delete",
        "parameters": [
          {
            "name": "action",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "pause",
                "resume",
                "trigger",
                "delete"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jobIds"
                ],
                "properties": {
                  "jobIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "minItems": 1,
                    "maxItems": 50
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.bulk",
          "type": "mutation"
        }
      }
    },
    "/v1/job-instances": {
      "get": {
        "operationId": "jobInstances.list",
        "tags": [
          "Job Instances"
        ],
        "summary": "List instances by range",
        "parameters": [
          {
            "name": "startDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "endDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "jobId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobInstance"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobInstances.list",
          "type": "query"
        }
      },
      "post": {
        "operationId": "jobInstances.create",
        "tags": [
          "Job Instances"
        ],
        "summary": "Create instance",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jobId",
                  "scheduledDate"
                ],
                "properties": {
                  "jobId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "scheduledDate": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "dayMode": {
                    "type": "string",
                    "enum": [
                      "generate",
                      "select_existing"
                    ]
                  },
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "contentInstructions": {
                    "type": "string"
                  },
                  "images": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "documentIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobInstance"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobInstances.create",
          "type": "mutation"
        }
      }
    },
    "/v1/job-instances/{id}": {
      "get": {
        "operationId": "jobInstances.getById",
        "tags": [
          "Job Instances"
        ],
        "summary": "Get instance",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobInstance"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobInstances.getById",
          "type": "query"
        }
      },
      "patch": {
        "operationId": "jobInstances.update",
        "tags": [
          "Job Instances"
        ],
        "summary": "Update instance",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "contentInstructions": {
                    "type": "string"
                  },
                  "dayMode": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobInstances.update",
          "type": "mutation"
        }
      }
    },
    "/v1/job-instances/{id}/progress": {
      "get": {
        "operationId": "jobInstances.getProgress",
        "tags": [
          "Job Instances"
        ],
        "summary": "Progress DTO",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "step": {
                      "type": "string"
                    },
                    "percent": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "jobInstances.getProgress",
          "type": "query"
        }
      }
    },
    "/v1/job-instances/{id}/skip": {
      "post": {
        "operationId": "jobInstances.skip",
        "tags": [
          "Job Instances"
        ],
        "summary": "Skip",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobInstances.skip",
          "type": "mutation"
        }
      }
    },
    "/v1/job-instances/{id}/generate": {
      "post": {
        "operationId": "jobInstances.generate",
        "tags": [
          "Job Instances"
        ],
        "summary": "Materialize run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobInstances.generate",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts": {
      "get": {
        "operationId": "drafts.list",
        "tags": [
          "Drafts"
        ],
        "summary": "List drafts paginated",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "generating",
                "reviewing",
                "approved",
                "rejected",
                "published",
                "archived"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jobId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Draft"
                      }
                    },
                    "total": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "drafts.list",
          "type": "query"
        }
      },
      "post": {
        "operationId": "drafts.createDraft",
        "tags": [
          "Drafts"
        ],
        "summary": "Create draft",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "content": {
                    "type": "string",
                    "default": "<p></p>"
                  },
                  "jobId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "instanceId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Draft"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "drafts.createDraft",
          "type": "mutation",
          "auth": "tenantEditor"
        }
      }
    },
    "/v1/drafts/stats": {
      "get": {
        "operationId": "drafts.getStats",
        "tags": [
          "Drafts"
        ],
        "summary": "Draft counts",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "byStatus": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "drafts.getStats",
          "type": "query"
        }
      }
    },
    "/v1/drafts/publishable": {
      "get": {
        "operationId": "drafts.publishable",
        "tags": [
          "Drafts"
        ],
        "summary": "Publishable",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Draft"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "drafts.publishable",
          "type": "query"
        }
      }
    },
    "/v1/drafts/{id}": {
      "get": {
        "operationId": "drafts.getById",
        "tags": [
          "Drafts"
        ],
        "summary": "Get draft",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Draft"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "drafts.getById",
          "type": "query"
        }
      },
      "patch": {
        "operationId": "drafts.update",
        "tags": [
          "Drafts"
        ],
        "summary": "Update draft",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "content": {
                    "type": "string"
                  },
                  "excerpt": {
                    "type": "string"
                  },
                  "seo_meta": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.update",
          "type": "mutation",
          "auth": "tenantEditor"
        }
      },
      "delete": {
        "operationId": "drafts.delete",
        "tags": [
          "Drafts"
        ],
        "summary": "Soft delete (tenantAdmin)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.delete",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/drafts/{id}/approve": {
      "post": {
        "operationId": "drafts.approve",
        "tags": [
          "Drafts"
        ],
        "summary": "Approve",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.approve",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/{id}/reject": {
      "post": {
        "operationId": "drafts.reject",
        "tags": [
          "Drafts"
        ],
        "summary": "Reject",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.reject",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/{id}/publish": {
      "post": {
        "operationId": "drafts.publish",
        "tags": [
          "Drafts"
        ],
        "summary": "Publish",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "publisherConnectionId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "publishAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.publish",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/{id}/status": {
      "post": {
        "operationId": "drafts.updateStatus",
        "tags": [
          "Drafts"
        ],
        "summary": "Update status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "generating",
                      "reviewing",
                      "approved",
                      "rejected",
                      "published",
                      "archived"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.updateStatus",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/{id}/regenerate": {
      "post": {
        "operationId": "drafts.regenerate",
        "tags": [
          "Drafts"
        ],
        "summary": "Regenerate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.regenerate",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/{id}/versions": {
      "get": {
        "operationId": "drafts.getVersionHistory",
        "tags": [
          "Drafts"
        ],
        "summary": "Version history",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.getVersionHistory",
          "type": "query"
        }
      }
    },
    "/v1/drafts/{id}/versions/{version}/restore": {
      "post": {
        "operationId": "drafts.restoreVersion",
        "tags": [
          "Drafts"
        ],
        "summary": "Restore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.restoreVersion",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/{id}/comments": {
      "get": {
        "operationId": "drafts.listComments",
        "tags": [
          "Drafts"
        ],
        "summary": "List comments",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.listComments",
          "type": "query"
        }
      },
      "post": {
        "operationId": "drafts.createComment",
        "tags": [
          "Drafts"
        ],
        "summary": "Create comment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string"
                  },
                  "anchor": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created"
          }
        },
        "x-trpc": {
          "path": "drafts.createComment",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/comments/{commentId}/resolve": {
      "post": {
        "operationId": "drafts.resolveComment",
        "tags": [
          "Drafts"
        ],
        "summary": "Resolve",
        "parameters": [
          {
            "name": "commentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.resolveComment",
          "type": "mutation"
        }
      }
    },
    "/v1/drafts/{id}/assignment": {
      "get": {
        "operationId": "drafts.getAssignment",
        "tags": [
          "Drafts"
        ],
        "summary": "Get assignment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.getAssignment",
          "type": "query"
        }
      },
      "post": {
        "operationId": "drafts.assign",
        "tags": [
          "Drafts"
        ],
        "summary": "Assign reviewer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "assigneeId"
                ],
                "properties": {
                  "assigneeId": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.assign",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/publishers": {
      "get": {
        "operationId": "publishers.list",
        "tags": [
          "Publishers"
        ],
        "summary": "List publishers",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublisherConnection"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "publishers.list",
          "type": "query"
        }
      },
      "post": {
        "operationId": "publishers.create",
        "tags": [
          "Publishers"
        ],
        "summary": "Create publisher (tenantAdmin)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform",
                  "name",
                  "siteUrl",
                  "credentials"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "wordpress",
                      "webflow",
                      "ghost",
                      "shopify",
                      "wordpress_com",
                      "webhook",
                      "haravan"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "siteUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "credentials": {
                    "type": "string"
                  },
                  "webhookUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublisherConnection"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "publishers.create",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/publishers/{id}": {
      "get": {
        "operationId": "publishers.getById",
        "tags": [
          "Publishers"
        ],
        "summary": "Get publisher",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublisherConnection"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "publishers.getById",
          "type": "query"
        }
      },
      "patch": {
        "operationId": "publishers.update",
        "tags": [
          "Publishers"
        ],
        "summary": "Update publisher",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "siteUrl": {
                    "type": "string"
                  },
                  "credentials": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.update",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      },
      "delete": {
        "operationId": "publishers.delete",
        "tags": [
          "Publishers"
        ],
        "summary": "Delete publisher",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.delete",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/publishers/{id}/history": {
      "get": {
        "operationId": "publishers.history",
        "tags": [
          "Publishers"
        ],
        "summary": "History",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.history",
          "type": "query"
        }
      }
    },
    "/v1/publishers/{id}/test-connection": {
      "post": {
        "operationId": "publishers.testConnection",
        "tags": [
          "Publishers"
        ],
        "summary": "Test connection",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "lastTestedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "publishers.testConnection",
          "type": "mutation",
          "auth": "tenantAdmin"
        }
      }
    },
    "/v1/chat/conversations": {
      "get": {
        "operationId": "chat.listConversations",
        "tags": [
          "Chat"
        ],
        "summary": "List conversations",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChatConversation"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "chat.listConversations",
          "type": "query"
        }
      },
      "post": {
        "operationId": "chat.createConversation",
        "tags": [
          "Chat"
        ],
        "summary": "Create conversation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatConversation"
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "chat.createConversation",
          "type": "mutation"
        }
      }
    },
    "/v1/chat/conversations/{id}": {
      "get": {
        "operationId": "chat.getHistory",
        "tags": [
          "Chat"
        ],
        "summary": "Get history",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChatMessage"
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "chat.getHistory",
          "type": "query"
        }
      },
      "delete": {
        "operationId": "chat.deleteConversation",
        "tags": [
          "Chat"
        ],
        "summary": "Delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.deleteConversation",
          "type": "mutation"
        }
      },
      "patch": {
        "operationId": "chat.renameConversation",
        "tags": [
          "Chat"
        ],
        "summary": "Rename",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.renameConversation",
          "type": "mutation"
        }
      }
    },
    "/v1/chat/stream": {
      "post": {
        "operationId": "chat.stream",
        "tags": [
          "Chat"
        ],
        "summary": "SSE stream",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "conversationId",
                  "prompt"
                ],
                "properties": {
                  "conversationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "brief": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "SSE",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/seo/dashboard": {
      "get": {
        "operationId": "seo.getDashboard",
        "tags": [
          "SEO"
        ],
        "summary": "SEO dashboard",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getDashboard",
          "type": "query"
        }
      }
    },
    "/v1/seo/sites": {
      "get": {
        "operationId": "seo.listSites",
        "tags": [
          "SEO"
        ],
        "summary": "List sites",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "siteUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "status": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "seo.listSites",
          "type": "query"
        }
      }
    },
    "/v1/seo/actions": {
      "get": {
        "operationId": "seo.listActions",
        "tags": [
          "SEO"
        ],
        "summary": "List actions",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.listActions",
          "type": "query"
        }
      },
      "post": {
        "operationId": "seo.createAction",
        "tags": [
          "SEO"
        ],
        "summary": "Create action",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "siteId",
                  "title"
                ],
                "properties": {
                  "siteId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "title": {
                    "type": "string"
                  },
                  "issueId": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created"
          }
        },
        "x-trpc": {
          "path": "seo.createAction",
          "type": "mutation"
        }
      }
    },
    "/v1/website-scan/scan": {
      "post": {
        "operationId": "websiteScan.scanWebsite",
        "tags": [
          "Website Scan"
        ],
        "summary": "Crawl website",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "maxPages": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Queued"
          }
        },
        "x-trpc": {
          "path": "websiteScan.scanWebsite",
          "type": "mutation"
        }
      }
    },
    "/v1/billing/current-plan": {
      "get": {
        "operationId": "billing.currentPlan",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "Current plan",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "plan": {
                      "type": "string",
                      "enum": [
                        "starter",
                        "pro",
                        "enterprise"
                      ]
                    },
                    "postsQuota": {
                      "type": "integer"
                    },
                    "postsUsed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "billing.currentPlan",
          "type": "query"
        }
      }
    },
    "/v1/credits/balance": {
      "get": {
        "operationId": "credits.balance",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "Credit balance",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "balance": {
                      "type": "number"
                    },
                    "tenantId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "x-trpc": {
          "path": "credits.balance",
          "type": "query"
        }
      }
    },
    "/api/blogs": {
      "get": {
        "operationId": "publicBlogs",
        "tags": [
          "Public"
        ],
        "summary": "Public blogs",
        "description": "REST GET /api/blogs",
        "security": [],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Draft"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/webhooks/clerk": {
      "post": {
        "operationId": "webhooks.clerk",
        "tags": [
          "Webhooks"
        ],
        "summary": "Clerk webhook",
        "security": [],
        "parameters": [
          {
            "name": "svix-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "svix-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "svix-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "user.created",
                      "organization.created",
                      "organization.updated",
                      "organization.deleted",
                      "session.created"
                    ]
                  },
                  "data": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/webhooks/stripe": {
      "post": {
        "operationId": "webhooks.stripe",
        "tags": [
          "Webhooks"
        ],
        "summary": "Stripe webhook",
        "security": [],
        "parameters": [
          {
            "name": "stripe-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "checkout.session.completed",
                      "customer.subscription.updated",
                      "customer.subscription.deleted",
                      "invoice.payment_succeeded"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/health/tenant": {
      "get": {
        "operationId": "health.tenant",
        "tags": [
          "System"
        ],
        "summary": "Tenant health",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "healthy": {
                      "type": "boolean"
                    },
                    "tenantFound": {
                      "type": "boolean"
                    },
                    "orgMappingMatches": {
                      "type": "boolean"
                    },
                    "tenantId": {
                      "type": "string",
                      "format": "uuid",
                      "nullable": true
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/diagnostics": {
      "get": {
        "operationId": "diagnostics.get",
        "tags": [
          "System"
        ],
        "summary": "Diagnostics",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "operationId": "diagnostics.post",
        "tags": [
          "System"
        ],
        "summary": "Ingest",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/admin/tenants/export": {
      "get": {
        "operationId": "admin.tenantsExport",
        "tags": [
          "Admin"
        ],
        "summary": "Export tenants CSV",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "plan",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV/JSON"
          }
        }
      }
    },
    "/v1/documents/update-status": {
      "post": {
        "operationId": "documents.updateStatus",
        "tags": [
          "Documents"
        ],
        "summary": "updateStatus (documents)",
        "description": "tRPC `documents.updateStatus` — stub tự sinh cho tenant. Xem `server/routers/documents.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "documents.updateStatus",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/documents/bulk-update-status": {
      "post": {
        "operationId": "documents.bulkUpdateStatus",
        "tags": [
          "Documents"
        ],
        "summary": "bulkUpdateStatus (documents)",
        "description": "tRPC `documents.bulkUpdateStatus` — stub tự sinh cho tenant. Xem `server/routers/documents.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "documents.bulkUpdateStatus",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/jobs/delete": {
      "post": {
        "operationId": "jobs.delete",
        "tags": [
          "Jobs"
        ],
        "summary": "delete (jobs)",
        "description": "tRPC `jobs.delete` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.delete",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/jobs/get-draft-timeline": {
      "get": {
        "operationId": "jobs.getDraftTimeline",
        "tags": [
          "Jobs"
        ],
        "summary": "getDraftTimeline (jobs)",
        "description": "tRPC `jobs.getDraftTimeline` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.getDraftTimeline",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/jobs/publish-activity": {
      "get": {
        "operationId": "jobs.publishActivity",
        "tags": [
          "Jobs"
        ],
        "summary": "publishActivity (jobs)",
        "description": "tRPC `jobs.publishActivity` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.publishActivity",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/jobs/update-instance": {
      "post": {
        "operationId": "jobs.updateInstance",
        "tags": [
          "Jobs"
        ],
        "summary": "updateInstance (jobs)",
        "description": "tRPC `jobs.updateInstance` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.updateInstance",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/jobs/create-instance": {
      "post": {
        "operationId": "jobs.createInstance",
        "tags": [
          "Jobs"
        ],
        "summary": "createInstance (jobs)",
        "description": "tRPC `jobs.createInstance` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.createInstance",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/jobs/bulk-pause": {
      "post": {
        "operationId": "jobs.bulkPause",
        "tags": [
          "Jobs"
        ],
        "summary": "bulkPause (jobs)",
        "description": "tRPC `jobs.bulkPause` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.bulkPause",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/jobs/bulk-resume": {
      "post": {
        "operationId": "jobs.bulkResume",
        "tags": [
          "Jobs"
        ],
        "summary": "bulkResume (jobs)",
        "description": "tRPC `jobs.bulkResume` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.bulkResume",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/jobs/bulk-trigger": {
      "post": {
        "operationId": "jobs.bulkTrigger",
        "tags": [
          "Jobs"
        ],
        "summary": "bulkTrigger (jobs)",
        "description": "tRPC `jobs.bulkTrigger` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.bulkTrigger",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/jobs/bulk-delete": {
      "post": {
        "operationId": "jobs.bulkDelete",
        "tags": [
          "Jobs"
        ],
        "summary": "bulkDelete (jobs)",
        "description": "tRPC `jobs.bulkDelete` — stub tự sinh cho tenant. Xem `server/routers/jobs.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobs.bulkDelete",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/job-instances/stats": {
      "get": {
        "operationId": "jobInstances.stats",
        "tags": [
          "Job Instances"
        ],
        "summary": "stats (jobInstances)",
        "description": "tRPC `jobInstances.stats` — stub tự sinh cho tenant. Xem `server/routers/jobInstances.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "jobInstances.stats",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/drafts/list-publishers": {
      "get": {
        "operationId": "drafts.listPublishers",
        "tags": [
          "Drafts"
        ],
        "summary": "listPublishers (drafts)",
        "description": "tRPC `drafts.listPublishers` — stub tự sinh cho tenant. Xem `server/routers/drafts.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.listPublishers",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/drafts/publisher-attempts": {
      "get": {
        "operationId": "drafts.publisherAttempts",
        "tags": [
          "Drafts"
        ],
        "summary": "publisherAttempts (drafts)",
        "description": "tRPC `drafts.publisherAttempts` — stub tự sinh cho tenant. Xem `server/routers/drafts.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "drafts.publisherAttempts",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/publishers/list-paginated": {
      "get": {
        "operationId": "publishers.listPaginated",
        "tags": [
          "Publishers"
        ],
        "summary": "listPaginated (publishers)",
        "description": "tRPC `publishers.listPaginated` — stub tự sinh cho tenant. Xem `server/routers/publishers.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.listPaginated",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/publishers/get-webhook-mapping": {
      "get": {
        "operationId": "publishers.getWebhookMapping",
        "tags": [
          "Publishers"
        ],
        "summary": "getWebhookMapping (publishers)",
        "description": "tRPC `publishers.getWebhookMapping` — stub tự sinh cho tenant. Xem `server/routers/publishers.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.getWebhookMapping",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/publishers/update-webhook-mapping": {
      "post": {
        "operationId": "publishers.updateWebhookMapping",
        "tags": [
          "Publishers"
        ],
        "summary": "updateWebhookMapping (publishers)",
        "description": "tRPC `publishers.updateWebhookMapping` — stub tự sinh cho tenant. Xem `server/routers/publishers.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.updateWebhookMapping",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/publishers/test-webhook-delivery": {
      "post": {
        "operationId": "publishers.testWebhookDelivery",
        "tags": [
          "Publishers"
        ],
        "summary": "testWebhookDelivery (publishers)",
        "description": "tRPC `publishers.testWebhookDelivery` — stub tự sinh cho tenant. Xem `server/routers/publishers.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.testWebhookDelivery",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/publishers/attempt-payload": {
      "get": {
        "operationId": "publishers.attemptPayload",
        "tags": [
          "Publishers"
        ],
        "summary": "attemptPayload (publishers)",
        "description": "tRPC `publishers.attemptPayload` — stub tự sinh cho tenant. Xem `server/routers/publishers.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.attemptPayload",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/publishers/verify-published-article": {
      "post": {
        "operationId": "publishers.verifyPublishedArticle",
        "tags": [
          "Publishers"
        ],
        "summary": "verifyPublishedArticle (publishers)",
        "description": "tRPC `publishers.verifyPublishedArticle` — stub tự sinh cho tenant. Xem `server/routers/publishers.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.verifyPublishedArticle",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/publishers/rotate-credentials": {
      "post": {
        "operationId": "publishers.rotateCredentials",
        "tags": [
          "Publishers"
        ],
        "summary": "rotateCredentials (publishers)",
        "description": "tRPC `publishers.rotateCredentials` — stub tự sinh cho tenant. Xem `server/routers/publishers.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "publishers.rotateCredentials",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/chat/get-draft-versions": {
      "get": {
        "operationId": "chat.getDraftVersions",
        "tags": [
          "Chat"
        ],
        "summary": "getDraftVersions (chat)",
        "description": "tRPC `chat.getDraftVersions` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.getDraftVersions",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/chat/restore-draft-version": {
      "post": {
        "operationId": "chat.restoreDraftVersion",
        "tags": [
          "Chat"
        ],
        "summary": "restoreDraftVersion (chat)",
        "description": "tRPC `chat.restoreDraftVersion` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.restoreDraftVersion",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/chat/get-chat-settings": {
      "get": {
        "operationId": "chat.getChatSettings",
        "tags": [
          "Chat"
        ],
        "summary": "getChatSettings (chat)",
        "description": "tRPC `chat.getChatSettings` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.getChatSettings",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/chat/get-websearch-quota": {
      "get": {
        "operationId": "chat.getWebsearchQuota",
        "tags": [
          "Chat"
        ],
        "summary": "getWebsearchQuota (chat)",
        "description": "tRPC `chat.getWebsearchQuota` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.getWebsearchQuota",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/chat/generate-draft": {
      "post": {
        "operationId": "chat.generateDraft",
        "tags": [
          "Chat"
        ],
        "summary": "generateDraft (chat)",
        "description": "tRPC `chat.generateDraft` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.generateDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/chat/regenerate-image": {
      "post": {
        "operationId": "chat.regenerateImage",
        "tags": [
          "Chat"
        ],
        "summary": "regenerateImage (chat)",
        "description": "tRPC `chat.regenerateImage` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.regenerateImage",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/chat/generate-keyword-suggestions": {
      "post": {
        "operationId": "chat.generateKeywordSuggestions",
        "tags": [
          "Chat"
        ],
        "summary": "generateKeywordSuggestions (chat)",
        "description": "tRPC `chat.generateKeywordSuggestions` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.generateKeywordSuggestions",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/chat/regenerate-content": {
      "post": {
        "operationId": "chat.regenerateContent",
        "tags": [
          "Chat"
        ],
        "summary": "regenerateContent (chat)",
        "description": "tRPC `chat.regenerateContent` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.regenerateContent",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/chat/submit-feedback": {
      "post": {
        "operationId": "chat.submitFeedback",
        "tags": [
          "Chat"
        ],
        "summary": "submitFeedback (chat)",
        "description": "tRPC `chat.submitFeedback` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.submitFeedback",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/chat/get-feedback": {
      "get": {
        "operationId": "chat.getFeedback",
        "tags": [
          "Chat"
        ],
        "summary": "getFeedback (chat)",
        "description": "tRPC `chat.getFeedback` — stub tự sinh cho tenant. Xem `server/routers/chat.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "chat.getFeedback",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-overview": {
      "get": {
        "operationId": "seo.getOverview",
        "tags": [
          "SEO"
        ],
        "summary": "getOverview (seo)",
        "description": "tRPC `seo.getOverview` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getOverview",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-control-center": {
      "get": {
        "operationId": "seo.getControlCenter",
        "tags": [
          "SEO"
        ],
        "summary": "getControlCenter (seo)",
        "description": "tRPC `seo.getControlCenter` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getControlCenter",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/list-planning-targets": {
      "get": {
        "operationId": "seo.listPlanningTargets",
        "tags": [
          "SEO"
        ],
        "summary": "listPlanningTargets (seo)",
        "description": "tRPC `seo.listPlanningTargets` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.listPlanningTargets",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/update-crawl-config": {
      "post": {
        "operationId": "seo.updateCrawlConfig",
        "tags": [
          "SEO"
        ],
        "summary": "updateCrawlConfig (seo)",
        "description": "tRPC `seo.updateCrawlConfig` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.updateCrawlConfig",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/verify-site": {
      "post": {
        "operationId": "seo.verifySite",
        "tags": [
          "SEO"
        ],
        "summary": "verifySite (seo)",
        "description": "tRPC `seo.verifySite` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.verifySite",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/list-pages": {
      "get": {
        "operationId": "seo.listPages",
        "tags": [
          "SEO"
        ],
        "summary": "listPages (seo)",
        "description": "tRPC `seo.listPages` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.listPages",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-page-detail": {
      "get": {
        "operationId": "seo.getPageDetail",
        "tags": [
          "SEO"
        ],
        "summary": "getPageDetail (seo)",
        "description": "tRPC `seo.getPageDetail` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getPageDetail",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/list-issues": {
      "get": {
        "operationId": "seo.listIssues",
        "tags": [
          "SEO"
        ],
        "summary": "listIssues (seo)",
        "description": "tRPC `seo.listIssues` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.listIssues",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-issue-summary": {
      "get": {
        "operationId": "seo.getIssueSummary",
        "tags": [
          "SEO"
        ],
        "summary": "getIssueSummary (seo)",
        "description": "tRPC `seo.getIssueSummary` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getIssueSummary",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-issue-detail": {
      "get": {
        "operationId": "seo.getIssueDetail",
        "tags": [
          "SEO"
        ],
        "summary": "getIssueDetail (seo)",
        "description": "tRPC `seo.getIssueDetail` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getIssueDetail",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/update-issue-status": {
      "post": {
        "operationId": "seo.updateIssueStatus",
        "tags": [
          "SEO"
        ],
        "summary": "updateIssueStatus (seo)",
        "description": "tRPC `seo.updateIssueStatus` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.updateIssueStatus",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/update-issue-status-by-code": {
      "post": {
        "operationId": "seo.updateIssueStatusByCode",
        "tags": [
          "SEO"
        ],
        "summary": "updateIssueStatusByCode (seo)",
        "description": "tRPC `seo.updateIssueStatusByCode` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.updateIssueStatusByCode",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/run-full-audit": {
      "post": {
        "operationId": "seo.runFullAudit",
        "tags": [
          "SEO"
        ],
        "summary": "runFullAudit (seo)",
        "description": "tRPC `seo.runFullAudit` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.runFullAudit",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/queue-audit": {
      "post": {
        "operationId": "seo.queueAudit",
        "tags": [
          "SEO"
        ],
        "summary": "queueAudit (seo)",
        "description": "tRPC `seo.queueAudit` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.queueAudit",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/retry-audit": {
      "post": {
        "operationId": "seo.retryAudit",
        "tags": [
          "SEO"
        ],
        "summary": "retryAudit (seo)",
        "description": "tRPC `seo.retryAudit` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.retryAudit",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-audit-status": {
      "get": {
        "operationId": "seo.getAuditStatus",
        "tags": [
          "SEO"
        ],
        "summary": "getAuditStatus (seo)",
        "description": "tRPC `seo.getAuditStatus` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getAuditStatus",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/cancel-audit": {
      "post": {
        "operationId": "seo.cancelAudit",
        "tags": [
          "SEO"
        ],
        "summary": "cancelAudit (seo)",
        "description": "tRPC `seo.cancelAudit` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.cancelAudit",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-workspace-status": {
      "get": {
        "operationId": "seo.getWorkspaceStatus",
        "tags": [
          "SEO"
        ],
        "summary": "getWorkspaceStatus (seo)",
        "description": "tRPC `seo.getWorkspaceStatus` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getWorkspaceStatus",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/list-recommendations": {
      "get": {
        "operationId": "seo.listRecommendations",
        "tags": [
          "SEO"
        ],
        "summary": "listRecommendations (seo)",
        "description": "tRPC `seo.listRecommendations` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.listRecommendations",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-recommendation": {
      "get": {
        "operationId": "seo.getRecommendation",
        "tags": [
          "SEO"
        ],
        "summary": "getRecommendation (seo)",
        "description": "tRPC `seo.getRecommendation` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getRecommendation",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/accept-recommendation": {
      "post": {
        "operationId": "seo.acceptRecommendation",
        "tags": [
          "SEO"
        ],
        "summary": "acceptRecommendation (seo)",
        "description": "tRPC `seo.acceptRecommendation` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.acceptRecommendation",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-action-execution-context": {
      "get": {
        "operationId": "seo.getActionExecutionContext",
        "tags": [
          "SEO"
        ],
        "summary": "getActionExecutionContext (seo)",
        "description": "tRPC `seo.getActionExecutionContext` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getActionExecutionContext",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/update-action-status": {
      "post": {
        "operationId": "seo.updateActionStatus",
        "tags": [
          "SEO"
        ],
        "summary": "updateActionStatus (seo)",
        "description": "tRPC `seo.updateActionStatus` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.updateActionStatus",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/assign-action": {
      "post": {
        "operationId": "seo.assignAction",
        "tags": [
          "SEO"
        ],
        "summary": "assignAction (seo)",
        "description": "tRPC `seo.assignAction` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.assignAction",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-action-verification": {
      "get": {
        "operationId": "seo.getActionVerification",
        "tags": [
          "SEO"
        ],
        "summary": "getActionVerification (seo)",
        "description": "tRPC `seo.getActionVerification` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getActionVerification",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/create-action-by-code": {
      "post": {
        "operationId": "seo.createActionByCode",
        "tags": [
          "SEO"
        ],
        "summary": "createActionByCode (seo)",
        "description": "tRPC `seo.createActionByCode` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.createActionByCode",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/update-action": {
      "post": {
        "operationId": "seo.updateAction",
        "tags": [
          "SEO"
        ],
        "summary": "updateAction (seo)",
        "description": "tRPC `seo.updateAction` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.updateAction",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/rescan-action": {
      "post": {
        "operationId": "seo.rescanAction",
        "tags": [
          "SEO"
        ],
        "summary": "rescanAction (seo)",
        "description": "tRPC `seo.rescanAction` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.rescanAction",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-search-opportunities": {
      "get": {
        "operationId": "seo.getSearchOpportunities",
        "tags": [
          "SEO"
        ],
        "summary": "getSearchOpportunities (seo)",
        "description": "tRPC `seo.getSearchOpportunities` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getSearchOpportunities",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-search-intelligence": {
      "get": {
        "operationId": "seo.getSearchIntelligence",
        "tags": [
          "SEO"
        ],
        "summary": "getSearchIntelligence (seo)",
        "description": "tRPC `seo.getSearchIntelligence` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getSearchIntelligence",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/list-competitor-verification-options": {
      "get": {
        "operationId": "seo.listCompetitorVerificationOptions",
        "tags": [
          "SEO"
        ],
        "summary": "listCompetitorVerificationOptions (seo)",
        "description": "tRPC `seo.listCompetitorVerificationOptions` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.listCompetitorVerificationOptions",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/record-competitor-keyword-observation": {
      "post": {
        "operationId": "seo.recordCompetitorKeywordObservation",
        "tags": [
          "SEO"
        ],
        "summary": "recordCompetitorKeywordObservation (seo)",
        "description": "tRPC `seo.recordCompetitorKeywordObservation` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.recordCompetitorKeywordObservation",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/sync-competitor-snapshot": {
      "post": {
        "operationId": "seo.syncCompetitorSnapshot",
        "tags": [
          "SEO"
        ],
        "summary": "syncCompetitorSnapshot (seo)",
        "description": "tRPC `seo.syncCompetitorSnapshot` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.syncCompetitorSnapshot",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/sync-search-snapshot": {
      "post": {
        "operationId": "seo.syncSearchSnapshot",
        "tags": [
          "SEO"
        ],
        "summary": "syncSearchSnapshot (seo)",
        "description": "tRPC `seo.syncSearchSnapshot` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.syncSearchSnapshot",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/upsert-geo-prompt": {
      "post": {
        "operationId": "seo.upsertGeoPrompt",
        "tags": [
          "SEO"
        ],
        "summary": "upsertGeoPrompt (seo)",
        "description": "tRPC `seo.upsertGeoPrompt` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.upsertGeoPrompt",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/create-geo-prompt": {
      "post": {
        "operationId": "seo.createGeoPrompt",
        "tags": [
          "SEO"
        ],
        "summary": "createGeoPrompt (seo)",
        "description": "tRPC `seo.createGeoPrompt` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.createGeoPrompt",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/record-geo-observation": {
      "post": {
        "operationId": "seo.recordGeoObservation",
        "tags": [
          "SEO"
        ],
        "summary": "recordGeoObservation (seo)",
        "description": "tRPC `seo.recordGeoObservation` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.recordGeoObservation",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/run-geo-observation": {
      "post": {
        "operationId": "seo.runGeoObservation",
        "tags": [
          "SEO"
        ],
        "summary": "runGeoObservation (seo)",
        "description": "tRPC `seo.runGeoObservation` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.runGeoObservation",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/run-geo-observation-legacy": {
      "post": {
        "operationId": "seo.runGeoObservationLegacy",
        "tags": [
          "SEO"
        ],
        "summary": "runGeoObservationLegacy (seo)",
        "description": "tRPC `seo.runGeoObservationLegacy` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.runGeoObservationLegacy",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-geo-observation-job": {
      "get": {
        "operationId": "seo.getGeoObservationJob",
        "tags": [
          "SEO"
        ],
        "summary": "getGeoObservationJob (seo)",
        "description": "tRPC `seo.getGeoObservationJob` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getGeoObservationJob",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/retry-geo-observation": {
      "post": {
        "operationId": "seo.retryGeoObservation",
        "tags": [
          "SEO"
        ],
        "summary": "retryGeoObservation (seo)",
        "description": "tRPC `seo.retryGeoObservation` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.retryGeoObservation",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-provider-usage": {
      "get": {
        "operationId": "seo.getProviderUsage",
        "tags": [
          "SEO"
        ],
        "summary": "getProviderUsage (seo)",
        "description": "tRPC `seo.getProviderUsage` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getProviderUsage",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/save-tracked-keywords": {
      "post": {
        "operationId": "seo.saveTrackedKeywords",
        "tags": [
          "SEO"
        ],
        "summary": "saveTrackedKeywords (seo)",
        "description": "tRPC `seo.saveTrackedKeywords` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.saveTrackedKeywords",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/sync-rank-tracking": {
      "post": {
        "operationId": "seo.syncRankTracking",
        "tags": [
          "SEO"
        ],
        "summary": "syncRankTracking (seo)",
        "description": "tRPC `seo.syncRankTracking` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.syncRankTracking",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-rank-tracking": {
      "get": {
        "operationId": "seo.getRankTracking",
        "tags": [
          "SEO"
        ],
        "summary": "getRankTracking (seo)",
        "description": "tRPC `seo.getRankTracking` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getRankTracking",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/save-sellm-config": {
      "post": {
        "operationId": "seo.saveSellmConfig",
        "tags": [
          "SEO"
        ],
        "summary": "saveSellmConfig (seo)",
        "description": "tRPC `seo.saveSellmConfig` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.saveSellmConfig",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/sync-ai-visibility": {
      "post": {
        "operationId": "seo.syncAiVisibility",
        "tags": [
          "SEO"
        ],
        "summary": "syncAiVisibility (seo)",
        "description": "tRPC `seo.syncAiVisibility` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.syncAiVisibility",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-ai-visibility": {
      "get": {
        "operationId": "seo.getAiVisibility",
        "tags": [
          "SEO"
        ],
        "summary": "getAiVisibility (seo)",
        "description": "tRPC `seo.getAiVisibility` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getAiVisibility",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-competitor-gap": {
      "get": {
        "operationId": "seo.getCompetitorGap",
        "tags": [
          "SEO"
        ],
        "summary": "getCompetitorGap (seo)",
        "description": "tRPC `seo.getCompetitorGap` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getCompetitorGap",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/save-site-url": {
      "post": {
        "operationId": "seo.saveSiteUrl",
        "tags": [
          "SEO"
        ],
        "summary": "saveSiteUrl (seo)",
        "description": "tRPC `seo.saveSiteUrl` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.saveSiteUrl",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-gsc-auth-url": {
      "get": {
        "operationId": "seo.getGscAuthUrl",
        "tags": [
          "SEO"
        ],
        "summary": "getGscAuthUrl (seo)",
        "description": "tRPC `seo.getGscAuthUrl` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getGscAuthUrl",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/connect-gsc": {
      "post": {
        "operationId": "seo.connectGsc",
        "tags": [
          "SEO"
        ],
        "summary": "connectGsc (seo)",
        "description": "tRPC `seo.connectGsc` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.connectGsc",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/disconnect-gsc": {
      "post": {
        "operationId": "seo.disconnectGsc",
        "tags": [
          "SEO"
        ],
        "summary": "disconnectGsc (seo)",
        "description": "tRPC `seo.disconnectGsc` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.disconnectGsc",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/list-gsc-sites": {
      "get": {
        "operationId": "seo.listGscSites",
        "tags": [
          "SEO"
        ],
        "summary": "listGscSites (seo)",
        "description": "tRPC `seo.listGscSites` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.listGscSites",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-gsc-property-options": {
      "get": {
        "operationId": "seo.getGscPropertyOptions",
        "tags": [
          "SEO"
        ],
        "summary": "getGscPropertyOptions (seo)",
        "description": "tRPC `seo.getGscPropertyOptions` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getGscPropertyOptions",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/confirm-gsc-property": {
      "post": {
        "operationId": "seo.confirmGscProperty",
        "tags": [
          "SEO"
        ],
        "summary": "confirmGscProperty (seo)",
        "description": "tRPC `seo.confirmGscProperty` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.confirmGscProperty",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-search-analytics": {
      "get": {
        "operationId": "seo.getSearchAnalytics",
        "tags": [
          "SEO"
        ],
        "summary": "getSearchAnalytics (seo)",
        "description": "tRPC `seo.getSearchAnalytics` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getSearchAnalytics",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-gsc-connect-info": {
      "get": {
        "operationId": "seo.getGscConnectInfo",
        "tags": [
          "SEO"
        ],
        "summary": "getGscConnectInfo (seo)",
        "description": "tRPC `seo.getGscConnectInfo` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getGscConnectInfo",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-seo-overview": {
      "get": {
        "operationId": "seo.getSeoOverview",
        "tags": [
          "SEO"
        ],
        "summary": "getSeoOverview (seo)",
        "description": "tRPC `seo.getSeoOverview` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getSeoOverview",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-seo-config": {
      "get": {
        "operationId": "seo.getSeoConfig",
        "tags": [
          "SEO"
        ],
        "summary": "getSeoConfig (seo)",
        "description": "tRPC `seo.getSeoConfig` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getSeoConfig",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/connect-gsc-simple": {
      "post": {
        "operationId": "seo.connectGscSimple",
        "tags": [
          "SEO"
        ],
        "summary": "connectGscSimple (seo)",
        "description": "tRPC `seo.connectGscSimple` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.connectGscSimple",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/save-gsc-credentials": {
      "post": {
        "operationId": "seo.saveGscCredentials",
        "tags": [
          "SEO"
        ],
        "summary": "saveGscCredentials (seo)",
        "description": "tRPC `seo.saveGscCredentials` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.saveGscCredentials",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-gsc-dashboard-data": {
      "get": {
        "operationId": "seo.getGscDashboardData",
        "tags": [
          "SEO"
        ],
        "summary": "getGscDashboardData (seo)",
        "description": "tRPC `seo.getGscDashboardData` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getGscDashboardData",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/run-on-page-scan": {
      "post": {
        "operationId": "seo.runOnPageScan",
        "tags": [
          "SEO"
        ],
        "summary": "runOnPageScan (seo)",
        "description": "tRPC `seo.runOnPageScan` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.runOnPageScan",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/run-page-speed": {
      "post": {
        "operationId": "seo.runPageSpeed",
        "tags": [
          "SEO"
        ],
        "summary": "runPageSpeed (seo)",
        "description": "tRPC `seo.runPageSpeed` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.runPageSpeed",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/run-technical-seo": {
      "post": {
        "operationId": "seo.runTechnicalSeo",
        "tags": [
          "SEO"
        ],
        "summary": "runTechnicalSeo (seo)",
        "description": "tRPC `seo.runTechnicalSeo` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.runTechnicalSeo",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/save-scan": {
      "post": {
        "operationId": "seo.saveScan",
        "tags": [
          "SEO"
        ],
        "summary": "saveScan (seo)",
        "description": "tRPC `seo.saveScan` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.saveScan",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo/get-scan-history": {
      "get": {
        "operationId": "seo.getScanHistory",
        "tags": [
          "SEO"
        ],
        "summary": "getScanHistory (seo)",
        "description": "tRPC `seo.getScanHistory` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getScanHistory",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo/get-latest-scan": {
      "get": {
        "operationId": "seo.getLatestScan",
        "tags": [
          "SEO"
        ],
        "summary": "getLatestScan (seo)",
        "description": "tRPC `seo.getLatestScan` — stub tự sinh cho tenant. Xem `server/routers/seo.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seo.getLatestScan",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo-plans/get-planning-profile": {
      "get": {
        "operationId": "seoPlans.getPlanningProfile",
        "tags": [
          "SEO Plans"
        ],
        "summary": "getPlanningProfile (seoPlans)",
        "description": "tRPC `seoPlans.getPlanningProfile` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.getPlanningProfile",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo-plans/update-planning-profile": {
      "post": {
        "operationId": "seoPlans.updatePlanningProfile",
        "tags": [
          "SEO Plans"
        ],
        "summary": "updatePlanningProfile (seoPlans)",
        "description": "tRPC `seoPlans.updatePlanningProfile` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.updatePlanningProfile",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/get-readiness": {
      "get": {
        "operationId": "seoPlans.getReadiness",
        "tags": [
          "SEO Plans"
        ],
        "summary": "getReadiness (seoPlans)",
        "description": "tRPC `seoPlans.getReadiness` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.getReadiness",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo-plans/generate-draft": {
      "post": {
        "operationId": "seoPlans.generateDraft",
        "tags": [
          "SEO Plans"
        ],
        "summary": "generateDraft (seoPlans)",
        "description": "tRPC `seoPlans.generateDraft` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.generateDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/list": {
      "get": {
        "operationId": "seoPlans.list",
        "tags": [
          "SEO Plans"
        ],
        "summary": "list (seoPlans)",
        "description": "tRPC `seoPlans.list` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo-plans/get-by-id": {
      "get": {
        "operationId": "seoPlans.getById",
        "tags": [
          "SEO Plans"
        ],
        "summary": "getById (seoPlans)",
        "description": "tRPC `seoPlans.getById` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.getById",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo-plans/update-draft": {
      "post": {
        "operationId": "seoPlans.updateDraft",
        "tags": [
          "SEO Plans"
        ],
        "summary": "updateDraft (seoPlans)",
        "description": "tRPC `seoPlans.updateDraft` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.updateDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/add-manual-item": {
      "post": {
        "operationId": "seoPlans.addManualItem",
        "tags": [
          "SEO Plans"
        ],
        "summary": "addManualItem (seoPlans)",
        "description": "tRPC `seoPlans.addManualItem` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.addManualItem",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/reorder-items": {
      "post": {
        "operationId": "seoPlans.reorderItems",
        "tags": [
          "SEO Plans"
        ],
        "summary": "reorderItems (seoPlans)",
        "description": "tRPC `seoPlans.reorderItems` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.reorderItems",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/approve": {
      "post": {
        "operationId": "seoPlans.approve",
        "tags": [
          "SEO Plans"
        ],
        "summary": "approve (seoPlans)",
        "description": "tRPC `seoPlans.approve` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.approve",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/create-revision": {
      "post": {
        "operationId": "seoPlans.createRevision",
        "tags": [
          "SEO Plans"
        ],
        "summary": "createRevision (seoPlans)",
        "description": "tRPC `seoPlans.createRevision` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.createRevision",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/record-month-end-observation": {
      "post": {
        "operationId": "seoPlans.recordMonthEndObservation",
        "tags": [
          "SEO Plans"
        ],
        "summary": "recordMonthEndObservation (seoPlans)",
        "description": "tRPC `seoPlans.recordMonthEndObservation` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.recordMonthEndObservation",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/seo-plans/get-month-end-review": {
      "get": {
        "operationId": "seoPlans.getMonthEndReview",
        "tags": [
          "SEO Plans"
        ],
        "summary": "getMonthEndReview (seoPlans)",
        "description": "tRPC `seoPlans.getMonthEndReview` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.getMonthEndReview",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/seo-plans/generate-next-month-draft": {
      "post": {
        "operationId": "seoPlans.generateNextMonthDraft",
        "tags": [
          "SEO Plans"
        ],
        "summary": "generateNextMonthDraft (seoPlans)",
        "description": "tRPC `seoPlans.generateNextMonthDraft` — stub tự sinh cho tenant. Xem `server/routers/seoPlans.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "seoPlans.generateNextMonthDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/refresh-opportunities": {
      "get": {
        "operationId": "analytics.refreshOpportunities",
        "tags": [
          "Analytics"
        ],
        "summary": "refreshOpportunities (analytics)",
        "description": "tRPC `analytics.refreshOpportunities` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.refreshOpportunities",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/overview": {
      "get": {
        "operationId": "analytics.overview",
        "tags": [
          "Analytics"
        ],
        "summary": "overview (analytics)",
        "description": "tRPC `analytics.overview` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.overview",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/overview-in-range": {
      "get": {
        "operationId": "analytics.overviewInRange",
        "tags": [
          "Analytics"
        ],
        "summary": "overviewInRange (analytics)",
        "description": "tRPC `analytics.overviewInRange` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.overviewInRange",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/posts": {
      "get": {
        "operationId": "analytics.posts",
        "tags": [
          "Analytics"
        ],
        "summary": "posts (analytics)",
        "description": "tRPC `analytics.posts` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.posts",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/posts-over-time": {
      "get": {
        "operationId": "analytics.postsOverTime",
        "tags": [
          "Analytics"
        ],
        "summary": "postsOverTime (analytics)",
        "description": "tRPC `analytics.postsOverTime` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.postsOverTime",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/top-posts": {
      "get": {
        "operationId": "analytics.topPosts",
        "tags": [
          "Analytics"
        ],
        "summary": "topPosts (analytics)",
        "description": "tRPC `analytics.topPosts` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.topPosts",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/seo-distribution": {
      "get": {
        "operationId": "analytics.seoDistribution",
        "tags": [
          "Analytics"
        ],
        "summary": "seoDistribution (analytics)",
        "description": "tRPC `analytics.seoDistribution` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.seoDistribution",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/ai-usage/summary": {
      "post": {
        "operationId": "analytics.ai-usage:summary",
        "tags": [
          "Analytics"
        ],
        "summary": "ai-usage:summary (analytics)",
        "description": "tRPC `analytics.ai-usage:summary` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.ai-usage:summary",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/ai-usage/trend": {
      "post": {
        "operationId": "analytics.ai-usage:trend",
        "tags": [
          "Analytics"
        ],
        "summary": "ai-usage:trend (analytics)",
        "description": "tRPC `analytics.ai-usage:trend` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.ai-usage:trend",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/ai-usage/byFeature": {
      "post": {
        "operationId": "analytics.ai-usage:byFeature",
        "tags": [
          "Analytics"
        ],
        "summary": "ai-usage:byFeature (analytics)",
        "description": "tRPC `analytics.ai-usage:byFeature` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.ai-usage:byFeature",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/ai-usage/byModel": {
      "post": {
        "operationId": "analytics.ai-usage:byModel",
        "tags": [
          "Analytics"
        ],
        "summary": "ai-usage:byModel (analytics)",
        "description": "tRPC `analytics.ai-usage:byModel` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.ai-usage:byModel",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/ai-usage/transactions": {
      "post": {
        "operationId": "analytics.ai-usage:transactions",
        "tags": [
          "Analytics"
        ],
        "summary": "ai-usage:transactions (analytics)",
        "description": "tRPC `analytics.ai-usage:transactions` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.ai-usage:transactions",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/content/summary": {
      "get": {
        "operationId": "analytics.content:summary",
        "tags": [
          "Analytics"
        ],
        "summary": "content:summary (analytics)",
        "description": "tRPC `analytics.content:summary` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.content:summary",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/content/trend": {
      "get": {
        "operationId": "analytics.content:trend",
        "tags": [
          "Analytics"
        ],
        "summary": "content:trend (analytics)",
        "description": "tRPC `analytics.content:trend` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.content:trend",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/content/distribution": {
      "get": {
        "operationId": "analytics.content:distribution",
        "tags": [
          "Analytics"
        ],
        "summary": "content:distribution (analytics)",
        "description": "tRPC `analytics.content:distribution` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.content:distribution",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/content/list": {
      "get": {
        "operationId": "analytics.content:list",
        "tags": [
          "Analytics"
        ],
        "summary": "content:list (analytics)",
        "description": "tRPC `analytics.content:list` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.content:list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/automation/summary": {
      "get": {
        "operationId": "analytics.automation:summary",
        "tags": [
          "Analytics"
        ],
        "summary": "automation:summary (analytics)",
        "description": "tRPC `analytics.automation:summary` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.automation:summary",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/analytics/automation/trend": {
      "post": {
        "operationId": "analytics.automation:trend",
        "tags": [
          "Analytics"
        ],
        "summary": "automation:trend (analytics)",
        "description": "tRPC `analytics.automation:trend` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.automation:trend",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/automation/statusDistribution": {
      "post": {
        "operationId": "analytics.automation:statusDistribution",
        "tags": [
          "Analytics"
        ],
        "summary": "automation:statusDistribution (analytics)",
        "description": "tRPC `analytics.automation:statusDistribution` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.automation:statusDistribution",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/automation/jobPerformance": {
      "post": {
        "operationId": "analytics.automation:jobPerformance",
        "tags": [
          "Analytics"
        ],
        "summary": "automation:jobPerformance (analytics)",
        "description": "tRPC `analytics.automation:jobPerformance` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.automation:jobPerformance",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/automation/bottlenecks": {
      "post": {
        "operationId": "analytics.automation:bottlenecks",
        "tags": [
          "Analytics"
        ],
        "summary": "automation:bottlenecks (analytics)",
        "description": "tRPC `analytics.automation:bottlenecks` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.automation:bottlenecks",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/analytics/automation/recentRuns": {
      "post": {
        "operationId": "analytics.automation:recentRuns",
        "tags": [
          "Analytics"
        ],
        "summary": "automation:recentRuns (analytics)",
        "description": "tRPC `analytics.automation:recentRuns` — stub tự sinh cho tenant. Xem `server/routers/analytics.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "analytics.automation:recentRuns",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/billing/usage": {
      "get": {
        "operationId": "billing.usage",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "usage (billing)",
        "description": "tRPC `billing.usage` — stub tự sinh cho tenant. Xem `server/routers/billing.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "billing.usage",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/billing/usage-history": {
      "get": {
        "operationId": "billing.usageHistory",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "usageHistory (billing)",
        "description": "tRPC `billing.usageHistory` — stub tự sinh cho tenant. Xem `server/routers/billing.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "billing.usageHistory",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/billing/get-history": {
      "get": {
        "operationId": "billing.getHistory",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "getHistory (billing)",
        "description": "tRPC `billing.getHistory` — stub tự sinh cho tenant. Xem `server/routers/billing.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "billing.getHistory",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/billing/create-portal-session": {
      "post": {
        "operationId": "billing.createPortalSession",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "createPortalSession (billing)",
        "description": "tRPC `billing.createPortalSession` — stub tự sinh cho tenant. Xem `server/routers/billing.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "billing.createPortalSession",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/credits/transactions": {
      "get": {
        "operationId": "credits.transactions",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "transactions (credits)",
        "description": "tRPC `credits.transactions` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.transactions",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/check-balance": {
      "get": {
        "operationId": "credits.checkBalance",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "checkBalance (credits)",
        "description": "tRPC `credits.checkBalance` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.checkBalance",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/list-packages": {
      "get": {
        "operationId": "credits.listPackages",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "listPackages (credits)",
        "description": "tRPC `credits.listPackages` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.listPackages",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/pricing-rules": {
      "get": {
        "operationId": "credits.pricingRules",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "pricingRules (credits)",
        "description": "tRPC `credits.pricingRules` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.pricingRules",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/pricing": {
      "get": {
        "operationId": "credits.pricing",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "pricing (credits)",
        "description": "tRPC `credits.pricing` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.pricing",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/quote": {
      "post": {
        "operationId": "credits.quote",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "quote (credits)",
        "description": "tRPC `credits.quote` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.quote",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/credits/usage": {
      "get": {
        "operationId": "credits.usage",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "usage (credits)",
        "description": "tRPC `credits.usage` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.usage",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/get-usage": {
      "get": {
        "operationId": "credits.getUsage",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "getUsage (credits)",
        "description": "tRPC `credits.getUsage` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.getUsage",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/reserve": {
      "post": {
        "operationId": "credits.reserve",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "reserve (credits)",
        "description": "tRPC `credits.reserve` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.reserve",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/credits/plan-info": {
      "get": {
        "operationId": "credits.planInfo",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "planInfo (credits)",
        "description": "tRPC `credits.planInfo` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.planInfo",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/usage-summary": {
      "get": {
        "operationId": "credits.usageSummary",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "usageSummary (credits)",
        "description": "tRPC `credits.usageSummary` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.usageSummary",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/model-usage": {
      "get": {
        "operationId": "credits.modelUsage",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "modelUsage (credits)",
        "description": "tRPC `credits.modelUsage` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.modelUsage",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/credits/create-checkout-session": {
      "post": {
        "operationId": "credits.createCheckoutSession",
        "tags": [
          "Billing & Credits"
        ],
        "summary": "createCheckoutSession (credits)",
        "description": "tRPC `credits.createCheckoutSession` — stub tự sinh cho tenant. Xem `server/routers/credits.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "credits.createCheckoutSession",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/dashboard/activation-state": {
      "get": {
        "operationId": "dashboard.activationState",
        "tags": [
          "Analytics"
        ],
        "summary": "activationState (dashboard)",
        "description": "tRPC `dashboard.activationState` — stub tự sinh cho tenant. Xem `server/routers/dashboard.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "dashboard.activationState",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/dashboard/save-activation-state": {
      "post": {
        "operationId": "dashboard.saveActivationState",
        "tags": [
          "Analytics"
        ],
        "summary": "saveActivationState (dashboard)",
        "description": "tRPC `dashboard.saveActivationState` — stub tự sinh cho tenant. Xem `server/routers/dashboard.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "dashboard.saveActivationState",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/dashboard/tenant-health": {
      "get": {
        "operationId": "dashboard.tenantHealth",
        "tags": [
          "Analytics"
        ],
        "summary": "tenantHealth (dashboard)",
        "description": "tRPC `dashboard.tenantHealth` — stub tự sinh cho tenant. Xem `server/routers/dashboard.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "dashboard.tenantHealth",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/dashboard/setup-status": {
      "get": {
        "operationId": "dashboard.setupStatus",
        "tags": [
          "Analytics"
        ],
        "summary": "setupStatus (dashboard)",
        "description": "tRPC `dashboard.setupStatus` — stub tự sinh cho tenant. Xem `server/routers/dashboard.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "dashboard.setupStatus",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/dashboard/initial": {
      "get": {
        "operationId": "dashboard.initial",
        "tags": [
          "Analytics"
        ],
        "summary": "initial (dashboard)",
        "description": "tRPC `dashboard.initial` — stub tự sinh cho tenant. Xem `server/routers/dashboard.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "dashboard.initial",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/dashboard/layout": {
      "get": {
        "operationId": "dashboard.layout",
        "tags": [
          "Analytics"
        ],
        "summary": "layout (dashboard)",
        "description": "tRPC `dashboard.layout` — stub tự sinh cho tenant. Xem `server/routers/dashboard.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "dashboard.layout",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/check-enabled": {
      "get": {
        "operationId": "websiteScan.checkEnabled",
        "tags": [
          "Website Scan"
        ],
        "summary": "checkEnabled (websiteScan)",
        "description": "tRPC `websiteScan.checkEnabled` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.checkEnabled",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/get-rescan-schedule": {
      "get": {
        "operationId": "websiteScan.getRescanSchedule",
        "tags": [
          "Website Scan"
        ],
        "summary": "getRescanSchedule (websiteScan)",
        "description": "tRPC `websiteScan.getRescanSchedule` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getRescanSchedule",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/configure-rescan": {
      "post": {
        "operationId": "websiteScan.configureRescan",
        "tags": [
          "Website Scan"
        ],
        "summary": "configureRescan (websiteScan)",
        "description": "tRPC `websiteScan.configureRescan` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.configureRescan",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/get-active-scan": {
      "get": {
        "operationId": "websiteScan.getActiveScan",
        "tags": [
          "Website Scan"
        ],
        "summary": "getActiveScan (websiteScan)",
        "description": "tRPC `websiteScan.getActiveScan` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getActiveScan",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/get-crawl-status": {
      "get": {
        "operationId": "websiteScan.getCrawlStatus",
        "tags": [
          "Website Scan"
        ],
        "summary": "getCrawlStatus (websiteScan)",
        "description": "tRPC `websiteScan.getCrawlStatus` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getCrawlStatus",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/cancel-scan": {
      "post": {
        "operationId": "websiteScan.cancelScan",
        "tags": [
          "Website Scan"
        ],
        "summary": "cancelScan (websiteScan)",
        "description": "tRPC `websiteScan.cancelScan` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.cancelScan",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/save-pending-scan": {
      "post": {
        "operationId": "websiteScan.savePendingScan",
        "tags": [
          "Website Scan"
        ],
        "summary": "savePendingScan (websiteScan)",
        "description": "tRPC `websiteScan.savePendingScan` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.savePendingScan",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/get-pending-scan": {
      "get": {
        "operationId": "websiteScan.getPendingScan",
        "tags": [
          "Website Scan"
        ],
        "summary": "getPendingScan (websiteScan)",
        "description": "tRPC `websiteScan.getPendingScan` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getPendingScan",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/get-pending-scans": {
      "get": {
        "operationId": "websiteScan.getPendingScans",
        "tags": [
          "Website Scan"
        ],
        "summary": "getPendingScans (websiteScan)",
        "description": "tRPC `websiteScan.getPendingScans` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getPendingScans",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/get-history": {
      "get": {
        "operationId": "websiteScan.getHistory",
        "tags": [
          "Website Scan"
        ],
        "summary": "getHistory (websiteScan)",
        "description": "tRPC `websiteScan.getHistory` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getHistory",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/get-scan-pages": {
      "get": {
        "operationId": "websiteScan.getScanPages",
        "tags": [
          "Website Scan"
        ],
        "summary": "getScanPages (websiteScan)",
        "description": "tRPC `websiteScan.getScanPages` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getScanPages",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/get-quality-report": {
      "get": {
        "operationId": "websiteScan.getQualityReport",
        "tags": [
          "Website Scan"
        ],
        "summary": "getQualityReport (websiteScan)",
        "description": "tRPC `websiteScan.getQualityReport` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getQualityReport",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/delete-history": {
      "post": {
        "operationId": "websiteScan.deleteHistory",
        "tags": [
          "Website Scan"
        ],
        "summary": "deleteHistory (websiteScan)",
        "description": "tRPC `websiteScan.deleteHistory` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.deleteHistory",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/get-document-readiness": {
      "get": {
        "operationId": "websiteScan.getDocumentReadiness",
        "tags": [
          "Website Scan"
        ],
        "summary": "getDocumentReadiness (websiteScan)",
        "description": "tRPC `websiteScan.getDocumentReadiness` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.getDocumentReadiness",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/prepare-blog-handoff": {
      "post": {
        "operationId": "websiteScan.prepareBlogHandoff",
        "tags": [
          "Website Scan"
        ],
        "summary": "prepareBlogHandoff (websiteScan)",
        "description": "tRPC `websiteScan.prepareBlogHandoff` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.prepareBlogHandoff",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/resolve-blog-handoff": {
      "post": {
        "operationId": "websiteScan.resolveBlogHandoff",
        "tags": [
          "Website Scan"
        ],
        "summary": "resolveBlogHandoff (websiteScan)",
        "description": "tRPC `websiteScan.resolveBlogHandoff` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.resolveBlogHandoff",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/list-intelligence-snapshots": {
      "get": {
        "operationId": "websiteScan.listIntelligenceSnapshots",
        "tags": [
          "Website Scan"
        ],
        "summary": "listIntelligenceSnapshots (websiteScan)",
        "description": "tRPC `websiteScan.listIntelligenceSnapshots` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.listIntelligenceSnapshots",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/website-scan/approve-intelligence-snapshot": {
      "post": {
        "operationId": "websiteScan.approveIntelligenceSnapshot",
        "tags": [
          "Website Scan"
        ],
        "summary": "approveIntelligenceSnapshot (websiteScan)",
        "description": "tRPC `websiteScan.approveIntelligenceSnapshot` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.approveIntelligenceSnapshot",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/reject-intelligence-snapshot": {
      "post": {
        "operationId": "websiteScan.rejectIntelligenceSnapshot",
        "tags": [
          "Website Scan"
        ],
        "summary": "rejectIntelligenceSnapshot (websiteScan)",
        "description": "tRPC `websiteScan.rejectIntelligenceSnapshot` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.rejectIntelligenceSnapshot",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/confirm-scan": {
      "post": {
        "operationId": "websiteScan.confirmScan",
        "tags": [
          "Website Scan"
        ],
        "summary": "confirmScan (websiteScan)",
        "description": "tRPC `websiteScan.confirmScan` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.confirmScan",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/website-scan/analyze-website": {
      "post": {
        "operationId": "websiteScan.analyzeWebsite",
        "tags": [
          "Website Scan"
        ],
        "summary": "analyzeWebsite (websiteScan)",
        "description": "tRPC `websiteScan.analyzeWebsite` — stub tự sinh cho tenant. Xem `server/routers/websiteScan.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "websiteScan.analyzeWebsite",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/list": {
      "get": {
        "operationId": "workflows.list",
        "tags": [
          "Workflows"
        ],
        "summary": "list (workflows)",
        "description": "tRPC `workflows.list` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/workflows/get-initial-instance": {
      "get": {
        "operationId": "workflows.getInitialInstance",
        "tags": [
          "Workflows"
        ],
        "summary": "getInitialInstance (workflows)",
        "description": "tRPC `workflows.getInitialInstance` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.getInitialInstance",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/workflows/update-node-config": {
      "post": {
        "operationId": "workflows.updateNodeConfig",
        "tags": [
          "Workflows"
        ],
        "summary": "updateNodeConfig (workflows)",
        "description": "tRPC `workflows.updateNodeConfig` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.updateNodeConfig",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/get-projection": {
      "get": {
        "operationId": "workflows.getProjection",
        "tags": [
          "Workflows"
        ],
        "summary": "getProjection (workflows)",
        "description": "tRPC `workflows.getProjection` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.getProjection",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/workflows/skip-node": {
      "post": {
        "operationId": "workflows.skipNode",
        "tags": [
          "Workflows"
        ],
        "summary": "skipNode (workflows)",
        "description": "tRPC `workflows.skipNode` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.skipNode",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/retry-node": {
      "post": {
        "operationId": "workflows.retryNode",
        "tags": [
          "Workflows"
        ],
        "summary": "retryNode (workflows)",
        "description": "tRPC `workflows.retryNode` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.retryNode",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/retry-publisher-attempt": {
      "post": {
        "operationId": "workflows.retryPublisherAttempt",
        "tags": [
          "Workflows"
        ],
        "summary": "retryPublisherAttempt (workflows)",
        "description": "tRPC `workflows.retryPublisherAttempt` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.retryPublisherAttempt",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/unpublish-draft": {
      "post": {
        "operationId": "workflows.unpublishDraft",
        "tags": [
          "Workflows"
        ],
        "summary": "unpublishDraft (workflows)",
        "description": "tRPC `workflows.unpublishDraft` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.unpublishDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/update-published-draft": {
      "post": {
        "operationId": "workflows.updatePublishedDraft",
        "tags": [
          "Workflows"
        ],
        "summary": "updatePublishedDraft (workflows)",
        "description": "tRPC `workflows.updatePublishedDraft` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.updatePublishedDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/continue-with-publisher": {
      "post": {
        "operationId": "workflows.continueWithPublisher",
        "tags": [
          "Workflows"
        ],
        "summary": "continueWithPublisher (workflows)",
        "description": "tRPC `workflows.continueWithPublisher` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.continueWithPublisher",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/duplicate-run": {
      "post": {
        "operationId": "workflows.duplicateRun",
        "tags": [
          "Workflows"
        ],
        "summary": "duplicateRun (workflows)",
        "description": "tRPC `workflows.duplicateRun` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.duplicateRun",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/retry-run": {
      "post": {
        "operationId": "workflows.retryRun",
        "tags": [
          "Workflows"
        ],
        "summary": "retryRun (workflows)",
        "description": "tRPC `workflows.retryRun` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.retryRun",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/download-report": {
      "get": {
        "operationId": "workflows.downloadReport",
        "tags": [
          "Workflows"
        ],
        "summary": "downloadReport (workflows)",
        "description": "tRPC `workflows.downloadReport` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.downloadReport",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/workflows/cancel-run": {
      "post": {
        "operationId": "workflows.cancelRun",
        "tags": [
          "Workflows"
        ],
        "summary": "cancelRun (workflows)",
        "description": "tRPC `workflows.cancelRun` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.cancelRun",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/workflows/restart-run": {
      "post": {
        "operationId": "workflows.restartRun",
        "tags": [
          "Workflows"
        ],
        "summary": "restartRun (workflows)",
        "description": "tRPC `workflows.restartRun` — stub tự sinh cho tenant. Xem `server/routers/workflows.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "workflows.restartRun",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/media/upload": {
      "post": {
        "operationId": "media.upload",
        "tags": [
          "Media"
        ],
        "summary": "upload (media)",
        "description": "tRPC `media.upload` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.upload",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/media/create-upload-session": {
      "post": {
        "operationId": "media.createUploadSession",
        "tags": [
          "Media"
        ],
        "summary": "createUploadSession (media)",
        "description": "tRPC `media.createUploadSession` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.createUploadSession",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/media/register-uploaded": {
      "post": {
        "operationId": "media.registerUploaded",
        "tags": [
          "Media"
        ],
        "summary": "registerUploaded (media)",
        "description": "tRPC `media.registerUploaded` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.registerUploaded",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/media/list": {
      "get": {
        "operationId": "media.list",
        "tags": [
          "Media"
        ],
        "summary": "list (media)",
        "description": "tRPC `media.list` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/media/list-paginated": {
      "get": {
        "operationId": "media.listPaginated",
        "tags": [
          "Media"
        ],
        "summary": "listPaginated (media)",
        "description": "tRPC `media.listPaginated` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.listPaginated",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/media/rights-for-draft": {
      "get": {
        "operationId": "media.rightsForDraft",
        "tags": [
          "Media"
        ],
        "summary": "rightsForDraft (media)",
        "description": "tRPC `media.rightsForDraft` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.rightsForDraft",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/media/confirm-rights-for-draft": {
      "post": {
        "operationId": "media.confirmRightsForDraft",
        "tags": [
          "Media"
        ],
        "summary": "confirmRightsForDraft (media)",
        "description": "tRPC `media.confirmRightsForDraft` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.confirmRightsForDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/media/update-metadata": {
      "post": {
        "operationId": "media.updateMetadata",
        "tags": [
          "Media"
        ],
        "summary": "updateMetadata (media)",
        "description": "tRPC `media.updateMetadata` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.updateMetadata",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/media/attach-to-draft": {
      "post": {
        "operationId": "media.attachToDraft",
        "tags": [
          "Media"
        ],
        "summary": "attachToDraft (media)",
        "description": "tRPC `media.attachToDraft` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.attachToDraft",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/media/delete": {
      "post": {
        "operationId": "media.delete",
        "tags": [
          "Media"
        ],
        "summary": "delete (media)",
        "description": "tRPC `media.delete` — stub tự sinh cho tenant. Xem `server/routers/media.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "media.delete",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/notifications/get-preferences": {
      "get": {
        "operationId": "notifications.getPreferences",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "getPreferences (notifications)",
        "description": "tRPC `notifications.getPreferences` — stub tự sinh cho tenant. Xem `server/routers/notifications.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "notifications.getPreferences",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/notifications/update-preference": {
      "post": {
        "operationId": "notifications.updatePreference",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "updatePreference (notifications)",
        "description": "tRPC `notifications.updatePreference` — stub tự sinh cho tenant. Xem `server/routers/notifications.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "notifications.updatePreference",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/notifications/list": {
      "get": {
        "operationId": "notifications.list",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "list (notifications)",
        "description": "tRPC `notifications.list` — stub tự sinh cho tenant. Xem `server/routers/notifications.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "notifications.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/notifications/mark-read": {
      "post": {
        "operationId": "notifications.markRead",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "markRead (notifications)",
        "description": "tRPC `notifications.markRead` — stub tự sinh cho tenant. Xem `server/routers/notifications.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "notifications.markRead",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/notifications/mark-all-read": {
      "post": {
        "operationId": "notifications.markAllRead",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "markAllRead (notifications)",
        "description": "tRPC `notifications.markAllRead` — stub tự sinh cho tenant. Xem `server/routers/notifications.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "notifications.markAllRead",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/notifications/unread-count": {
      "get": {
        "operationId": "notifications.unreadCount",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "unreadCount (notifications)",
        "description": "tRPC `notifications.unreadCount` — stub tự sinh cho tenant. Xem `server/routers/notifications.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "notifications.unreadCount",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/settings/get-content-strategy-profile": {
      "get": {
        "operationId": "settings.getContentStrategyProfile",
        "tags": [
          "Team & Settings"
        ],
        "summary": "getContentStrategyProfile (settings)",
        "description": "tRPC `settings.getContentStrategyProfile` — stub tự sinh cho tenant. Xem `server/routers/settings.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "settings.getContentStrategyProfile",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/settings/get-content-strategy-profile-history": {
      "get": {
        "operationId": "settings.getContentStrategyProfileHistory",
        "tags": [
          "Team & Settings"
        ],
        "summary": "getContentStrategyProfileHistory (settings)",
        "description": "tRPC `settings.getContentStrategyProfileHistory` — stub tự sinh cho tenant. Xem `server/routers/settings.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "settings.getContentStrategyProfileHistory",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/settings/save-content-strategy-profile": {
      "post": {
        "operationId": "settings.saveContentStrategyProfile",
        "tags": [
          "Team & Settings"
        ],
        "summary": "saveContentStrategyProfile (settings)",
        "description": "tRPC `settings.saveContentStrategyProfile` — stub tự sinh cho tenant. Xem `server/routers/settings.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "settings.saveContentStrategyProfile",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/settings/get-brand-voice": {
      "get": {
        "operationId": "settings.getBrandVoice",
        "tags": [
          "Team & Settings"
        ],
        "summary": "getBrandVoice (settings)",
        "description": "tRPC `settings.getBrandVoice` — stub tự sinh cho tenant. Xem `server/routers/settings.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "settings.getBrandVoice",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/settings/save-brand-voice": {
      "post": {
        "operationId": "settings.saveBrandVoice",
        "tags": [
          "Team & Settings"
        ],
        "summary": "saveBrandVoice (settings)",
        "description": "tRPC `settings.saveBrandVoice` — stub tự sinh cho tenant. Xem `server/routers/settings.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "settings.saveBrandVoice",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/team/list-members": {
      "get": {
        "operationId": "team.listMembers",
        "tags": [
          "Team & Settings"
        ],
        "summary": "listMembers (team)",
        "description": "tRPC `team.listMembers` — stub tự sinh cho tenant. Xem `server/routers/team.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "team.listMembers",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/team/invite": {
      "post": {
        "operationId": "team.invite",
        "tags": [
          "Team & Settings"
        ],
        "summary": "invite (team)",
        "description": "tRPC `team.invite` — stub tự sinh cho tenant. Xem `server/routers/team.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "team.invite",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/team/update-role": {
      "post": {
        "operationId": "team.updateRole",
        "tags": [
          "Team & Settings"
        ],
        "summary": "updateRole (team)",
        "description": "tRPC `team.updateRole` — stub tự sinh cho tenant. Xem `server/routers/team.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "team.updateRole",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/team/revoke-invitation": {
      "post": {
        "operationId": "team.revokeInvitation",
        "tags": [
          "Team & Settings"
        ],
        "summary": "revokeInvitation (team)",
        "description": "tRPC `team.revokeInvitation` — stub tự sinh cho tenant. Xem `server/routers/team.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "team.revokeInvitation",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/tenant-rules/list-admin-rules": {
      "get": {
        "operationId": "tenantRules.listAdminRules",
        "tags": [
          "Team & Settings"
        ],
        "summary": "listAdminRules (tenantRules)",
        "description": "tRPC `tenantRules.listAdminRules` — stub tự sinh cho tenant. Xem `server/routers/tenantRules.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "tenantRules.listAdminRules",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/tenant-rules/toggle-admin-rule": {
      "post": {
        "operationId": "tenantRules.toggleAdminRule",
        "tags": [
          "Team & Settings"
        ],
        "summary": "toggleAdminRule (tenantRules)",
        "description": "tRPC `tenantRules.toggleAdminRule` — stub tự sinh cho tenant. Xem `server/routers/tenantRules.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "tenantRules.toggleAdminRule",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/tenant-rules/list": {
      "get": {
        "operationId": "tenantRules.list",
        "tags": [
          "Team & Settings"
        ],
        "summary": "list (tenantRules)",
        "description": "tRPC `tenantRules.list` — stub tự sinh cho tenant. Xem `server/routers/tenantRules.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "tenantRules.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/tenant-rules/create": {
      "post": {
        "operationId": "tenantRules.create",
        "tags": [
          "Team & Settings"
        ],
        "summary": "create (tenantRules)",
        "description": "tRPC `tenantRules.create` — stub tự sinh cho tenant. Xem `server/routers/tenantRules.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "tenantRules.create",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/tenant-rules/update": {
      "post": {
        "operationId": "tenantRules.update",
        "tags": [
          "Team & Settings"
        ],
        "summary": "update (tenantRules)",
        "description": "tRPC `tenantRules.update` — stub tự sinh cho tenant. Xem `server/routers/tenantRules.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "tenantRules.update",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/tenant-rules/toggle": {
      "post": {
        "operationId": "tenantRules.toggle",
        "tags": [
          "Team & Settings"
        ],
        "summary": "toggle (tenantRules)",
        "description": "tRPC `tenantRules.toggle` — stub tự sinh cho tenant. Xem `server/routers/tenantRules.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "tenantRules.toggle",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/tenant-rules/delete": {
      "post": {
        "operationId": "tenantRules.delete",
        "tags": [
          "Team & Settings"
        ],
        "summary": "delete (tenantRules)",
        "description": "tRPC `tenantRules.delete` — stub tự sinh cho tenant. Xem `server/routers/tenantRules.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "tenantRules.delete",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/activity-log/get-member-activity": {
      "get": {
        "operationId": "activityLog.getMemberActivity",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "getMemberActivity (activityLog)",
        "description": "tRPC `activityLog.getMemberActivity` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.getMemberActivity",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/activity-log/list": {
      "get": {
        "operationId": "activityLog.list",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "list (activityLog)",
        "description": "tRPC `activityLog.list` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/activity-log/get-stats": {
      "get": {
        "operationId": "activityLog.getStats",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "getStats (activityLog)",
        "description": "tRPC `activityLog.getStats` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.getStats",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/activity-log/get-actors": {
      "get": {
        "operationId": "activityLog.getActors",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "getActors (activityLog)",
        "description": "tRPC `activityLog.getActors` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.getActors",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/activity-log/export-csv": {
      "get": {
        "operationId": "activityLog.exportCsv",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "exportCsv (activityLog)",
        "description": "tRPC `activityLog.exportCsv` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.exportCsv",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/activity-log/watch": {
      "post": {
        "operationId": "activityLog.watch",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "watch (activityLog)",
        "description": "tRPC `activityLog.watch` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.watch",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/activity-log/unwatch": {
      "post": {
        "operationId": "activityLog.unwatch",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "unwatch (activityLog)",
        "description": "tRPC `activityLog.unwatch` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.unwatch",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/activity-log/my-watches": {
      "get": {
        "operationId": "activityLog.myWatches",
        "tags": [
          "Notifications & Activity"
        ],
        "summary": "myWatches (activityLog)",
        "description": "tRPC `activityLog.myWatches` — stub tự sinh cho tenant. Xem `server/routers/activityLog.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "activityLog.myWatches",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/support/list": {
      "get": {
        "operationId": "support.list",
        "tags": [
          "Support & Contact"
        ],
        "summary": "list (support)",
        "description": "tRPC `support.list` — stub tự sinh cho tenant. Xem `server/routers/support.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "support.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/support/get-by-id": {
      "get": {
        "operationId": "support.getById",
        "tags": [
          "Support & Contact"
        ],
        "summary": "getById (support)",
        "description": "tRPC `support.getById` — stub tự sinh cho tenant. Xem `server/routers/support.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "support.getById",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/support/create": {
      "post": {
        "operationId": "support.create",
        "tags": [
          "Support & Contact"
        ],
        "summary": "create (support)",
        "description": "tRPC `support.create` — stub tự sinh cho tenant. Xem `server/routers/support.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "support.create",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/support/add-message": {
      "post": {
        "operationId": "support.addMessage",
        "tags": [
          "Support & Contact"
        ],
        "summary": "addMessage (support)",
        "description": "tRPC `support.addMessage` — stub tự sinh cho tenant. Xem `server/routers/support.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "support.addMessage",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/v1/features/list": {
      "get": {
        "operationId": "features.list",
        "tags": [
          "Team & Settings"
        ],
        "summary": "list (features)",
        "description": "tRPC `features.list` — stub tự sinh cho tenant. Xem `server/routers/features.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "features.list",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/features/check": {
      "get": {
        "operationId": "features.check",
        "tags": [
          "Team & Settings"
        ],
        "summary": "check (features)",
        "description": "tRPC `features.check` — stub tự sinh cho tenant. Xem `server/routers/features.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "features.check",
          "type": "query"
        },
        "parameters": []
      }
    },
    "/v1/contact/submit": {
      "post": {
        "operationId": "contact.submit",
        "tags": [
          "Support & Contact"
        ],
        "summary": "submit (contact)",
        "description": "tRPC `contact.submit` — stub tự sinh cho tenant. Xem `server/routers/contact.ts`",
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "x-trpc": {
          "path": "contact.submit",
          "type": "mutation"
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Clerk session JWT. Also send `x-clerk-org-id` if org context needed."
      },
      "internalSecret": {
        "type": "apiKey",
        "in": "header",
        "name": "x-internal-secret",
        "description": "Internal worker secret / CRON_SECRET"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorized — missing/invalid Clerk session",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TRPCError"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Forbidden — not tenant member / wrong role",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TRPCError"
            }
          }
        }
      },
      "BadRequest": {
        "description": "Bad request — Zod validation failed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TRPCError"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/TRPCError"
            }
          }
        }
      }
    },
    "schemas": {
      "TRPCError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "UNAUTHORIZED",
              "FORBIDDEN",
              "NOT_FOUND",
              "BAD_REQUEST",
              "CONFLICT",
              "TOO_MANY_REQUESTS",
              "INTERNAL_SERVER_ERROR"
            ]
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "httpStatus": {
                "type": "integer"
              }
            }
          }
        }
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string"
          },
          "file_type": {
            "type": "string",
            "enum": [
              "pdf",
              "docx",
              "doc",
              "txt",
              "md",
              "html",
              "htm",
              "url"
            ]
          },
          "storage_path": {
            "type": "string",
            "nullable": true
          },
          "source_metadata": {
            "type": "object",
            "properties": {
              "knowledge": {
                "$ref": "#/components/schemas/DocumentKnowledgeMetadata"
              }
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "ready",
              "error"
            ]
          },
          "chunk_count": {
            "type": "integer",
            "nullable": true
          },
          "document_version": {
            "type": "integer",
            "default": 1
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "knowledge": {
            "type": "object"
          },
          "usage": {
            "type": "object",
            "properties": {
              "jobs": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  }
                }
              },
              "generationCount": {
                "type": "integer"
              },
              "lastUsedAt": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              }
            }
          }
        }
      },
      "DocumentKnowledgeMetadata": {
        "type": "object",
        "properties": {
          "isPrimary": {
            "type": "boolean",
            "description": "Only one per tenant"
          },
          "description": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "type": "string"
          }
        }
      },
      "PaginatedDocuments": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Document"
            }
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "Job": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "job_type": {
            "type": "string",
            "enum": [
              "one_off",
              "recurring"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "processing",
              "error",
              "completed"
            ]
          },
          "cron_expression": {
            "type": "string",
            "nullable": true,
            "example": "0 9 * * 1"
          },
          "scheduled_dates": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "topic_source": {
            "type": "string",
            "enum": [
              "manual",
              "ai_suggest",
              "keyword_list"
            ]
          },
          "auto_publish": {
            "type": "boolean"
          },
          "auto_publish_threshold": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "publisher_connection_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "seo_action_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "next_run_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "last_run_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "CreateJobInput": {
        "type": "object",
        "required": [
          "name",
          "publisherConnectionId"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "publisherConnectionId": {
            "type": "string",
            "format": "uuid"
          },
          "jobType": {
            "type": "string",
            "enum": [
              "one_off",
              "recurring"
            ],
            "default": "recurring"
          },
          "cronExpression": {
            "type": "string",
            "description": "Validated via validateCron"
          },
          "scheduledDate": {
            "type": "string",
            "format": "date-time"
          },
          "scheduledDates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 30
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 20
          },
          "topicSource": {
            "type": "string",
            "enum": [
              "manual",
              "ai_suggest",
              "keyword_list"
            ]
          },
          "autoPublish": {
            "type": "boolean"
          },
          "autoPublishThreshold": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50
          },
          "contentInstructions": {
            "type": "string",
            "maxLength": 5000
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "maxItems": 10
          },
          "documentIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 50
          },
          "seoActionId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "JobInstance": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "job_id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "scheduled_date": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "skipped",
              "failed"
            ]
          },
          "day_mode": {
            "type": "string",
            "enum": [
              "generate",
              "select_existing"
            ]
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "content_instructions": {
            "type": "string"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "document_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "selected_draft_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        }
      },
      "Draft": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "job_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "instance_id": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "excerpt": {
            "type": "string",
            "nullable": true
          },
          "seo_meta": {
            "type": "object"
          },
          "seo_score": {
            "type": "integer",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "generating",
              "reviewing",
              "approved",
              "rejected",
              "published",
              "archived"
            ]
          },
          "word_count": {
            "type": "integer"
          },
          "featured_image_url": {
            "type": "string",
            "nullable": true
          },
          "published_url": {
            "type": "string",
            "nullable": true
          },
          "published_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublisherConnection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "platform": {
            "type": "string",
            "enum": [
              "wordpress",
              "webflow",
              "ghost",
              "shopify",
              "wordpress_com",
              "webhook",
              "haravan"
            ]
          },
          "name": {
            "type": "string"
          },
          "siteUrl": {
            "type": "string",
            "format": "uri"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "error"
            ]
          },
          "last_tested_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "ChatConversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "tenant_id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string"
          },
          "message_count": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "conversation_id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "content": {
            "type": "string"
          },
          "image_status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "x-archust": {
    "source": "server/routers/* + app/api/**",
    "trpcEndpoint": "/api/trpc",
    "auth": "Clerk JWT via server/context.ts — publicProcedure / protectedProcedure / tenantAdminProcedure / adminProcedure",
    "bulkLimits": "documents 100, jobs 50, drafts review 1-100",
    "credits": "documents.ingest / generation.blog / chat.message via lib/credits/service.ts with idempotencyKey",
    "adminNote": "Full admin routers (60 procedures, 30 sub-routers) summarized under /v1/admin — expand per lib/cache globalKey if exposing externally; all require isSuperAdmin + service-role Supabase",
    "todoForDocs": [
      "Copy openapi.json to public/openapi.json for Scalar",
      "Add scripts/generate-docs.ts with generateFiles for fumadocs-openapi",
      "Wire src/lib/openapi.ts + src/components/api-page.tsx + src/lib/source.ts plugin"
    ]
  }
}
