{
  "openapi": "3.1.0",
  "info": {
    "title": "SiteGPT Agent API",
    "version": "2.0.0",
    "description": "Agent-facing API for managing SiteGPT chatbots, dashboard summaries, appearance media, knowledge, settings, conversations, leads, members, account profiles, usage, billing reads, and API tokens."
  },
  "servers": [
    {
      "url": "https://sitegpt.ai"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Discovery"
    },
    {
      "name": "Onboarding"
    },
    {
      "name": "Account"
    },
    {
      "name": "Billing"
    },
    {
      "name": "Tokens"
    },
    {
      "name": "Chatbots"
    },
    {
      "name": "Knowledge"
    },
    {
      "name": "Knowledge Sync Jobs"
    },
    {
      "name": "Knowledge Sources"
    },
    {
      "name": "Custom Responses"
    },
    {
      "name": "Personas"
    },
    {
      "name": "Instructions"
    },
    {
      "name": "Settings"
    },
    {
      "name": "Conversation Starters"
    },
    {
      "name": "Conversation Followups"
    },
    {
      "name": "Members"
    },
    {
      "name": "Leads"
    },
    {
      "name": "Conversations"
    },
    {
      "name": "Messages"
    },
    {
      "name": "Tags"
    }
  ],
  "paths": {
    "/api/v2/openapi.json": {
      "get": {
        "operationId": "getOpenApiSpec",
        "summary": "Get OpenAPI spec",
        "description": "Get the SiteGPT agent API OpenAPI document.\n\nNo authentication is required.\n\nResponds with the raw JSON document, not the { ok, data, meta } envelope.",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "x-sitegpt-auth": "none",
        "x-sitegpt-scopes": [],
        "x-mint": {
          "title": "Get OpenAPI spec",
          "description": "Get the SiteGPT agent API OpenAPI document."
        },
        "responses": {
          "200": {
            "description": "The raw JSON document itself — these discovery endpoints do not use the { ok, data, meta } envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject",
                  "description": "The OpenAPI 3.1 document describing this API (this very document)."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/.well-known/sitegpt-agent.json": {
      "get": {
        "operationId": "getAgentManifest",
        "summary": "Get agent manifest",
        "description": "Get the SiteGPT agent manifest.\n\nNo authentication is required.\n\nResponds with the raw JSON document, not the { ok, data, meta } envelope.",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "x-sitegpt-auth": "none",
        "x-sitegpt-scopes": [],
        "x-mint": {
          "title": "Get agent manifest",
          "description": "Get the SiteGPT agent manifest."
        },
        "responses": {
          "200": {
            "description": "The raw JSON document itself — these discovery endpoints do not use the { ok, data, meta } envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericObject",
                  "description": "The SiteGPT agent manifest document."
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/health": {
      "get": {
        "operationId": "healthCheck",
        "summary": "Health check",
        "description": "Check that the SiteGPT API is up and answering. Returns the service name and current server time; useful as a first anonymous probe before authenticating.\n\nNo authentication is required.\n\nOn success, `data` contains: `status`, `service`, `time`.",
        "tags": [
          "Discovery"
        ],
        "security": [],
        "x-sitegpt-auth": "none",
        "x-sitegpt-scopes": [],
        "x-mint": {
          "title": "Health check",
          "description": "Check that the SiteGPT API is up and answering. Returns the service name and current server time; useful as a first anonymous probe before authenticating."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "status",
                        "service",
                        "time"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "ok"
                          ],
                          "description": "Always ok when the API is serving requests."
                        },
                        "service": {
                          "type": "string",
                          "const": "sitegpt"
                        },
                        "time": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Current server time in ISO 8601 format."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "status": "ok",
                    "service": "sitegpt",
                    "time": "2026-05-13T00:00:00.000Z"
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/onboarding/agent/start": {
      "post": {
        "operationId": "startOnboardingWorkspace",
        "summary": "Start onboarding",
        "description": "Start an agent-first onboarding workspace for a public website. Starts are limited per caller and overall; a 429 RATE_LIMITED answer carries Retry-After.\n\nNo authentication is required.\n\nOn success, `data` contains: `workspace`, `apiToken`, `apiBase`, `mcpUrl`, `expiresAt`, `onboardingUrl`, `statusUrl`, `claimUrl`.",
        "tags": [
          "Onboarding"
        ],
        "security": [],
        "x-sitegpt-auth": "none",
        "x-sitegpt-scopes": [],
        "x-mint": {
          "title": "Start onboarding",
          "description": "Start an agent-first onboarding workspace for a public website. Starts are limited per caller and overall; a 429 RATE_LIMITED answer carries Retry-After."
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "websiteUrl"
                ],
                "additionalProperties": false,
                "properties": {
                  "websiteUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Public website URL to prepare a temporary chatbot for."
                  },
                  "agentName": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "Optional display name of the AI agent starting setup."
                  },
                  "agentClientId": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "Optional stable client identifier for the agent runtime."
                  }
                }
              },
              "example": {
                "websiteUrl": "https://example.com",
                "agentName": "Claude",
                "agentClientId": "claude-web"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workspace": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Onboarding workspace record: id, chatbotId, sourceUrl, normalizedDomain, status, claim state, and expiry."
                        },
                        "apiToken": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Temporary one-chatbot token returned once for the setup agent."
                        },
                        "apiBase": {
                          "type": "string",
                          "format": "uri"
                        },
                        "mcpUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "onboardingUrl": {
                          "type": "string",
                          "format": "uri",
                          "description": "Single user-facing URL where the user can test and claim the chatbot."
                        },
                        "statusUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "claimUrl": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "workspace": {
                      "id": "workspace-id",
                      "chatbotId": "chatbot-id",
                      "sourceUrl": "https://example.com/",
                      "normalizedDomain": "example.com",
                      "status": "CREATED",
                      "expiresAt": "2026-05-20T00:00:00.000Z"
                    },
                    "apiToken": "sgpt_xxxxxxxxx",
                    "apiBase": "https://sitegpt.ai",
                    "mcpUrl": "https://sitegpt.ai/mcp",
                    "onboardingUrl": "https://sitegpt.ai/onboarding/preview/workspace-id",
                    "statusUrl": "https://sitegpt.ai/api/v2/onboarding/workspaces/workspace-id",
                    "claimUrl": "https://sitegpt.ai/api/v2/onboarding/workspaces/workspace-id/claim",
                    "expiresAt": "2026-05-20T00:00:00.000Z"
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "429": {
            "$ref": "#/components/responses/AgentRateLimited"
          }
        }
      }
    },
    "/api/v2/onboarding/workspaces/{workspaceId}": {
      "get": {
        "operationId": "getOnboardingWorkspace",
        "summary": "Get onboarding status",
        "description": "Get the onboarding workspace status using the temporary onboarding token.\n\nRequired scope: `account:read`.\n\nOn success, `data` contains: `workspace`, `setupChecklist`, `onboardingUrl`, `statusUrl`, `claimUrl`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:read"
        ],
        "x-mint": {
          "title": "Get onboarding status",
          "description": "Get the onboarding workspace status using the temporary onboarding token."
        },
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "description": "Onboarding workspace ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workspace": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Onboarding workspace record: id, chatbotId, sourceUrl, normalizedDomain, status, claim state, and expiry."
                        },
                        "setupChecklist": {
                          "type": "array",
                          "description": "Readiness checklist the agent should inspect before sharing the onboarding URL.",
                          "items": {
                            "type": "object",
                            "required": [
                              "key",
                              "label",
                              "state",
                              "detail"
                            ],
                            "additionalProperties": false,
                            "properties": {
                              "key": {
                                "type": "string",
                                "enum": [
                                  "brand_styling",
                                  "conversation_starters",
                                  "followup_prompts",
                                  "instructions",
                                  "knowledge",
                                  "persona"
                                ]
                              },
                              "label": {
                                "type": "string"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "DONE",
                                  "PENDING",
                                  "UNKNOWN",
                                  "WARNING"
                                ]
                              },
                              "detail": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "onboardingUrl": {
                          "type": "string",
                          "format": "uri",
                          "description": "Single user-facing URL where the user can test and claim the chatbot."
                        },
                        "statusUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "claimUrl": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "workspace": {
                      "id": "workspace-id",
                      "chatbotId": "chatbot-id",
                      "sourceUrl": "https://example.com/",
                      "normalizedDomain": "example.com",
                      "status": "CREATED",
                      "expiresAt": "2026-05-20T00:00:00.000Z",
                      "claim": {
                        "status": "NOT_STARTED",
                        "email": null,
                        "plan": null,
                        "interval": null,
                        "checkoutUrl": null
                      }
                    },
                    "setupChecklist": [
                      {
                        "key": "knowledge",
                        "label": "Knowledge",
                        "state": "DONE",
                        "detail": "24/24 trained from Sitemap."
                      },
                      {
                        "key": "persona",
                        "label": "Persona",
                        "state": "DONE",
                        "detail": "Custom persona active: Product expert."
                      }
                    ],
                    "claimUrl": "https://sitegpt.ai/api/v2/onboarding/workspaces/workspace-id/claim",
                    "onboardingUrl": "https://sitegpt.ai/onboarding/preview/workspace-id",
                    "statusUrl": "https://sitegpt.ai/api/v2/onboarding/workspaces/workspace-id"
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteOnboardingWorkspace",
        "summary": "Delete onboarding",
        "description": "Delete an unclaimed onboarding workspace and its temporary chatbot.\n\nRequired scope: `account:read`.\n\nOn success, `data` contains: `deletedWorkspace`, `message`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:read"
        ],
        "x-mint": {
          "title": "Delete onboarding",
          "description": "Delete an unclaimed onboarding workspace and its temporary chatbot."
        },
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "description": "Onboarding workspace ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedWorkspace": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Onboarding workspace record: id, chatbotId, sourceUrl, normalizedDomain, status, claim state, and expiry."
                        },
                        "message": {
                          "type": "string",
                          "description": "Confirms the onboarding workspace and temporary chatbot were deleted."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedWorkspace": {
                      "id": "workspace-id",
                      "chatbotId": "chatbot-id",
                      "sourceUrl": "https://example.com/",
                      "normalizedDomain": "example.com",
                      "status": "REVOKED",
                      "expiresAt": "2026-05-20T00:00:00.000Z"
                    },
                    "message": "The onboarding workspace and temporary chatbot were deleted. This workspace is no longer available."
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/onboarding/workspaces/{workspaceId}/claim": {
      "post": {
        "operationId": "claimOnboardingWorkspace",
        "summary": "Claim onboarding",
        "description": "Create checkout for an onboarding workspace claim.\n\nRequired scope: `account:read`.\n\nOn success, `data` contains: `workspace`, `checkoutUrl`, `paddleTransactionId`, `onboardingUrl`, `statusUrl`, `claimUrl`.",
        "tags": [
          "Onboarding"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:read"
        ],
        "x-mint": {
          "title": "Claim onboarding",
          "description": "Create checkout for an onboarding workspace claim."
        },
        "parameters": [
          {
            "name": "workspaceId",
            "in": "path",
            "required": true,
            "description": "Onboarding workspace ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "plan",
                  "interval"
                ],
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 254,
                    "description": "Customer email that should own the chatbot after checkout starts the trial."
                  },
                  "plan": {
                    "type": "string",
                    "enum": [
                      "STARTER",
                      "GROWTH",
                      "SCALE"
                    ],
                    "description": "SiteGPT plan selected by the user."
                  },
                  "interval": {
                    "type": "string",
                    "enum": [
                      "MONTH",
                      "YEAR"
                    ],
                    "description": "Billing interval selected by the user."
                  }
                }
              },
              "example": {
                "email": "user@example.com",
                "plan": "GROWTH",
                "interval": "MONTH"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "workspace": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Onboarding workspace record: id, chatbotId, sourceUrl, normalizedDomain, status, claim state, and expiry."
                        },
                        "checkoutUrl": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uri"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "SiteGPT checkout URL the user should open to start the trial. Null when the email already belongs to the signed-in active subscriber and the chatbot was claimed directly."
                        },
                        "paddleTransactionId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "onboardingUrl": {
                          "type": "string",
                          "format": "uri",
                          "description": "Single user-facing URL where the user can test and claim the chatbot."
                        },
                        "statusUrl": {
                          "type": "string",
                          "format": "uri"
                        },
                        "claimUrl": {
                          "type": "string",
                          "format": "uri"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "workspace": {
                      "id": "workspace-id",
                      "chatbotId": "chatbot-id",
                      "sourceUrl": "https://example.com/",
                      "normalizedDomain": "example.com",
                      "status": "CREATED",
                      "expiresAt": "2026-05-20T00:00:00.000Z",
                      "claim": {
                        "status": "CHECKOUT_PENDING",
                        "email": "user@example.com",
                        "plan": "GROWTH",
                        "interval": "MONTH",
                        "checkoutUrl": "https://sitegpt.ai/pricing?_ptxn=txn_xxxxxxxxx"
                      }
                    },
                    "checkoutUrl": "https://sitegpt.ai/pricing?_ptxn=txn_xxxxxxxxx",
                    "paddleTransactionId": "txn_xxxxxxxxx",
                    "onboardingUrl": "https://sitegpt.ai/onboarding/preview/workspace-id",
                    "statusUrl": "https://sitegpt.ai/api/v2/onboarding/workspaces/workspace-id",
                    "claimUrl": "https://sitegpt.ai/api/v2/onboarding/workspaces/workspace-id/claim"
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "502": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Get current user",
        "description": "Get the authenticated user and credential context.\n\nRequires a valid SiteGPT bearer token.\n\nOn success, `data` contains: `user`, `auth`.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [],
        "x-mint": {
          "title": "Get current user",
          "description": "Get the authenticated user and credential context."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "user": {
                          "$ref": "#/components/schemas/AccountUser"
                        },
                        "auth": {
                          "type": "object",
                          "description": "How this request was authenticated.",
                          "additionalProperties": true,
                          "properties": {
                            "credentialType": {
                              "type": "string"
                            },
                            "tokenId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "user": {
                      "id": "user-id",
                      "email": "user@example.com",
                      "name": "SiteGPT User"
                    },
                    "auth": {
                      "type": "api-token",
                      "scopes": []
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "Get account",
        "description": "Get current account user and auth metadata.\n\nRequired scope: `account:read`.\n\nOn success, `data` contains: `user`, `auth`.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:read"
        ],
        "x-mint": {
          "title": "Get account",
          "description": "Get current account user and auth metadata."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "user": {
                          "$ref": "#/components/schemas/AccountUser"
                        },
                        "auth": {
                          "type": "object",
                          "description": "How this request was authenticated.",
                          "additionalProperties": true,
                          "properties": {
                            "credentialType": {
                              "type": "string"
                            },
                            "tokenId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "user": {
                      "id": "user-id",
                      "email": "user@example.com",
                      "name": "SiteGPT User"
                    },
                    "auth": {
                      "type": "api-token",
                      "scopes": [
                        "account:read"
                      ]
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/account/profile": {
      "patch": {
        "operationId": "updateAccountProfile",
        "summary": "Update profile",
        "description": "Update the authenticated user profile name.\n\nRequired scope: `account:write`.\n\nOn success, `data` contains: `user`.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:write"
        ],
        "x-mint": {
          "title": "Update profile",
          "description": "Update the authenticated user profile name."
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "user": {
                          "$ref": "#/components/schemas/AccountUser"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "user": {
                      "id": "user-id",
                      "email": "user@example.com",
                      "name": "SiteGPT User"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/account/profile-picture": {
      "post": {
        "operationId": "uploadAccountProfilePicture",
        "summary": "Upload profile picture",
        "description": "Upload the authenticated user profile picture.\n\nRequired scope: `account:write`.\n\nOn success, `data` contains: `user`, `profilePicture`.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:write"
        ],
        "x-mint": {
          "title": "Upload profile picture",
          "description": "Upload the authenticated user profile picture."
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "imageBase64"
                ],
                "additionalProperties": false,
                "properties": {
                  "imageBase64": {
                    "type": "string",
                    "description": "Base64 image content. Data URLs are accepted."
                  },
                  "fileName": {
                    "type": "string"
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "Image MIME type, for example image/png."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "user": {
                          "$ref": "#/components/schemas/AccountUser"
                        },
                        "profilePicture": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "imageId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "imageUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "user": {
                      "id": "user-id",
                      "email": "user@example.com",
                      "name": "SiteGPT User"
                    },
                    "profilePicture": {
                      "imageId": "image-id",
                      "imageUrl": "https://example.com/i"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteAccountProfilePicture",
        "summary": "Delete profile picture",
        "description": "Delete the authenticated user profile picture. Requires confirm=true.\n\nRequired scope: `account:write`.\n\nOn success, `data` contains: `user`, `profilePicture`.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:write"
        ],
        "x-mint": {
          "title": "Delete profile picture",
          "description": "Delete the authenticated user profile picture. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "user": {
                          "$ref": "#/components/schemas/AccountUser"
                        },
                        "profilePicture": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "imageId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "imageUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "user": {
                      "id": "user-id",
                      "email": "user@example.com",
                      "name": "SiteGPT User"
                    },
                    "profilePicture": {
                      "imageId": null,
                      "imageUrl": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/usage": {
      "get": {
        "operationId": "getUsage",
        "summary": "Get Usage",
        "description": "Get account usage.\n\nRequired scope: `account:read`.\n\nOn success, `data` contains: `usageWindow`, `usage`, `quotas`, `remaining`, `history`.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:read"
        ],
        "x-mint": {
          "title": "Get Usage",
          "description": "Get account usage."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "usageWindow": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "startDate": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "endDate": {
                              "type": "string",
                              "format": "date-time"
                            }
                          }
                        },
                        "usage": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "chatbots": {
                              "type": "integer"
                            },
                            "pages": {
                              "type": "integer"
                            },
                            "normalMessages": {
                              "type": "integer"
                            },
                            "gpt4Messages": {
                              "type": "integer"
                            },
                            "combinedMessages": {
                              "type": "integer"
                            },
                            "members": {
                              "type": "integer"
                            }
                          }
                        },
                        "quotas": {
                          "$ref": "#/components/schemas/AccountQuotas"
                        },
                        "remaining": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "chatbots": {
                              "type": "integer"
                            },
                            "pages": {
                              "type": "integer"
                            },
                            "normalMessages": {
                              "type": "integer"
                            },
                            "gpt4Messages": {
                              "type": "integer"
                            },
                            "combinedMessages": {
                              "type": "integer"
                            },
                            "members": {
                              "type": "integer"
                            }
                          }
                        },
                        "history": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Historical usage entry."
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "usageWindow": {
                      "startDate": "2026-05-01T00:00:00.000Z",
                      "endDate": "2026-05-31T23:59:59.999Z"
                    },
                    "usage": {
                      "chatbots": 1,
                      "pages": 120,
                      "combinedMessages": 45
                    },
                    "quotas": {
                      "chatbotsQuota": 3,
                      "pagesQuota": 1000
                    },
                    "remaining": {
                      "chatbots": 2,
                      "pages": 880
                    },
                    "history": []
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/limits": {
      "get": {
        "operationId": "getLimits",
        "summary": "Get Limits",
        "description": "Get account limits and remaining quotas.\n\nRequired scope: `account:read`.\n\nOn success, `data` contains: `total`, `assigned`, `available`, `chatbots`.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "bearerAuth": [
              "account:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "account:read"
        ],
        "x-mint": {
          "title": "Get Limits",
          "description": "Get account limits and remaining quotas."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "total": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "pagesQuota": {
                              "type": "integer"
                            },
                            "combinedMessagesQuota": {
                              "type": "integer"
                            },
                            "membersQuota": {
                              "type": "integer"
                            }
                          }
                        },
                        "assigned": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "pagesQuota": {
                              "type": "integer"
                            },
                            "combinedMessagesQuota": {
                              "type": "integer"
                            },
                            "membersQuota": {
                              "type": "integer"
                            }
                          }
                        },
                        "available": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "pagesQuota": {
                              "type": "integer"
                            },
                            "combinedMessagesQuota": {
                              "type": "integer"
                            },
                            "membersQuota": {
                              "type": "integer"
                            }
                          }
                        },
                        "chatbots": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "pagesQuota": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "combinedMessagesQuota": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "membersQuota": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "total": {
                      "pagesQuota": 1000,
                      "combinedMessagesQuota": 500,
                      "membersQuota": 5
                    },
                    "assigned": {
                      "pagesQuota": 400,
                      "combinedMessagesQuota": 200,
                      "membersQuota": 2
                    },
                    "available": {
                      "pagesQuota": 600,
                      "combinedMessagesQuota": 300,
                      "membersQuota": 3
                    },
                    "chatbots": [
                      {
                        "id": "chatbot-id",
                        "title": "Example chatbot",
                        "pagesQuota": 400,
                        "combinedMessagesQuota": 200,
                        "membersQuota": 2
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/billing/subscription": {
      "get": {
        "operationId": "getBillingSubscription",
        "summary": "Get subscription",
        "description": "Get billing subscription state.\n\nRequired scope: `billing:read`.\n\nOn success, `data` contains: `customers`, `subscriptions`, `subscription`, `products`.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "billing:read"
        ],
        "x-mint": {
          "title": "Get subscription",
          "description": "Get billing subscription state."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "customers": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/BillingCustomer"
                          }
                        },
                        "subscriptions": {
                          "type": "array",
                          "items": {
                            "anyOf": [
                              {
                                "$ref": "#/components/schemas/BillingSubscription"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "subscription": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/BillingSubscription"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "products": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "sitegpt": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/BillingProduct"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "watermarkAddon": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/BillingProduct"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "extraMessagesAddon": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/BillingProduct"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "webhookAddon": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/BillingProduct"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "whatsappAddon": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/BillingProduct"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "emailAddon": {
                              "anyOf": [
                                {
                                  "$ref": "#/components/schemas/BillingProduct"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "customers": [
                      {
                        "id": "ctm_x",
                        "email": "user@example.com",
                        "status": "active"
                      }
                    ],
                    "subscriptions": [
                      {
                        "id": "sub_x",
                        "status": "active"
                      }
                    ],
                    "subscription": {
                      "id": "sub_x",
                      "status": "active"
                    },
                    "products": {
                      "sitegpt": {
                        "productId": "pro_x",
                        "pricingName": "Growth",
                        "interval": "month"
                      },
                      "watermarkAddon": null,
                      "extraMessagesAddon": null,
                      "webhookAddon": null,
                      "whatsappAddon": null,
                      "emailAddon": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/billing/invoices": {
      "get": {
        "operationId": "listBillingInvoices",
        "summary": "List invoices",
        "description": "List billing invoices and transaction download links.\n\nRequired scope: `billing:read`.\n\nOn success, `data` contains: `invoices`.",
        "tags": [
          "Billing"
        ],
        "security": [
          {
            "bearerAuth": [
              "billing:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "billing:read"
        ],
        "x-mint": {
          "title": "List invoices",
          "description": "List billing invoices and transaction download links."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "invoices": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Invoice"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "invoices": [
                      {
                        "id": "txn_x",
                        "status": "completed",
                        "amount": "4900",
                        "currencyCode": "USD",
                        "downloadUrl": "https://example.com/invoice.pdf"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/tokens": {
      "get": {
        "operationId": "listTokens",
        "summary": "List tokens",
        "description": "List API tokens for the authenticated user.\n\nRequired scope: `tokens:read`.\n\nDashboard sessions can call this route, and API tokens must include the listed scope.\n\nOn success, `data` contains: `tokens`.",
        "tags": [
          "Tokens"
        ],
        "security": [
          {
            "bearerAuth": [
              "tokens:read"
            ]
          }
        ],
        "x-sitegpt-auth": "dashboard-or-bearer",
        "x-sitegpt-scopes": [
          "tokens:read"
        ],
        "x-mint": {
          "title": "List tokens",
          "description": "List API tokens for the authenticated user."
        },
        "parameters": [
          {
            "name": "includeRevoked",
            "in": "query",
            "required": false,
            "description": "Include revoked tokens. Revoked tokens are hidden by default.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "tokens": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ApiToken"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "tokens": [
                      {
                        "id": "token-id",
                        "name": "Knowledge updater"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createToken",
        "summary": "Create token",
        "description": "Create a scoped API token.\n\nRequired scope: `tokens:write`.\n\nDashboard sessions can call this route, and API tokens must include the listed scope.\n\nOn success, `data` contains: `token`.",
        "tags": [
          "Tokens"
        ],
        "security": [
          {
            "bearerAuth": [
              "tokens:write"
            ]
          }
        ],
        "x-sitegpt-auth": "dashboard-or-bearer",
        "x-sitegpt-scopes": [
          "tokens:write"
        ],
        "x-mint": {
          "title": "Create token",
          "description": "Create a scoped API token."
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "scopes": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "account:read",
                        "account:write",
                        "tokens:read",
                        "tokens:write",
                        "chatbots:read",
                        "chatbots:write",
                        "chatbots:delete",
                        "knowledge:read",
                        "knowledge:write",
                        "knowledge:delete",
                        "personas:read",
                        "personas:write",
                        "personas:delete",
                        "instructions:read",
                        "instructions:write",
                        "instructions:delete",
                        "settings:read",
                        "settings:write",
                        "starters:read",
                        "starters:write",
                        "starters:delete",
                        "followups:read",
                        "followups:write",
                        "followups:delete",
                        "conversations:read",
                        "conversations:write",
                        "conversations:delete",
                        "leads:read",
                        "leads:write",
                        "leads:delete",
                        "members:read",
                        "members:write",
                        "members:delete",
                        "integrations:read",
                        "integrations:write",
                        "billing:read",
                        "billing:write"
                      ]
                    }
                  },
                  "chatbotIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional chatbot IDs to restrict this token to. Omit for all accessible chatbots."
                  },
                  "expiresInDays": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365,
                    "default": 90
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Absolute token expiration. Cannot be combined with expiresInDays."
                  }
                }
              },
              "example": {
                "name": "Knowledge updater",
                "scopes": [
                  "account:read",
                  "chatbots:read",
                  "knowledge:read",
                  "knowledge:write"
                ],
                "expiresInDays": 90
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "token": {
                          "$ref": "#/components/schemas/ApiTokenWithSecret"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "token": {
                      "id": "token-id",
                      "name": "Knowledge updater",
                      "scopes": [
                        "account:read",
                        "chatbots:read",
                        "knowledge:write"
                      ],
                      "token": "sgpt_xxxxxxxxx"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/tokens/{tokenId}": {
      "delete": {
        "operationId": "revokeToken",
        "summary": "Revoke token",
        "description": "Revoke an API token.\n\nRequired scope: `tokens:write`.\n\nDashboard sessions can call this route, and API tokens must include the listed scope.\n\nOn success, `data` contains: `token`.",
        "tags": [
          "Tokens"
        ],
        "security": [
          {
            "bearerAuth": [
              "tokens:write"
            ]
          }
        ],
        "x-sitegpt-auth": "dashboard-or-bearer",
        "x-sitegpt-scopes": [
          "tokens:write"
        ],
        "x-mint": {
          "title": "Revoke token",
          "description": "Revoke an API token."
        },
        "parameters": [
          {
            "name": "tokenId",
            "in": "path",
            "required": true,
            "description": "API token ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "token": {
                          "$ref": "#/components/schemas/ApiToken"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "token": {
                      "id": "token-id",
                      "name": "Example token",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/tokens/{tokenId}/rotate": {
      "post": {
        "operationId": "rotateToken",
        "summary": "Rotate token",
        "description": "Rotate an active API token and return the new plaintext token once.\n\nRequired scope: `tokens:write`.\n\nDashboard sessions can call this route, and API tokens must include the listed scope.\n\nOn success, `data` contains: `token`, `revokedToken`.",
        "tags": [
          "Tokens"
        ],
        "security": [
          {
            "bearerAuth": [
              "tokens:write"
            ]
          }
        ],
        "x-sitegpt-auth": "dashboard-or-bearer",
        "x-sitegpt-scopes": [
          "tokens:write"
        ],
        "x-mint": {
          "title": "Rotate token",
          "description": "Rotate an active API token and return the new plaintext token once."
        },
        "parameters": [
          {
            "name": "tokenId",
            "in": "path",
            "required": true,
            "description": "API token ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "token": {
                          "$ref": "#/components/schemas/ApiTokenWithSecret"
                        },
                        "revokedToken": {
                          "$ref": "#/components/schemas/ApiToken"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "token": {
                      "id": "new-token-id",
                      "name": "Knowledge updater",
                      "token": "sgpt_xxxxxxxxx"
                    },
                    "revokedToken": {
                      "id": "token-id",
                      "revokedReason": "ROTATED"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots": {
      "get": {
        "operationId": "listChatbots",
        "summary": "List chatbots",
        "description": "List chatbots accessible to the authenticated user, most recently added first, 100 per page by default (limit up to 200). Follow nextCursor for the next page.\n\nRequired scope: `chatbots:read`.\n\nOn success, `data` contains: `chatbots`, `pagination`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:read"
        ],
        "x-mint": {
          "title": "List chatbots",
          "description": "List chatbots accessible to the authenticated user, most recently added first, 100 per page by default (limit up to 200). Follow nextCursor for the next page."
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Chatbots per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page. Leave it out for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "chatbots": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Chatbot"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "chatbots": [
                      {
                        "id": "chatbot-id",
                        "title": "Example chatbot"
                      }
                    ],
                    "pagination": {
                      "limit": 100,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createChatbot",
        "summary": "Create chatbot",
        "description": "Create a chatbot.\n\nRequired scope: `chatbots:write`.\n\nOn success, `data` contains: `chatbot`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:write"
        ],
        "x-mint": {
          "title": "Create chatbot",
          "description": "Create a chatbot."
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              },
              "example": {
                "title": "Acme Support",
                "description": "Answers customer support questions for Acme."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "chatbot": {
                          "$ref": "#/components/schemas/Chatbot"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "chatbot": {
                      "id": "chatbot-id",
                      "name": "Example chatbot",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}": {
      "get": {
        "operationId": "getChatbot",
        "summary": "Get chatbot",
        "description": "Get one chatbot.\n\nRequired scope: `chatbots:read`.\n\nOn success, `data` contains: `chatbot`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:read"
        ],
        "x-mint": {
          "title": "Get chatbot",
          "description": "Get one chatbot."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "chatbot": {
                          "$ref": "#/components/schemas/Chatbot"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "chatbot": {
                      "id": "chatbot-id",
                      "name": "Example chatbot",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateChatbot",
        "summary": "Update chatbot",
        "description": "Update chatbot title or description.\n\nRequired scope: `chatbots:write`.\n\nOn success, `data` contains: `chatbot`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:write"
        ],
        "x-mint": {
          "title": "Update chatbot",
          "description": "Update chatbot title or description."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              },
              "example": {
                "title": "Acme Help Center"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "chatbot": {
                          "$ref": "#/components/schemas/Chatbot"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "chatbot": {
                      "id": "chatbot-id",
                      "name": "Example chatbot",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteChatbot",
        "summary": "Delete chatbot",
        "description": "Delete a chatbot. Requires confirm=true.\n\nRequired scope: `chatbots:delete`.\n\nOn success, `data` contains: `deletedChatbot`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:delete"
        ],
        "x-mint": {
          "title": "Delete chatbot",
          "description": "Delete a chatbot. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedChatbot": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedChatbot": {
                      "id": "chatbot-id",
                      "name": "Example chatbot",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/dashboard": {
      "get": {
        "operationId": "getChatbotDashboard",
        "summary": "Get dashboard summary",
        "description": "Get chatbot dashboard summary, knowledge counts, conversation feedback, and install metadata.\n\nRequired scope: `chatbots:read`.\n\nOn success, `data` is: Aggregated dashboard summary for the chatbot: activity, usage, and setup state.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:read"
        ],
        "x-mint": {
          "title": "Get dashboard summary",
          "description": "Get chatbot dashboard summary, knowledge counts, conversation feedback, and install metadata."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/GenericObject",
                      "description": "Aggregated dashboard summary for the chatbot: activity, usage, and setup state."
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "chatbot": {
                      "id": "chatbot-id",
                      "name": "Example chatbot",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/analytics": {
      "get": {
        "operationId": "getChatbotAnalytics",
        "summary": "Get analytics",
        "description": "Get daily engagement analytics: widget opens, conversations, messages, reactions, unique visitors, escalations, and leads, with totals and a prior-period comparison. Requires analytics to be enabled for the account (403 ANALYTICS_LOCKED otherwise); insight-derived counters appear only when insights is enabled.\n\nRequired scope: `chatbots:read`.\n\nOn success, `data` contains: `analytics`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:read"
        ],
        "x-mint": {
          "title": "Get analytics",
          "description": "Get daily engagement analytics: widget opens, conversations, messages, reactions, unique visitors, escalations, and leads, with totals and a prior-period comparison. Requires analytics to be enabled for the account (403 ANALYTICS_LOCKED otherwise); insight-derived counters appear only when insights is enabled."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "startDay",
            "in": "query",
            "required": false,
            "description": "First UTC day of the range (YYYY-MM-DD). Defaults to a trailing 30-day window ending at endDay.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "endDay",
            "in": "query",
            "required": false,
            "description": "Last UTC day of the range (YYYY-MM-DD). Defaults to today (UTC). The range spans at most 366 days.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "analytics": {
                          "$ref": "#/components/schemas/ChatbotAnalytics"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "analytics": {
                      "startDay": "2026-07-28",
                      "endDay": "2026-08-26",
                      "insightsEnabled": true,
                      "days": [
                        {
                          "day": "2026-08-26",
                          "widgetOpens": 42,
                          "messages": 18,
                          "aiMessages": 18,
                          "positiveReactions": 3,
                          "negativeReactions": 0,
                          "threadsStarted": 9,
                          "uniqueVisitors": 8,
                          "escalations": 1,
                          "leads": 2,
                          "unansweredTurns": 1,
                          "sentimentNegative": 1,
                          "resolvedByAi": 6,
                          "handedOff": 1,
                          "classifiedThreads": 7
                        }
                      ],
                      "totals": {
                        "widgetOpens": 1180,
                        "messages": 640,
                        "aiMessages": 640,
                        "positiveReactions": 88,
                        "negativeReactions": 6,
                        "threadsStarted": 240,
                        "uniqueVisitors": 210,
                        "escalations": 14,
                        "leads": 31,
                        "unansweredTurns": 12,
                        "sentimentNegative": 9,
                        "resolvedByAi": 180,
                        "handedOff": 22,
                        "classifiedThreads": 205
                      },
                      "prior": {
                        "widgetOpens": 1050,
                        "messages": 590,
                        "aiMessages": 590,
                        "positiveReactions": 74,
                        "negativeReactions": 9,
                        "threadsStarted": 221,
                        "uniqueVisitors": 195,
                        "escalations": 17,
                        "leads": 26,
                        "unansweredTurns": 15,
                        "sentimentNegative": 11,
                        "resolvedByAi": 160,
                        "handedOff": 25,
                        "classifiedThreads": 188
                      }
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/icons": {
      "post": {
        "operationId": "uploadChatbotIcon",
        "summary": "Upload icon",
        "description": "Upload a chatbot appearance icon. Supported types: bot, person, agent, watermark, and chat-bubble.\n\nRequired scope: `settings:write`.\n\nOn success, `data` contains: `icon`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "settings:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "settings:write"
        ],
        "x-mint": {
          "title": "Upload icon",
          "description": "Upload a chatbot appearance icon. Supported types: bot, person, agent, watermark, and chat-bubble."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "iconType",
                  "imageBase64"
                ],
                "additionalProperties": false,
                "properties": {
                  "iconType": {
                    "type": "string",
                    "enum": [
                      "bot",
                      "person",
                      "agent",
                      "watermark",
                      "chat-bubble"
                    ]
                  },
                  "imageBase64": {
                    "type": "string",
                    "description": "Base64 image content. Data URLs are accepted."
                  },
                  "fileName": {
                    "type": "string"
                  },
                  "mimeType": {
                    "type": "string",
                    "description": "Image MIME type, for example image/png."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "icon": {
                          "$ref": "#/components/schemas/ChatbotIcon"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "icon": {
                      "type": "bot",
                      "label": "Bot icon",
                      "settingsKey": "botIcon",
                      "imageId": "image-id",
                      "imageUrl": "https://example.com/icon.png"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/icons/{iconType}": {
      "delete": {
        "operationId": "deleteChatbotIcon",
        "summary": "Delete icon",
        "description": "Delete a chatbot appearance icon. Requires confirm=true.\n\nRequired scope: `settings:write`.\n\nOn success, `data` contains: `icon`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "settings:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "settings:write"
        ],
        "x-mint": {
          "title": "Delete icon",
          "description": "Delete a chatbot appearance icon. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "iconType",
            "in": "path",
            "required": true,
            "description": "Chatbot icon slot.",
            "schema": {
              "type": "string",
              "enum": [
                "bot",
                "person",
                "agent",
                "watermark",
                "chat-bubble"
              ]
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "icon": {
                          "$ref": "#/components/schemas/ChatbotIcon"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "icon": {
                      "type": "bot",
                      "label": "Bot icon",
                      "settingsKey": "botIcon",
                      "imageId": null,
                      "imageUrl": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/transfer": {
      "post": {
        "operationId": "transferChatbot",
        "summary": "Transfer Chatbot",
        "description": "Ask to transfer a chatbot to another person in the same brand (reassign ownership). Provide email or userId. Ownership does not move yet: the recipient gets an email and accepts or declines on the dashboard or with POST /api/v2/transfers/{transferId}/accept. No account is made for them until they sign in. The request stays open for 7 days, a new request replaces the open one, and DELETE cancels it. On accept the previous owner is removed from the chatbot, or kept as a member at keepSourceAs. Requires the chatbot_transfer permission, held by SUPER_ADMIN members (the chatbot creator is always a SUPER_ADMIN).\n\nRequired scope: `chatbots:write`, `members:write`, `members:delete`.\n\nOn success, `data` contains: `transfer`, `replacedPendingTransfer`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:write",
              "members:write",
              "members:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:write",
          "members:write",
          "members:delete"
        ],
        "x-mint": {
          "title": "Transfer Chatbot",
          "description": "Ask to transfer a chatbot to another person in the same brand (reassign ownership). Provide email or userId. Ownership does not move yet: the recipient gets an email and accepts or declines on the dashboard or with POST /api/v2/transfers/{transferId}/accept. No account is made for them until they sign in. The request stays open for 7 days, a new request replaces the open one, and DELETE cancels it. On accept the previous owner is removed from the chatbot, or kept as a member at keepSourceAs. Requires the chatbot_transfer permission, held by SUPER_ADMIN members (the chatbot creator is always a SUPER_ADMIN)."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "anyOf": [
                  {
                    "required": [
                      "email"
                    ]
                  },
                  {
                    "required": [
                      "userId"
                    ]
                  }
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Email of the person to transfer ownership to. They get an email and must accept the transfer; no account is made for them until they sign in."
                  },
                  "userId": {
                    "type": "string",
                    "description": "User id of the recipient. Use instead of email, or to disambiguate. Must be a user in the same brand."
                  },
                  "keepSourceAs": {
                    "type": "string",
                    "enum": [
                      "AGENT",
                      "MANAGER",
                      "ADMIN",
                      "SUPER_ADMIN"
                    ],
                    "description": "If set, keep the previous owner as a member at this role when the recipient accepts (ownership reassignment within a team). If omitted, the previous owner is removed from the chatbot on accept (full transfer)."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "transfer": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "pending"
                              ]
                            },
                            "chatbotId": {
                              "type": "string"
                            },
                            "chatbotTitle": {
                              "type": "string"
                            },
                            "toEmail": {
                              "type": "string",
                              "format": "email"
                            },
                            "keepSourceAs": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "AGENT",
                                "MANAGER",
                                "ADMIN",
                                "SUPER_ADMIN",
                                null
                              ],
                              "description": "The role the previous owner keeps on accept, or null when they are removed."
                            },
                            "requestedById": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "expiresAt": {
                              "type": "string",
                              "format": "date-time"
                            }
                          }
                        },
                        "replacedPendingTransfer": {
                          "type": "boolean",
                          "description": "True when this request replaced an open one."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "transfer": {
                      "id": "b1f0c6de-6f3a-4c39-9a51-2f6e0d6f5a10",
                      "status": "pending",
                      "chatbotId": "chatbot_123",
                      "chatbotTitle": "Support Bot",
                      "toEmail": "new-owner@example.com",
                      "keepSourceAs": null,
                      "requestedById": "user_123",
                      "createdAt": "2026-11-07T10:00:00.000Z",
                      "expiresAt": "2026-11-14T10:00:00.000Z"
                    },
                    "replacedPendingTransfer": false
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "502": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "get": {
        "operationId": "getChatbotTransfer",
        "summary": "Get Chatbot Transfer",
        "description": "Get the chatbot's open transfer request, or null when there is none. Requires the chatbot_transfer permission.\n\nRequired scope: `chatbots:read`, `members:read`.\n\nOn success, `data` contains: `transfer`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:read",
              "members:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:read",
          "members:read"
        ],
        "x-mint": {
          "title": "Get Chatbot Transfer",
          "description": "Get the chatbot's open transfer request, or null when there is none. Requires the chatbot_transfer permission."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "transfer": {
                          "anyOf": [
                            {
                              "type": "object",
                              "additionalProperties": false,
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "pending"
                                  ]
                                },
                                "chatbotId": {
                                  "type": "string"
                                },
                                "chatbotTitle": {
                                  "type": "string"
                                },
                                "toEmail": {
                                  "type": "string",
                                  "format": "email"
                                },
                                "keepSourceAs": {
                                  "type": [
                                    "string",
                                    "null"
                                  ],
                                  "enum": [
                                    "AGENT",
                                    "MANAGER",
                                    "ADMIN",
                                    "SUPER_ADMIN",
                                    null
                                  ],
                                  "description": "The role the previous owner keeps on accept, or null when they are removed."
                                },
                                "requestedById": {
                                  "type": "string"
                                },
                                "createdAt": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "expiresAt": {
                                  "type": "string",
                                  "format": "date-time"
                                }
                              }
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "transfer": {
                      "id": "b1f0c6de-6f3a-4c39-9a51-2f6e0d6f5a10",
                      "status": "pending",
                      "chatbotId": "chatbot_123",
                      "chatbotTitle": "Support Bot",
                      "toEmail": "new-owner@example.com",
                      "keepSourceAs": "ADMIN",
                      "requestedById": "user_123",
                      "createdAt": "2026-11-07T10:00:00.000Z",
                      "expiresAt": "2026-11-14T10:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "cancelChatbotTransfer",
        "summary": "Cancel Chatbot Transfer",
        "description": "Cancel the chatbot's open transfer request. Requires confirm=true and the chatbot_transfer permission.\n\nRequired scope: `chatbots:write`, `members:write`.\n\nOn success, `data` contains: `canceled`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:write",
              "members:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:write",
          "members:write"
        ],
        "x-mint": {
          "title": "Cancel Chatbot Transfer",
          "description": "Cancel the chatbot's open transfer request. Requires confirm=true and the chatbot_transfer permission."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "canceled": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "canceled": true
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/transfers": {
      "get": {
        "operationId": "listTransfers",
        "summary": "List Transfers",
        "description": "List the chatbot transfers waiting for your answer: requests from other people to make you the owner of their chatbot. Oldest first. Needs an account-wide token and your own plan (a team plan does not cover it); the dashboard lists them on any plan.\n\nRequired scope: `chatbots:read`.\n\nOn success, `data` contains: `transfers`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:read"
        ],
        "x-mint": {
          "title": "List Transfers",
          "description": "List the chatbot transfers waiting for your answer: requests from other people to make you the owner of their chatbot. Oldest first. Needs an account-wide token and your own plan (a team plan does not cover it); the dashboard lists them on any plan."
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "transfers": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending"
                                ]
                              },
                              "chatbotId": {
                                "type": "string"
                              },
                              "chatbotTitle": {
                                "type": "string"
                              },
                              "from": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "description": "Who asked for the transfer (name or email)."
                              },
                              "keepSourceAs": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "enum": [
                                  "AGENT",
                                  "MANAGER",
                                  "ADMIN",
                                  "SUPER_ADMIN",
                                  null
                                ],
                                "description": "The role the previous owner keeps on accept, or null when they are removed."
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "expiresAt": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "transfers": [
                      {
                        "id": "b1f0c6de-6f3a-4c39-9a51-2f6e0d6f5a10",
                        "status": "pending",
                        "chatbotId": "chatbot_123",
                        "chatbotTitle": "Support Bot",
                        "from": "Alex Kim",
                        "keepSourceAs": null,
                        "createdAt": "2026-11-07T10:00:00.000Z",
                        "expiresAt": "2026-11-14T10:00:00.000Z"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/transfers/{transferId}/accept": {
      "post": {
        "operationId": "acceptTransfer",
        "summary": "Accept Transfer",
        "description": "Accept a chatbot transfer addressed to you. Ownership moves now: you become the owner, and the previous owner is removed or kept at the role the sender chose. Refused with 410 when the transfer expired, and 409 when the chatbot changed owner, the sender can no longer transfer it, or a HIPAA agreement or the member seats block it. Needs an account-wide token and your own plan (a team plan does not cover it); the dashboard answers transfers on any plan.\n\nRequired scope: `chatbots:write`.\n\nOn success, `data` contains: `chatbot`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:write"
        ],
        "x-mint": {
          "title": "Accept Transfer",
          "description": "Accept a chatbot transfer addressed to you. Ownership moves now: you become the owner, and the previous owner is removed or kept at the role the sender chose. Refused with 410 when the transfer expired, and 409 when the chatbot changed owner, the sender can no longer transfer it, or a HIPAA agreement or the member seats block it. Needs an account-wide token and your own plan (a team plan does not cover it); the dashboard answers transfers on any plan."
        },
        "parameters": [
          {
            "name": "transferId",
            "in": "path",
            "required": true,
            "description": "transferId path parameter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "chatbot": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            },
                            "previousOwnerId": {
                              "type": "string"
                            },
                            "previousOwnerEmail": {
                              "type": "string"
                            },
                            "newOwnerId": {
                              "type": "string"
                            },
                            "newOwnerEmail": {
                              "type": "string"
                            },
                            "previousOwnerRemoved": {
                              "type": "boolean"
                            },
                            "previousOwnerKeptAs": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "chatbot": {
                      "id": "chatbot_123",
                      "title": "Support Bot",
                      "previousOwnerId": "user_123",
                      "previousOwnerEmail": "owner@example.com",
                      "newOwnerId": "user_456",
                      "newOwnerEmail": "new-owner@example.com",
                      "previousOwnerRemoved": true,
                      "previousOwnerKeptAs": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "410": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/transfers/{transferId}/decline": {
      "post": {
        "operationId": "declineTransfer",
        "summary": "Decline Transfer",
        "description": "Decline a chatbot transfer addressed to you. Nothing moves, and the request is deleted. Needs an account-wide token and your own plan; the dashboard answers transfers on any plan.\n\nRequired scope: `chatbots:write`.\n\nOn success, `data` contains: `declined`.",
        "tags": [
          "Chatbots"
        ],
        "security": [
          {
            "bearerAuth": [
              "chatbots:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "chatbots:write"
        ],
        "x-mint": {
          "title": "Decline Transfer",
          "description": "Decline a chatbot transfer addressed to you. Nothing moves, and the request is deleted. Needs an account-wide token and your own plan; the dashboard answers transfers on any plan."
        },
        "parameters": [
          {
            "name": "transferId",
            "in": "path",
            "required": true,
            "description": "transferId path parameter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "declined": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "declined": true
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/documents": {
      "get": {
        "operationId": "listKnowledgeDocuments",
        "summary": "List documents",
        "description": "List chatbot knowledge documents, including raw and parsed content URLs when available.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `documents`, `pagination`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List documents",
          "description": "List chatbot knowledge documents, including raw and parsed content URLs when available."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Repeatable source filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Repeatable status filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Repeatable document type filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/KnowledgeDocument"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "documents": [
                      {
                        "id": "document-id",
                        "name": "Example document",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/documents/{documentId}": {
      "get": {
        "operationId": "getKnowledgeDocument",
        "summary": "Get document",
        "description": "Get full details for one knowledge document, with optional inlined text content.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `document`, `ingestJob`, `content`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "Get document",
          "description": "Get full details for one knowledge document, with optional inlined text content."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "Knowledge document ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeContent",
            "in": "query",
            "required": false,
            "description": "Inline text content when available.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "maxContentChars",
            "in": "query",
            "required": false,
            "description": "Maximum characters to inline per content field.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "document": {
                          "$ref": "#/components/schemas/KnowledgeDocument"
                        },
                        "ingestJob": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/IngestJob"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "content": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "rawFileUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "parsedTextFileUrl": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "rawText": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "description": "Present when includeContent=true; null otherwise.",
                                  "properties": {
                                    "text": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "contentType": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "truncated": {
                                      "type": "boolean"
                                    },
                                    "error": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "parsedText": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": false,
                                  "description": "Present when includeContent=true; null otherwise.",
                                  "properties": {
                                    "text": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "contentType": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    },
                                    "truncated": {
                                      "type": "boolean"
                                    },
                                    "error": {
                                      "type": [
                                        "string",
                                        "null"
                                      ]
                                    }
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "document": {
                      "id": "document-id",
                      "name": "Example document",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateKnowledgeDocument",
        "summary": "Update document",
        "description": "Replace the content of one TEXT or FILE knowledge document. URL documents mirror their web page: a content edit returns 400 DOCUMENT_TYPE_NOT_SUPPORTED, so change the page and resync instead.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `document`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Update document",
          "description": "Replace the content of one TEXT or FILE knowledge document. URL documents mirror their web page: a content edit returns 400 DOCUMENT_TYPE_NOT_SUPPORTED, so change the page and resync instead."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "Knowledge document ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "content"
                ],
                "additionalProperties": false,
                "properties": {
                  "content": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The complete replacement content for a TEXT or FILE knowledge document."
                  }
                }
              },
              "example": {
                "content": "Updated knowledge content."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "document": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "The provider document record as returned by the update call."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "document": {
                      "id": "document-id",
                      "name": "Example document",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteKnowledgeDocument",
        "summary": "Delete document",
        "description": "Delete one knowledge document. Requires confirm=true.\n\nRequired scope: `knowledge:delete`.\n\nOn success, `data` contains: `itemsDeleted`, `documents`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:delete"
        ],
        "x-mint": {
          "title": "Delete document",
          "description": "Delete one knowledge document. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "documentId",
            "in": "path",
            "required": true,
            "description": "Knowledge document ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "itemsDeleted": {
                          "type": "integer"
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Deleted document record."
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "itemsDeleted": 1,
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/documents/stats": {
      "get": {
        "operationId": "getKnowledgeDocumentStats",
        "summary": "Get document stats",
        "description": "Get chatbot knowledge document stats.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `total`, `filtered`, `usage`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "Get document stats",
          "description": "Get chatbot knowledge document stats."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Repeatable source filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Repeatable status filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Repeatable document type filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "total": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "bySource": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "Aggregated document count bucket.",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "byStatus": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "Aggregated document count bucket.",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "byDocumentType": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "Aggregated document count bucket.",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "filtered": {
                          "type": "object",
                          "additionalProperties": false,
                          "properties": {
                            "bySource": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "Aggregated document count bucket.",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "byStatus": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "Aggregated document count bucket.",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            },
                            "byDocumentType": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "additionalProperties": true,
                                "description": "Aggregated document count bucket.",
                                "properties": {
                                  "count": {
                                    "type": "integer"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "usage": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Chatbot-wide usage stats (unfiltered — the query filters apply only to total/filtered)."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "total": {
                      "bySource": [],
                      "byStatus": [],
                      "byDocumentType": []
                    },
                    "filtered": {
                      "bySource": [],
                      "byStatus": [],
                      "byDocumentType": []
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/documents/delete": {
      "post": {
        "operationId": "deleteKnowledgeDocuments",
        "summary": "Bulk delete documents",
        "description": "Bulk delete knowledge documents by IDs or filters.\n\nRequired scope: `knowledge:delete`.\n\nOn success, `data` contains: `itemsDeleted`, `documents`, `filter`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:delete"
        ],
        "x-mint": {
          "title": "Bulk delete documents",
          "description": "Bulk delete knowledge documents by IDs or filters."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "documentIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Specific knowledge document IDs to act on."
                  },
                  "query": {
                    "type": "string"
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "statuses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "all",
                      "failed",
                      "pending",
                      "trained"
                    ]
                  },
                  "all": {
                    "type": "boolean",
                    "description": "Select all documents matching the supplied filters."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required true for destructive bulk delete actions."
                  }
                }
              },
              "example": {
                "documentIds": [
                  "document-id"
                ],
                "confirm": true
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "itemsDeleted": {
                          "type": "integer"
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Deleted document record."
                          }
                        },
                        "filter": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the selector used."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "itemsDeleted": 2,
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "filter": {
                      "statuses": [
                        "READY"
                      ]
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/documents/resync": {
      "post": {
        "operationId": "resyncKnowledgeDocuments",
        "summary": "Bulk resync documents",
        "description": "Bulk resync knowledge documents by IDs or filters.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `itemsQueued`, `itemsSkipped`, `documents`, `filter`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Bulk resync documents",
          "description": "Bulk resync knowledge documents by IDs or filters."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "documentIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Specific knowledge document IDs to act on."
                  },
                  "query": {
                    "type": "string"
                  },
                  "sources": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "statuses": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "all",
                      "failed",
                      "pending",
                      "trained"
                    ]
                  },
                  "all": {
                    "type": "boolean",
                    "description": "Select all documents matching the supplied filters."
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required true for destructive bulk delete actions."
                  }
                }
              },
              "example": {
                "documentIds": [
                  "document-id"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "itemsQueued": {
                          "type": "integer"
                        },
                        "itemsSkipped": {
                          "type": "integer"
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Document queued for resync."
                          }
                        },
                        "filter": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the selector used."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "itemsQueued": 2,
                    "itemsSkipped": 0,
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "filter": {
                      "documentIds": [
                        "document-id"
                      ]
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/documents/config": {
      "patch": {
        "operationId": "updateKnowledgeDocumentConfig",
        "summary": "Update document config",
        "description": "Update scrape and sync config for one or more URL-like knowledge documents.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `ingestJobRunId`, `documents`, `source`, `requested`, `effective`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Update document config",
          "description": "Update scrape and sync config for one or more URL-like knowledge documents."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "documentIds"
                ],
                "additionalProperties": false,
                "properties": {
                  "documentIds": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    }
                  },
                  "syncFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER"
                  },
                  "scrapeOptions": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "onlyMainContent": {
                        "type": "boolean",
                        "default": true,
                        "description": "Extract main page content only, excluding headers, footers, sidebars, and navigation."
                      },
                      "includeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to include when scraping page content."
                      },
                      "excludeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to exclude when scraping page content."
                      },
                      "headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Allowed request headers: User-Agent, Accept, Accept-Language."
                      }
                    }
                  },
                  "onlyMainContent": {
                    "type": "boolean",
                    "default": true,
                    "description": "Extract main page content only, excluding headers, footers, sidebars, and navigation."
                  },
                  "includeSelectors": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "CSS selectors to include when scraping page content."
                  },
                  "excludeSelectors": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "CSS selectors to exclude when scraping page content."
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Allowed request headers: User-Agent, Accept, Accept-Language."
                  }
                }
              },
              "example": {
                "documentIds": [
                  "document-id"
                ],
                "syncFrequency": "WEEKLY",
                "scrapeOptions": {
                  "onlyMainContent": true
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "ingestJobRunId": {
                          "type": "string",
                          "description": "Ingest job run started for this reconfiguration."
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Affected document record."
                          }
                        },
                        "source": {
                          "type": "string"
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the request parameters."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective settings after plan clamping (syncFrequency, scrapeOptions), with any adjustment warnings."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "ingestJobRunId": "run-id",
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "source": "URLS_LIST",
                    "requested": {
                      "documentIds": [
                        "document-id"
                      ],
                      "syncFrequency": "WEEKLY"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/links": {
      "post": {
        "operationId": "addKnowledgeLinks",
        "summary": "Add links",
        "description": "Add URL links to chatbot knowledge.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `ingestJobRunId`, `documents`, `source`, `requested`, `effective`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Add links",
          "description": "Add URL links to chatbot knowledge."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "urls"
                ],
                "additionalProperties": false,
                "properties": {
                  "urls": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "syncFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER",
                    "description": "Not scheduled for URL-list ingests; set per-document schedules via PATCH /documents/config instead (the response clamps to NEVER with a warning)."
                  },
                  "scrapeOptions": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "onlyMainContent": {
                        "type": "boolean",
                        "default": true,
                        "description": "Extract main page content only, excluding headers, footers, sidebars, and navigation."
                      },
                      "includeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to include when scraping page content."
                      },
                      "excludeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to exclude when scraping page content."
                      },
                      "headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Allowed request headers: User-Agent, Accept, Accept-Language."
                      }
                    }
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {
                "urls": [
                  "https://example.com/docs"
                ],
                "syncFrequency": "NEVER"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "ingestJobRunId": {
                          "type": "string",
                          "description": "Ingest job run started for this request."
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Document queued by this ingestion."
                          }
                        },
                        "source": {
                          "type": "string",
                          "description": "Ingestion source constant."
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the request parameters."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective settings after plan clamping, with any adjustment warnings."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "ingestJobRunId": "run-id",
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "source": "URLS_LIST",
                    "requested": {
                      "urlsCount": 1,
                      "syncFrequency": "NEVER"
                    },
                    "effective": {
                      "syncFrequency": "NEVER"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/website": {
      "post": {
        "operationId": "addKnowledgeWebsite",
        "summary": "Add website",
        "description": "Crawl and add a website to chatbot knowledge.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `ingestJobRunId`, `documents`, `source`, `requested`, `effective`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Add website",
          "description": "Crawl and add a website to chatbot knowledge."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "additionalProperties": false,
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "skipExisting": {
                    "type": "boolean",
                    "description": "Skip pages whose URL already exists as a document on this chatbot."
                  },
                  "maxDepth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "default": 3
                  },
                  "maxLinks": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 50
                  },
                  "includePaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "excludePaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowedDomains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "syncFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER"
                  },
                  "scrapeOptions": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "onlyMainContent": {
                        "type": "boolean",
                        "default": true,
                        "description": "Extract main page content only, excluding headers, footers, sidebars, and navigation."
                      },
                      "includeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to include when scraping page content."
                      },
                      "excludeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to exclude when scraping page content."
                      },
                      "headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Allowed request headers: User-Agent, Accept, Accept-Language."
                      }
                    }
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {
                "url": "https://example.com",
                "maxDepth": 3,
                "maxLinks": 100,
                "scrapeOptions": {
                  "onlyMainContent": true
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "ingestJobRunId": {
                          "type": "string",
                          "description": "Ingest job run started for this request."
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Document queued by this ingestion."
                          }
                        },
                        "source": {
                          "type": "string",
                          "description": "Ingestion source constant."
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the request parameters."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective settings after plan clamping, with any adjustment warnings."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "ingestJobRunId": "run-id",
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "source": "WEBSITE",
                    "requested": {
                      "url": "https://example.com",
                      "maxLinks": 50
                    },
                    "effective": {
                      "syncFrequency": "NEVER"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sitemap": {
      "post": {
        "operationId": "addKnowledgeSitemap",
        "summary": "Add sitemap",
        "description": "Ingest a sitemap into chatbot knowledge. Supports auto-sync and sitemap auto-scan frequencies.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `ingestJobRunId`, `documents`, `source`, `requested`, `effective`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Add sitemap",
          "description": "Ingest a sitemap into chatbot knowledge. Supports auto-sync and sitemap auto-scan frequencies."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "additionalProperties": false,
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "maxLinks": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000,
                    "default": 50
                  },
                  "includePaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "excludePaths": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "syncFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER"
                  },
                  "scanFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER"
                  },
                  "scrapeOptions": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "onlyMainContent": {
                        "type": "boolean",
                        "default": true,
                        "description": "Extract main page content only, excluding headers, footers, sidebars, and navigation."
                      },
                      "includeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to include when scraping page content."
                      },
                      "excludeSelectors": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "CSS selectors to exclude when scraping page content."
                      },
                      "headers": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Allowed request headers: User-Agent, Accept, Accept-Language."
                      }
                    }
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {
                "url": "https://example.com/sitemap.xml",
                "maxLinks": 1000,
                "syncFrequency": "WEEKLY",
                "scanFrequency": "DAILY",
                "scrapeOptions": {
                  "onlyMainContent": true
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "ingestJobRunId": {
                          "type": "string",
                          "description": "Ingest job run started for this request."
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Document queued by this ingestion."
                          }
                        },
                        "source": {
                          "type": "string",
                          "description": "Ingestion source constant."
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the request parameters."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective settings after plan clamping, with any adjustment warnings."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "ingestJobRunId": "run-id",
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "source": "SITEMAP",
                    "requested": {
                      "url": "https://example.com/sitemap.xml"
                    },
                    "effective": {
                      "syncFrequency": "NEVER"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/youtube": {
      "post": {
        "operationId": "addKnowledgeYoutube",
        "summary": "Add YouTube",
        "description": "Add YouTube content to chatbot knowledge.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `ingestJobRunId`, `documents`, `source`, `requested`, `effective`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Add YouTube",
          "description": "Add YouTube content to chatbot knowledge."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "urls"
                ],
                "additionalProperties": false,
                "properties": {
                  "urls": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "syncFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER",
                    "description": "Not scheduled for YouTube ingests; the response clamps to NEVER with a warning. Use documents resync to refresh videos."
                  }
                }
              },
              "example": {
                "urls": [
                  "https://www.youtube.com/watch?v=VIDEO_ID"
                ],
                "syncFrequency": "NEVER"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "ingestJobRunId": {
                          "type": "string",
                          "description": "Ingest job run started for this request."
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Document queued by this ingestion."
                          }
                        },
                        "source": {
                          "type": "string",
                          "description": "Ingestion source constant."
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the request parameters."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective settings after plan clamping, with any adjustment warnings."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "ingestJobRunId": "run-id",
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "source": "YOUTUBE",
                    "requested": {
                      "urlsCount": 1
                    },
                    "effective": {
                      "syncFrequency": "NEVER"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/text": {
      "post": {
        "operationId": "updateTextKnowledge",
        "summary": "Update text knowledge",
        "description": "Replace the chatbot text knowledge document.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `document`, `replacedDocumentId`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Update text knowledge",
          "description": "Replace the chatbot text knowledge document."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "additionalProperties": false,
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "type": "string",
                    "description": "Optional display name for the text knowledge document."
                  }
                }
              },
              "example": {
                "name": "Company overview",
                "text": "Acme helps teams answer support questions with AI."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "document": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "source": {
                              "type": "string"
                            }
                          }
                        },
                        "replacedDocumentId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Previous plain-text document this update replaced, if any."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "document": {
                      "id": "document-id",
                      "source": "TEXT"
                    },
                    "replacedDocumentId": null
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "502": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/files": {
      "post": {
        "operationId": "uploadKnowledgeFiles",
        "summary": "Upload files",
        "description": "Add local files to chatbot knowledge.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `ingestJobRunIds`, `documents`, `source`, `requested`, `effective`.",
        "tags": [
          "Knowledge"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Upload files",
          "description": "Add local files to chatbot knowledge."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "files"
                ],
                "additionalProperties": false,
                "properties": {
                  "files": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "contentBase64"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "contentBase64": {
                          "type": "string",
                          "description": "Base64 encoded file content. Data URLs are accepted."
                        },
                        "mimeType": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "ingestJobRunIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "One ingest job run per uploaded file."
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Document queued by this ingestion."
                          }
                        },
                        "source": {
                          "type": "string",
                          "description": "Ingestion source constant."
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the request parameters."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective settings after plan clamping, with any adjustment warnings."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "ingestJobRunIds": [
                      "run-id"
                    ],
                    "documents": [
                      {
                        "id": "document-id"
                      }
                    ],
                    "source": "LOCAL_FILE",
                    "requested": {
                      "filesCount": 1,
                      "fileNames": [
                        "guide.pdf"
                      ]
                    },
                    "effective": {}
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "429": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/ingest-jobs": {
      "get": {
        "operationId": "listKnowledgeSyncJobs",
        "summary": "List sync jobs",
        "description": "List active recurring knowledge sync/scan jobs.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `syncJobs`, `stats`, `filters`, `pagination`.",
        "tags": [
          "Knowledge Sync Jobs"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List sync jobs",
          "description": "List active recurring knowledge sync/scan jobs."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Repeatable sync job source filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "syncFrequency",
            "in": "query",
            "required": false,
            "description": "Repeatable sync frequency filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "DAILY",
                  "WEEKLY",
                  "MONTHLY"
                ]
              }
            }
          },
          {
            "name": "scanFrequency",
            "in": "query",
            "required": false,
            "description": "Repeatable sitemap scan frequency filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "NEVER",
                  "DAILY",
                  "WEEKLY",
                  "MONTHLY"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "syncJobs": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/IngestJob"
                          }
                        },
                        "stats": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Job counts by source and by sync/scan frequency, total and filtered."
                        },
                        "filters": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the applied source and frequency filters (null members when unfiltered)."
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "syncJobs": [
                      {
                        "id": "job-id",
                        "source": "SITEMAP",
                        "syncFrequency": "WEEKLY"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/ingest-jobs/{jobId}": {
      "get": {
        "operationId": "getKnowledgeSyncJob",
        "summary": "Get sync job",
        "description": "Get one recurring knowledge sync/scan job and run history.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `syncJob`.",
        "tags": [
          "Knowledge Sync Jobs"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "Get sync job",
          "description": "Get one recurring knowledge sync/scan job and run history."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Knowledge sync (ingest) job ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "syncJob": {
                          "$ref": "#/components/schemas/IngestJob"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "syncJob": {
                      "id": "job-id",
                      "source": "SITEMAP",
                      "syncFrequency": "WEEKLY"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateKnowledgeSyncJob",
        "summary": "Update sync job",
        "description": "Update auto-sync or sitemap auto-scan frequency for a recurring knowledge job.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `syncJob`, `requested`, `effective`.",
        "tags": [
          "Knowledge Sync Jobs"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Update sync job",
          "description": "Update auto-sync or sitemap auto-scan frequency for a recurring knowledge job."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Knowledge sync (ingest) job ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "syncFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER",
                    "description": "Only accepted for sitemap, website, and GitHub jobs; other sources are rejected with SYNC_FREQUENCY_UNSUPPORTED_SOURCE."
                  },
                  "scanFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "syncJob": {
                          "$ref": "#/components/schemas/IngestJob"
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Requested sync and scan frequencies."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective frequencies after plan clamping."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "syncJob": {
                      "id": "job-id",
                      "source": "SITEMAP",
                      "syncFrequency": "WEEKLY"
                    },
                    "requested": {
                      "syncFrequency": "WEEKLY",
                      "scanFrequency": null
                    },
                    "effective": {
                      "syncFrequency": "WEEKLY",
                      "scanFrequency": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteKnowledgeSyncJob",
        "summary": "Delete sync job",
        "description": "Disable/delete a recurring knowledge sync/scan job. Existing documents are not deleted. Requires confirm=true.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `syncJob`, `message`.",
        "tags": [
          "Knowledge Sync Jobs"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Delete sync job",
          "description": "Disable/delete a recurring knowledge sync/scan job. Existing documents are not deleted. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jobId",
            "in": "path",
            "required": true,
            "description": "Knowledge sync (ingest) job ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "syncJob": {
                          "$ref": "#/components/schemas/IngestJob"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "syncJob": {
                      "id": "job-id",
                      "source": "SITEMAP",
                      "syncFrequency": "NEVER"
                    },
                    "message": "Sync job disabled. Existing knowledge documents were not deleted."
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources": {
      "get": {
        "operationId": "listKnowledgeSources",
        "summary": "List data sources",
        "description": "List external knowledge data-source connections for a chatbot.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `sources`, `filters`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List data sources",
          "description": "List external knowledge data-source connections for a chatbot."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connector",
            "in": "query",
            "required": false,
            "description": "Knowledge source connector filter.",
            "schema": {
              "type": "string",
              "enum": [
                "NOTION",
                "GOOGLE_DRIVE",
                "DROPBOX",
                "ONEDRIVE",
                "BOX",
                "SHAREPOINT",
                "CONFLUENCE",
                "GITHUB"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Repeatable source status filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "PENDING",
                  "ACTIVE",
                  "FAILED",
                  "REVOKED"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "sources": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/KnowledgeSource"
                          }
                        },
                        "filters": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the applied filters."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "sources": [
                      {
                        "id": "source-id",
                        "connector": "NOTION",
                        "status": "READY"
                      }
                    ],
                    "filters": {
                      "connector": null,
                      "statuses": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createKnowledgeSource",
        "summary": "Create data source",
        "description": "Create an external knowledge source connection. OAuth/picker sources return an authorization URL. Notion pages are discovered during ingest after OAuth page/database selection.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `source`, `authorizationUrl`, `nextStep`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Create data source",
          "description": "Create an external knowledge source connection. OAuth/picker sources return an authorization URL. Notion pages are discovered during ingest after OAuth page/database selection."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "connector"
                ],
                "additionalProperties": false,
                "properties": {
                  "connector": {
                    "type": "string",
                    "enum": [
                      "NOTION",
                      "GOOGLE_DRIVE",
                      "DROPBOX",
                      "ONEDRIVE",
                      "BOX",
                      "SHAREPOINT",
                      "CONFLUENCE",
                      "GITHUB"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "clientRedirectUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "domain": {
                    "type": "string",
                    "description": "Required for Confluence, for example site.atlassian.net."
                  },
                  "owner": {
                    "type": "string",
                    "description": "Required for GitHub connections."
                  },
                  "connectionLabel": {
                    "type": "string"
                  },
                  "apiKey": {
                    "type": "string",
                    "description": "Required for GitHub connections."
                  }
                }
              },
              "example": {
                "connector": "GOOGLE_DRIVE",
                "name": "Support docs",
                "clientRedirectUrl": "https://sitegpt.ai/agents/files-selected"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "source": {
                          "$ref": "#/components/schemas/KnowledgeSource"
                        },
                        "authorizationUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Browser URL where the user completes OAuth or file picking; null for API-key connectors."
                        },
                        "nextStep": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Human-readable instruction for completing the connection."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "source": {
                      "id": "source-id",
                      "name": "Example source",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/{connectionId}": {
      "get": {
        "operationId": "getKnowledgeSource",
        "summary": "Get data source",
        "description": "Get one external knowledge source connection.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `source`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "Get data source",
          "description": "Get one external knowledge source connection."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Knowledge source connection ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "source": {
                          "$ref": "#/components/schemas/KnowledgeSource"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "source": {
                      "id": "source-id",
                      "name": "Example source",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateKnowledgeSource",
        "summary": "Update data source",
        "description": "Update an external knowledge source connection name, redirect URL, or credentials.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `source`, `authorizationUrl`, `nextStep`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Update data source",
          "description": "Update an external knowledge source connection name, redirect URL, or credentials."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Knowledge source connection ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "clientRedirectUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "apiKey": {
                    "type": "string",
                    "description": "New GitHub personal access token."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "source": {
                          "$ref": "#/components/schemas/KnowledgeSource"
                        },
                        "authorizationUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Browser URL where the user completes OAuth or file picking; null for API-key connectors."
                        },
                        "nextStep": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Human-readable instruction for completing the connection."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "source": {
                      "id": "source-id",
                      "name": "Example source",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "revokeKnowledgeSource",
        "summary": "Revoke data source",
        "description": "Revoke an external knowledge source connection.\n\nRequired scope: `knowledge:delete`.\n\nOn success, `data` contains: `source`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:delete"
        ],
        "x-mint": {
          "title": "Revoke data source",
          "description": "Revoke an external knowledge source connection."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Knowledge source connection ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "source": {
                          "$ref": "#/components/schemas/KnowledgeSource"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "source": {
                      "id": "source-id",
                      "name": "Example source",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/{connectionId}/authorize": {
      "post": {
        "operationId": "authorizeKnowledgeSource",
        "summary": "Authorize data source",
        "description": "Generate a fresh authorization/picker URL for an existing OAuth source so users can add/change selected files. For Notion, run ingest after OAuth because selected pages are discovered during ingest.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `source`, `authorizationUrl`, `nextStep`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Authorize data source",
          "description": "Generate a fresh authorization/picker URL for an existing OAuth source so users can add/change selected files. For Notion, run ingest after OAuth because selected pages are discovered during ingest."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Knowledge source connection ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "clientRedirectUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri",
                    "description": "Optional redirect URL after OAuth/picker selection."
                  }
                }
              },
              "example": {
                "clientRedirectUrl": "https://sitegpt.ai/agents/files-selected"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "source": {
                          "$ref": "#/components/schemas/KnowledgeSource"
                        },
                        "authorizationUrl": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Browser URL where the user completes OAuth or file picking; null for API-key connectors."
                        },
                        "nextStep": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Human-readable instruction for completing the connection."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "source": {
                      "id": "source-id",
                      "name": "Example source",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/{connectionId}/documents": {
      "get": {
        "operationId": "listKnowledgeSourceDocuments",
        "summary": "List source documents",
        "description": "List picked/connected documents for a knowledge source. Notion can be empty before ingest because pages are discovered during ingest.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `documents`, `pagination`, `sourceConnection`, `nextStep`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List source documents",
          "description": "List picked/connected documents for a knowledge source. Notion can be empty before ingest because pages are discovered during ingest."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Knowledge source connection ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of documents to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/KnowledgeSourceDocument"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        },
                        "sourceConnection": {
                          "type": "object",
                          "description": "Identifying summary of the knowledge source connection.",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "connector": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        },
                        "nextStep": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Recovery hint when the list is empty (e.g. run ingest first for a connected source with no discovered documents); null otherwise."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "documents": [
                      {
                        "id": "document-id",
                        "externalId": "ext-1",
                        "status": "READY"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    },
                    "sourceConnection": {
                      "id": "source-id",
                      "connector": "NOTION",
                      "name": "Notion"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/{connectionId}/ingest": {
      "post": {
        "operationId": "ingestKnowledgeSource",
        "summary": "Ingest data source",
        "description": "Queue ingestion for a knowledge source. Notion discovers selected pages during this step. GitHub uses repository/branch/patterns; Confluence can use external IDs.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `ingestJobRunId`, `documents`, `source`, `sourceConnection`, `requested`, `effective`.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Ingest data source",
          "description": "Queue ingestion for a knowledge source. Notion discovers selected pages during this step. GitHub uses repository/branch/patterns; Confluence can use external IDs."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "description": "Knowledge source connection ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "syncFrequency": {
                    "type": "string",
                    "enum": [
                      "NEVER",
                      "DAILY",
                      "WEEKLY",
                      "MONTHLY"
                    ],
                    "default": "NEVER",
                    "description": "Scheduled re-sync; honored for GitHub sources only. Other connectors ingest once (the response clamps to NEVER with a warning) — re-run this ingest or use documents resync to refresh them."
                  },
                  "repository": {
                    "type": "string",
                    "description": "GitHub repository name."
                  },
                  "branch": {
                    "type": "string",
                    "description": "GitHub branch."
                  },
                  "patterns": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "GitHub path patterns."
                  },
                  "externalIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "External document/page IDs, such as Confluence page IDs."
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "ingestJobRunId": {
                          "type": "string"
                        },
                        "documents": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Document queued by this ingestion."
                          }
                        },
                        "source": {
                          "type": "string"
                        },
                        "sourceConnection": {
                          "type": "object",
                          "description": "Identifying summary of the knowledge source connection.",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "connector": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        },
                        "requested": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the request parameters."
                        },
                        "effective": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Effective settings after plan clamping (e.g. the clamped syncFrequency), with any adjustment warnings."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "source": {
                      "id": "source-id",
                      "name": "Example source",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/github/repos": {
      "get": {
        "operationId": "listGitHubSourceRepositories",
        "summary": "List GitHub repositories",
        "description": "List repositories available to a GitHub knowledge source.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` is: Connector discovery payload passed through from the provider: repositories plus an optional nextCursor.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List GitHub repositories",
          "description": "List repositories available to a GitHub knowledge source."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "query",
            "required": false,
            "description": "GitHub source connection ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "GitHub result page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "required": false,
            "description": "Repositories per page.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/GenericObject",
                      "description": "Connector discovery payload passed through from the provider: repositories plus an optional nextCursor."
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "sources": [
                      {
                        "id": "source-id",
                        "name": "Example source",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/github/files": {
      "get": {
        "operationId": "listGitHubSourceFiles",
        "summary": "List GitHub files",
        "description": "List files in a GitHub repository for a knowledge source.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` is: Connector discovery payload passed through from the provider: files plus an optional nextCursor.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List GitHub files",
          "description": "List files in a GitHub repository for a knowledge source."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "query",
            "required": false,
            "description": "GitHub source connection ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "owner",
            "in": "query",
            "required": false,
            "description": "GitHub owner.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "query",
            "required": false,
            "description": "GitHub repository name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "branch",
            "in": "query",
            "required": false,
            "description": "GitHub branch.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/GenericObject",
                      "description": "Connector discovery payload passed through from the provider: files plus an optional nextCursor."
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "sources": [
                      {
                        "id": "source-id",
                        "name": "Example source",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/confluence/spaces": {
      "get": {
        "operationId": "listConfluenceSourceSpaces",
        "summary": "List Confluence spaces",
        "description": "List spaces available to a Confluence knowledge source.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` is: Connector discovery payload passed through from the provider: spaces plus an optional nextCursor.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List Confluence spaces",
          "description": "List spaces available to a Confluence knowledge source."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "query",
            "required": false,
            "description": "Confluence source connection ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of spaces.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/GenericObject",
                      "description": "Connector discovery payload passed through from the provider: spaces plus an optional nextCursor."
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "sources": [
                      {
                        "id": "source-id",
                        "name": "Example source",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/knowledge/sources/confluence/pages": {
      "get": {
        "operationId": "listConfluenceSourcePages",
        "summary": "List Confluence pages",
        "description": "List pages in a Confluence space for a knowledge source.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` is: Connector discovery payload passed through from the provider: pages plus an optional nextCursor.",
        "tags": [
          "Knowledge Sources"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List Confluence pages",
          "description": "List pages in a Confluence space for a knowledge source."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "query",
            "required": false,
            "description": "Confluence source connection ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "spaceId",
            "in": "query",
            "required": false,
            "description": "Confluence space ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of pages.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/GenericObject",
                      "description": "Connector discovery payload passed through from the provider: pages plus an optional nextCursor."
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "sources": [
                      {
                        "id": "source-id",
                        "name": "Example source",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/custom-responses": {
      "get": {
        "operationId": "listCustomResponses",
        "summary": "List custom responses",
        "description": "List chatbot custom responses.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `customResponses`, `filters`.",
        "tags": [
          "Custom Responses"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "List custom responses",
          "description": "List chatbot custom responses."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Custom response state filter.",
            "schema": {
              "type": "string",
              "enum": [
                "ALL",
                "OPEN",
                "UPDATED"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Repeatable source filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "customResponses": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/CustomResponse"
                          }
                        },
                        "filters": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the applied filters."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "customResponses": [
                      {
                        "id": "customResponse-id",
                        "question": "What is SiteGPT?"
                      }
                    ],
                    "filters": {
                      "state": "ALL"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createCustomResponse",
        "summary": "Create custom response",
        "description": "Create a custom response.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `customResponse`.",
        "tags": [
          "Custom Responses"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Create custom response",
          "description": "Create a custom response."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "question",
                  "answer"
                ],
                "additionalProperties": false,
                "properties": {
                  "question": {
                    "type": "string",
                    "minLength": 1
                  },
                  "answer": {
                    "type": "string",
                    "minLength": 1
                  },
                  "originalAnswer": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "example": {
                "question": "What is your refund policy?",
                "answer": "We offer refunds within 30 days."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "customResponse": {
                          "$ref": "#/components/schemas/CustomResponse"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "customResponse": {
                      "id": "customResponse-id",
                      "name": "Example customResponse",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/custom-responses/{customResponseId}": {
      "get": {
        "operationId": "getCustomResponse",
        "summary": "Get custom response",
        "description": "Get one custom response.\n\nRequired scope: `knowledge:read`.\n\nOn success, `data` contains: `customResponse`.",
        "tags": [
          "Custom Responses"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:read"
        ],
        "x-mint": {
          "title": "Get custom response",
          "description": "Get one custom response."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customResponseId",
            "in": "path",
            "required": true,
            "description": "Custom response ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "customResponse": {
                          "$ref": "#/components/schemas/CustomResponse"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "customResponse": {
                      "id": "customResponse-id",
                      "name": "Example customResponse",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateCustomResponse",
        "summary": "Update custom response",
        "description": "Update a custom response.\n\nRequired scope: `knowledge:write`.\n\nOn success, `data` contains: `customResponse`.",
        "tags": [
          "Custom Responses"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:write"
        ],
        "x-mint": {
          "title": "Update custom response",
          "description": "Update a custom response."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customResponseId",
            "in": "path",
            "required": true,
            "description": "Custom response ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "question": {
                    "type": "string",
                    "minLength": 1
                  },
                  "answer": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "customResponse": {
                          "$ref": "#/components/schemas/CustomResponse"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "customResponse": {
                      "id": "customResponse-id",
                      "name": "Example customResponse",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomResponse",
        "summary": "Delete custom response",
        "description": "Delete a custom response. Requires confirm=true.\n\nRequired scope: `knowledge:delete`.\n\nOn success, `data` contains: `deletedCustomResponse`.",
        "tags": [
          "Custom Responses"
        ],
        "security": [
          {
            "bearerAuth": [
              "knowledge:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "knowledge:delete"
        ],
        "x-mint": {
          "title": "Delete custom response",
          "description": "Delete a custom response. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customResponseId",
            "in": "path",
            "required": true,
            "description": "Custom response ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedCustomResponse": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "question": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedCustomResponse": {
                      "id": "customResponse-id",
                      "name": "Example customResponse",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/personas": {
      "get": {
        "operationId": "listPersonas",
        "summary": "List personas",
        "description": "List chatbot personas.\n\nRequired scope: `personas:read`.\n\nOn success, `data` contains: `personas`, `activePersonaId`.",
        "tags": [
          "Personas"
        ],
        "security": [
          {
            "bearerAuth": [
              "personas:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "personas:read"
        ],
        "x-mint": {
          "title": "List personas",
          "description": "List chatbot personas."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "personas": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Persona"
                          }
                        },
                        "activePersonaId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active persona; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "personas": [
                      {
                        "id": "persona-id",
                        "title": "Product expert"
                      }
                    ],
                    "activePersonaId": "persona-id"
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createPersona",
        "summary": "Create persona",
        "description": "Create a chatbot persona.\n\nRequired scope: `personas:write`.\n\nOn success, `data` contains: `persona`, `activePersonaId`.",
        "tags": [
          "Personas"
        ],
        "security": [
          {
            "bearerAuth": [
              "personas:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "personas:write"
        ],
        "x-mint": {
          "title": "Create persona",
          "description": "Create a chatbot persona."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title",
                  "instructions"
                ],
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "instructions": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "example": {
                "title": "Friendly support",
                "description": "Warm, concise support tone.",
                "instructions": "Be friendly, direct, and helpful."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "persona": {
                          "$ref": "#/components/schemas/Persona"
                        },
                        "activePersonaId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active persona; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "persona": {
                      "id": "persona-id",
                      "name": "Example persona",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/personas/{personaId}": {
      "get": {
        "operationId": "getPersona",
        "summary": "Get persona",
        "description": "Get one chatbot persona.\n\nRequired scope: `personas:read`.\n\nOn success, `data` contains: `persona`, `activePersonaId`.",
        "tags": [
          "Personas"
        ],
        "security": [
          {
            "bearerAuth": [
              "personas:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "personas:read"
        ],
        "x-mint": {
          "title": "Get persona",
          "description": "Get one chatbot persona."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "personaId",
            "in": "path",
            "required": true,
            "description": "Persona ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "persona": {
                          "$ref": "#/components/schemas/Persona"
                        },
                        "activePersonaId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active persona; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "persona": {
                      "id": "persona-id",
                      "name": "Example persona",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updatePersona",
        "summary": "Update persona",
        "description": "Update a custom chatbot persona.\n\nRequired scope: `personas:write`.\n\nOn success, `data` contains: `persona`, `activePersonaId`.",
        "tags": [
          "Personas"
        ],
        "security": [
          {
            "bearerAuth": [
              "personas:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "personas:write"
        ],
        "x-mint": {
          "title": "Update persona",
          "description": "Update a custom chatbot persona."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "personaId",
            "in": "path",
            "required": true,
            "description": "Persona ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "description": {
                    "type": "string"
                  },
                  "instructions": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "persona": {
                          "$ref": "#/components/schemas/Persona"
                        },
                        "activePersonaId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active persona; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "persona": {
                      "id": "persona-id",
                      "name": "Example persona",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deletePersona",
        "summary": "Delete persona",
        "description": "Delete a custom chatbot persona. Requires confirm=true.\n\nRequired scope: `personas:delete`.\n\nOn success, `data` contains: `deletedPersona`.",
        "tags": [
          "Personas"
        ],
        "security": [
          {
            "bearerAuth": [
              "personas:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "personas:delete"
        ],
        "x-mint": {
          "title": "Delete persona",
          "description": "Delete a custom chatbot persona. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "personaId",
            "in": "path",
            "required": true,
            "description": "Persona ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedPersona": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedPersona": {
                      "id": "persona-id",
                      "name": "Example persona",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/personas/{personaId}/use": {
      "post": {
        "operationId": "usePersona",
        "summary": "Use persona",
        "description": "Make a persona active for a chatbot.\n\nRequired scope: `personas:write`.\n\nOn success, `data` contains: `persona`, `activePersonaId`.",
        "tags": [
          "Personas"
        ],
        "security": [
          {
            "bearerAuth": [
              "personas:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "personas:write"
        ],
        "x-mint": {
          "title": "Use persona",
          "description": "Make a persona active for a chatbot."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "personaId",
            "in": "path",
            "required": true,
            "description": "Persona ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "persona": {
                          "$ref": "#/components/schemas/Persona"
                        },
                        "activePersonaId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active persona; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "persona": {
                      "id": "persona-id",
                      "name": "Example persona",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/instructions": {
      "get": {
        "operationId": "listInstructions",
        "summary": "List instructions",
        "description": "List chatbot instructions.\n\nRequired scope: `instructions:read`.\n\nOn success, `data` contains: `instructions`, `activeInstructionId`.",
        "tags": [
          "Instructions"
        ],
        "security": [
          {
            "bearerAuth": [
              "instructions:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "instructions:read"
        ],
        "x-mint": {
          "title": "List instructions",
          "description": "List chatbot instructions."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "instructions": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Instruction"
                          }
                        },
                        "activeInstructionId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active instruction; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "instructions": [
                      {
                        "id": "instruction-id",
                        "title": "Concise answers"
                      }
                    ],
                    "activeInstructionId": null
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createInstruction",
        "summary": "Create instructions",
        "description": "Create chatbot instructions.\n\nRequired scope: `instructions:write`.\n\nOn success, `data` contains: `instruction`, `activeInstructionId`.",
        "tags": [
          "Instructions"
        ],
        "security": [
          {
            "bearerAuth": [
              "instructions:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "instructions:write"
        ],
        "x-mint": {
          "title": "Create instructions",
          "description": "Create chatbot instructions."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "instructions"
                ],
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "instructions": {
                    "type": "string",
                    "minLength": 1
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 2
                  }
                }
              },
              "example": {
                "title": "Support instructions",
                "instructions": "Answer using the knowledge base. Ask a follow-up when needed.",
                "temperature": 0.4
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "instruction": {
                          "$ref": "#/components/schemas/Instruction"
                        },
                        "activeInstructionId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active instruction; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "instruction": {
                      "id": "instruction-id",
                      "name": "Example instruction",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/instructions/{instructionId}": {
      "get": {
        "operationId": "getInstruction",
        "summary": "Get instructions",
        "description": "Get one chatbot instruction.\n\nRequired scope: `instructions:read`.\n\nOn success, `data` contains: `instruction`, `activeInstructionId`.",
        "tags": [
          "Instructions"
        ],
        "security": [
          {
            "bearerAuth": [
              "instructions:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "instructions:read"
        ],
        "x-mint": {
          "title": "Get instructions",
          "description": "Get one chatbot instruction."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instructionId",
            "in": "path",
            "required": true,
            "description": "Instruction ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "instruction": {
                          "$ref": "#/components/schemas/Instruction"
                        },
                        "activeInstructionId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active instruction; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "instruction": {
                      "id": "instruction-id",
                      "name": "Example instruction",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateInstruction",
        "summary": "Update instructions",
        "description": "Update custom chatbot instructions.\n\nRequired scope: `instructions:write`.\n\nOn success, `data` contains: `instruction`, `activeInstructionId`.",
        "tags": [
          "Instructions"
        ],
        "security": [
          {
            "bearerAuth": [
              "instructions:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "instructions:write"
        ],
        "x-mint": {
          "title": "Update instructions",
          "description": "Update custom chatbot instructions."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instructionId",
            "in": "path",
            "required": true,
            "description": "Instruction ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string"
                  },
                  "instructions": {
                    "type": "string",
                    "minLength": 1
                  },
                  "temperature": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 2
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "instruction": {
                          "$ref": "#/components/schemas/Instruction"
                        },
                        "activeInstructionId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active instruction; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "instruction": {
                      "id": "instruction-id",
                      "name": "Example instruction",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteInstruction",
        "summary": "Delete instructions",
        "description": "Delete custom chatbot instructions. Requires confirm=true.\n\nRequired scope: `instructions:delete`.\n\nOn success, `data` contains: `deletedInstruction`.",
        "tags": [
          "Instructions"
        ],
        "security": [
          {
            "bearerAuth": [
              "instructions:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "instructions:delete"
        ],
        "x-mint": {
          "title": "Delete instructions",
          "description": "Delete custom chatbot instructions. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instructionId",
            "in": "path",
            "required": true,
            "description": "Instruction ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedInstruction": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedInstruction": {
                      "id": "instruction-id",
                      "name": "Example instruction",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/instructions/{instructionId}/use": {
      "post": {
        "operationId": "useInstruction",
        "summary": "Use instructions",
        "description": "Make instructions active for a chatbot.\n\nRequired scope: `instructions:write`.\n\nOn success, `data` contains: `instruction`, `activeInstructionId`.",
        "tags": [
          "Instructions"
        ],
        "security": [
          {
            "bearerAuth": [
              "instructions:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "instructions:write"
        ],
        "x-mint": {
          "title": "Use instructions",
          "description": "Make instructions active for a chatbot."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "instructionId",
            "in": "path",
            "required": true,
            "description": "Instruction ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "instruction": {
                          "$ref": "#/components/schemas/Instruction"
                        },
                        "activeInstructionId": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "ID of the currently active instruction; null when default."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "instruction": {
                      "id": "instruction-id",
                      "name": "Example instruction",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/settings": {
      "get": {
        "operationId": "getSettings",
        "summary": "Get settings",
        "description": "Get safe chatbot settings.\n\nRequired scope: `settings:read`.\n\nOn success, `data` contains: `settings`, `sections`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearerAuth": [
              "settings:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "settings:read"
        ],
        "x-mint": {
          "title": "Get settings",
          "description": "Get safe chatbot settings."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "settings": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Map of settings section name to that section payload."
                        },
                        "sections": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Names of every settings section."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "settings": {
                      "general": {
                        "title": "Example chatbot"
                      }
                    },
                    "sections": [
                      "general",
                      "ai",
                      "localization"
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateSettings",
        "summary": "Update settings",
        "description": "Update safe chatbot settings across sections.\n\nRequired scope: `settings:write`.\n\nOn success, `data` contains: `settings`, `updatedSections`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearerAuth": [
              "settings:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "settings:write"
        ],
        "x-mint": {
          "title": "Update settings",
          "description": "Update safe chatbot settings across sections."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Partial safe chatbot settings patch. Only public dashboard settings accepted by API v2 can be changed."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "settings": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Map of settings section name to that section payload."
                        },
                        "updatedSections": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Names of the sections this update touched."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "settings": {
                      "general": {
                        "title": "Example chatbot"
                      }
                    },
                    "updatedSections": [
                      "general"
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/settings/{section}": {
      "get": {
        "operationId": "getSettingsSection",
        "summary": "Get settings section",
        "description": "Get one safe chatbot settings section.\n\nRequired scope: `settings:read`.\n\nOn success, `data` contains: `section`, `settings`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearerAuth": [
              "settings:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "settings:read"
        ],
        "x-mint": {
          "title": "Get settings section",
          "description": "Get one safe chatbot settings section."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "path",
            "required": true,
            "description": "Settings section name, as listed by GET /settings.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "section": {
                          "type": "string"
                        },
                        "settings": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "The requested settings section."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "section": "general",
                    "settings": {
                      "title": "Example chatbot"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateSettingsSection",
        "summary": "Update settings section",
        "description": "Update one safe chatbot settings section.\n\nRequired scope: `settings:write`.\n\nOn success, `data` contains: `section`, `settings`.",
        "tags": [
          "Settings"
        ],
        "security": [
          {
            "bearerAuth": [
              "settings:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "settings:write"
        ],
        "x-mint": {
          "title": "Update settings section",
          "description": "Update one safe chatbot settings section."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "section",
            "in": "path",
            "required": true,
            "description": "Settings section name, as listed by GET /settings.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "description": "Partial safe chatbot settings patch. Only public dashboard settings accepted by API v2 can be changed."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "section": {
                          "type": "string"
                        },
                        "settings": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "The updated settings section."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "section": "general",
                    "settings": {
                      "title": "Example chatbot"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/starters": {
      "get": {
        "operationId": "listStarters",
        "summary": "List starters",
        "description": "List conversation starters.\n\nRequired scope: `starters:read`.\n\nOn success, `data` contains: `starters`.",
        "tags": [
          "Conversation Starters"
        ],
        "security": [
          {
            "bearerAuth": [
              "starters:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "starters:read"
        ],
        "x-mint": {
          "title": "List starters",
          "description": "List conversation starters."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "starters": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PromptButton"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "starters": [
                      {
                        "id": "starter-id",
                        "title": "Example starter"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createStarter",
        "summary": "Create starter",
        "description": "Create a conversation starter.\n\nRequired scope: `starters:write`.\n\nOn success, `data` contains: `starter`.",
        "tags": [
          "Conversation Starters"
        ],
        "security": [
          {
            "bearerAuth": [
              "starters:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "starters:write"
        ],
        "x-mint": {
          "title": "Create starter",
          "description": "Create a conversation starter."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "link": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK"
                    ]
                  },
                  "promptType": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK"
                    ],
                    "description": "Alias of type; type wins when both are sent."
                  },
                  "isEscalationPrompt": {
                    "type": "boolean"
                  },
                  "functionId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "order": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "paths": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Page paths where this starter shows, like /pricing or /docs/* (the Excluded Pages grammar; at most 20). Empty or null shows it on every page — the default. Web widget only: channels always show every starter."
                  }
                }
              },
              "example": {
                "title": "Pricing",
                "message": "What plans do you offer?",
                "type": "PROMPT"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "starter": {
                          "$ref": "#/components/schemas/PromptButton"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "starter": {
                      "id": "starter-id",
                      "name": "Example starter",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/starters/{starterId}": {
      "get": {
        "operationId": "getStarter",
        "summary": "Get starter",
        "description": "Get one conversation starter.\n\nRequired scope: `starters:read`.\n\nOn success, `data` contains: `starter`.",
        "tags": [
          "Conversation Starters"
        ],
        "security": [
          {
            "bearerAuth": [
              "starters:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "starters:read"
        ],
        "x-mint": {
          "title": "Get starter",
          "description": "Get one conversation starter."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starterId",
            "in": "path",
            "required": true,
            "description": "Conversation starter ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "starter": {
                          "$ref": "#/components/schemas/PromptButton"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "starter": {
                      "id": "starter-id",
                      "name": "Example starter",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateStarter",
        "summary": "Update starter",
        "description": "Update a conversation starter.\n\nRequired scope: `starters:write`.\n\nOn success, `data` contains: `starter`.",
        "tags": [
          "Conversation Starters"
        ],
        "security": [
          {
            "bearerAuth": [
              "starters:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "starters:write"
        ],
        "x-mint": {
          "title": "Update starter",
          "description": "Update a conversation starter."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starterId",
            "in": "path",
            "required": true,
            "description": "Conversation starter ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "link": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK"
                    ]
                  },
                  "promptType": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK"
                    ],
                    "description": "Alias of type; type wins when both are sent."
                  },
                  "isEscalationPrompt": {
                    "type": "boolean"
                  },
                  "functionId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "order": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "paths": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Page paths where this starter shows, like /pricing or /docs/* (the Excluded Pages grammar; at most 20). Empty or null shows it on every page — the default. Web widget only: channels always show every starter."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "starter": {
                          "$ref": "#/components/schemas/PromptButton"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "starter": {
                      "id": "starter-id",
                      "name": "Example starter",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteStarter",
        "summary": "Delete starter",
        "description": "Delete a conversation starter. Requires confirm=true.\n\nRequired scope: `starters:delete`.\n\nOn success, `data` contains: `deletedStarter`.",
        "tags": [
          "Conversation Starters"
        ],
        "security": [
          {
            "bearerAuth": [
              "starters:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "starters:delete"
        ],
        "x-mint": {
          "title": "Delete starter",
          "description": "Delete a conversation starter. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "starterId",
            "in": "path",
            "required": true,
            "description": "Conversation starter ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedStarter": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedStarter": {
                      "id": "starter-id",
                      "name": "Example starter",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/starters/reorder": {
      "post": {
        "operationId": "reorderStarters",
        "summary": "Reorder starters",
        "description": "Reorder conversation starters.\n\nRequired scope: `starters:write`.\n\nOn success, `data` contains: `starters`.",
        "tags": [
          "Conversation Starters"
        ],
        "security": [
          {
            "bearerAuth": [
              "starters:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "starters:write"
        ],
        "x-mint": {
          "title": "Reorder starters",
          "description": "Reorder conversation starters."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "orderedIds"
                ],
                "additionalProperties": false,
                "properties": {
                  "orderedIds": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "starters": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PromptButton"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "starters": [
                      {
                        "id": "starter-id",
                        "title": "Example starter",
                        "order": 0
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/followups": {
      "get": {
        "operationId": "listFollowups",
        "summary": "List followups",
        "description": "List conversation followups.\n\nRequired scope: `followups:read`.\n\nOn success, `data` contains: `followups`.",
        "tags": [
          "Conversation Followups"
        ],
        "security": [
          {
            "bearerAuth": [
              "followups:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "followups:read"
        ],
        "x-mint": {
          "title": "List followups",
          "description": "List conversation followups."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "followups": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PromptButton"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "followups": [
                      {
                        "id": "followup-id",
                        "title": "Example followup"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createFollowup",
        "summary": "Create followup",
        "description": "Create a conversation followup.\n\nRequired scope: `followups:write`.\n\nOn success, `data` contains: `followup`.",
        "tags": [
          "Conversation Followups"
        ],
        "security": [
          {
            "bearerAuth": [
              "followups:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "followups:write"
        ],
        "x-mint": {
          "title": "Create followup",
          "description": "Create a conversation followup."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "link": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK",
                      "ESCALATION"
                    ]
                  },
                  "promptType": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK",
                      "ESCALATION"
                    ],
                    "description": "Alias of type; type wins when both are sent."
                  },
                  "isEscalationPrompt": {
                    "type": "boolean"
                  },
                  "functionId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "order": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "example": {
                "title": "Contact support",
                "link": "https://example.com/contact",
                "type": "LINK"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "followup": {
                          "$ref": "#/components/schemas/PromptButton"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "followup": {
                      "id": "followup-id",
                      "name": "Example followup",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/followups/{followupId}": {
      "get": {
        "operationId": "getFollowup",
        "summary": "Get followup",
        "description": "Get one conversation followup.\n\nRequired scope: `followups:read`.\n\nOn success, `data` contains: `followup`.",
        "tags": [
          "Conversation Followups"
        ],
        "security": [
          {
            "bearerAuth": [
              "followups:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "followups:read"
        ],
        "x-mint": {
          "title": "Get followup",
          "description": "Get one conversation followup."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "followupId",
            "in": "path",
            "required": true,
            "description": "Follow-up prompt ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "followup": {
                          "$ref": "#/components/schemas/PromptButton"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "followup": {
                      "id": "followup-id",
                      "name": "Example followup",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateFollowup",
        "summary": "Update followup",
        "description": "Update a conversation followup.\n\nRequired scope: `followups:write`.\n\nOn success, `data` contains: `followup`.",
        "tags": [
          "Conversation Followups"
        ],
        "security": [
          {
            "bearerAuth": [
              "followups:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "followups:write"
        ],
        "x-mint": {
          "title": "Update followup",
          "description": "Update a conversation followup."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "followupId",
            "in": "path",
            "required": true,
            "description": "Follow-up prompt ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  },
                  "message": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "link": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK",
                      "ESCALATION"
                    ]
                  },
                  "promptType": {
                    "type": "string",
                    "enum": [
                      "PROMPT",
                      "LINK",
                      "ESCALATION"
                    ],
                    "description": "Alias of type; type wins when both are sent."
                  },
                  "isEscalationPrompt": {
                    "type": "boolean"
                  },
                  "functionId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "order": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "followup": {
                          "$ref": "#/components/schemas/PromptButton"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "followup": {
                      "id": "followup-id",
                      "name": "Example followup",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteFollowup",
        "summary": "Delete followup",
        "description": "Delete a conversation followup. Requires confirm=true.\n\nRequired scope: `followups:delete`.\n\nOn success, `data` contains: `deletedFollowup`.",
        "tags": [
          "Conversation Followups"
        ],
        "security": [
          {
            "bearerAuth": [
              "followups:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "followups:delete"
        ],
        "x-mint": {
          "title": "Delete followup",
          "description": "Delete a conversation followup. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "followupId",
            "in": "path",
            "required": true,
            "description": "Follow-up prompt ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedFollowup": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedFollowup": {
                      "id": "followup-id",
                      "name": "Example followup",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/followups/reorder": {
      "post": {
        "operationId": "reorderFollowups",
        "summary": "Reorder followups",
        "description": "Reorder conversation followups.\n\nRequired scope: `followups:write`.\n\nOn success, `data` contains: `followups`.",
        "tags": [
          "Conversation Followups"
        ],
        "security": [
          {
            "bearerAuth": [
              "followups:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "followups:write"
        ],
        "x-mint": {
          "title": "Reorder followups",
          "description": "Reorder conversation followups."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "orderedIds"
                ],
                "additionalProperties": false,
                "properties": {
                  "orderedIds": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "followups": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/PromptButton"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "followups": [
                      {
                        "id": "followup-id",
                        "title": "Example followup",
                        "order": 0
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/members": {
      "get": {
        "operationId": "listMembers",
        "summary": "List members",
        "description": "List chatbot members and pending invites.\n\nRequired scope: `members:read`.\n\nOn success, `data` contains: `members`, `pendingInvites`.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "bearerAuth": [
              "members:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "members:read"
        ],
        "x-mint": {
          "title": "List members",
          "description": "List chatbot members and pending invites."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "members": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Member"
                          }
                        },
                        "pendingInvites": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/MemberInvite"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "members": [
                      {
                        "id": "member-id",
                        "role": "AGENT",
                        "userId": "user-id"
                      }
                    ],
                    "pendingInvites": []
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "inviteMember",
        "summary": "Invite member",
        "description": "Invite a chatbot member by email, or add them directly with skipInvite=true (no invite email, account provisioned if needed). A repeat invite with the same role sends the pending invite again (resent=true). The API answers 409 MEMBER_ALREADY_EXISTS for a member, 409 MEMBER_INVITE_PENDING for a pending invite with another role, and 409 MEMBERS_QUOTA_EXCEEDED when a new invite has no seat.\n\nRequired scope: `members:write`.\n\nOn success, `data` contains: `member`, `invite`, `resent`.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "bearerAuth": [
              "members:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "members:write"
        ],
        "x-mint": {
          "title": "Invite member",
          "description": "Invite a chatbot member by email, or add them directly with skipInvite=true (no invite email, account provisioned if needed). A repeat invite with the same role sends the pending invite again (resent=true). The API answers 409 MEMBER_ALREADY_EXISTS for a member, 409 MEMBER_INVITE_PENDING for a pending invite with another role, and 409 MEMBERS_QUOTA_EXCEEDED when a new invite has no seat."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "additionalProperties": false,
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "AGENT",
                      "MANAGER",
                      "ADMIN",
                      "SUPER_ADMIN"
                    ],
                    "default": "AGENT",
                    "description": "Chatbot member role. Defaults to AGENT."
                  },
                  "skipInvite": {
                    "type": "boolean",
                    "description": "If true, add the member directly with no invite email or expiring token; their account is provisioned if it does not exist yet. Returns the member instead of a pending invite."
                  }
                }
              },
              "example": {
                "email": "teammate@example.com",
                "role": "AGENT"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "member": {
                          "$ref": "#/components/schemas/Member",
                          "description": "Present when skipInvite is true: the user was added directly, and their account was created if it did not exist."
                        },
                        "invite": {
                          "$ref": "#/components/schemas/MemberInvite",
                          "description": "Present when an invite email was sent."
                        },
                        "resent": {
                          "type": "boolean",
                          "description": "Present with invite. True when the email already had a pending invite with this role: the API sent that invite email again, and no new invite was created."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "member": {
                      "id": "member-id",
                      "name": "Example member",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/members/{userId}": {
      "delete": {
        "operationId": "removeMember",
        "summary": "Remove member",
        "description": "Remove a chatbot member. Requires confirm=true.\n\nRequired scope: `members:delete`.\n\nOn success, `data` contains: `removedMember`.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "bearerAuth": [
              "members:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "members:delete"
        ],
        "x-mint": {
          "title": "Remove member",
          "description": "Remove a chatbot member. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "Member user ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "removedMember": {
                          "$ref": "#/components/schemas/Member"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "removedMember": {
                      "id": "member-id",
                      "role": "AGENT",
                      "userId": "user-id"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/member-invites": {
      "get": {
        "operationId": "listMemberInvites",
        "summary": "List invites",
        "description": "List pending chatbot member invites.\n\nRequired scope: `members:read`.\n\nOn success, `data` contains: `pendingInvites`.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "bearerAuth": [
              "members:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "members:read"
        ],
        "x-mint": {
          "title": "List invites",
          "description": "List pending chatbot member invites."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "pendingInvites": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/MemberInvite"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "pendingInvites": [
                      {
                        "id": "invite-id",
                        "email": "teammate@example.com"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/member-invites/{inviteId}": {
      "delete": {
        "operationId": "cancelMemberInvite",
        "summary": "Cancel invite",
        "description": "Cancel a pending chatbot member invite. Requires confirm=true.\n\nRequired scope: `members:write`.\n\nOn success, `data` contains: `canceledInvite`.",
        "tags": [
          "Members"
        ],
        "security": [
          {
            "bearerAuth": [
              "members:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "members:write"
        ],
        "x-mint": {
          "title": "Cancel invite",
          "description": "Cancel a pending chatbot member invite. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "inviteId",
            "in": "path",
            "required": true,
            "description": "Member invite ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "canceledInvite": {
                          "$ref": "#/components/schemas/MemberInvite"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "canceledInvite": {
                      "id": "invite-id",
                      "email": "teammate@example.com"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/leads": {
      "get": {
        "operationId": "listLeads",
        "summary": "List leads",
        "description": "List chatbot leads.\n\nRequired scope: `leads:read`.\n\nOn success, `data` contains: `leads`, `filters`, `pagination`.",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "bearerAuth": [
              "leads:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "leads:read"
        ],
        "x-mint": {
          "title": "List leads",
          "description": "List chatbot leads."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Lead status filter.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "open",
                "archived"
              ]
            }
          },
          {
            "name": "important",
            "in": "query",
            "required": false,
            "description": "Important flag filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "leads": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Lead"
                          }
                        },
                        "filters": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the applied filters."
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "leads": [
                      {
                        "id": "lead-id",
                        "name": "Example lead",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/leads/{leadId}": {
      "get": {
        "operationId": "getLead",
        "summary": "Get lead",
        "description": "Get one chatbot lead.\n\nRequired scope: `leads:read`.\n\nOn success, `data` contains: `lead`, `threads`.",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "bearerAuth": [
              "leads:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "leads:read"
        ],
        "x-mint": {
          "title": "Get lead",
          "description": "Get one chatbot lead."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "lead": {
                          "$ref": "#/components/schemas/Lead"
                        },
                        "threads": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/GenericObject",
                            "description": "Conversation summary for this lead."
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "lead": {
                      "id": "lead-id",
                      "name": "Example lead",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateLead",
        "summary": "Update lead",
        "description": "Update a chatbot lead.\n\nRequired scope: `leads:write`.\n\nOn success, `data` contains: `lead`, `previousLead`.",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "bearerAuth": [
              "leads:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "leads:write"
        ],
        "x-mint": {
          "title": "Update lead",
          "description": "Update a chatbot lead."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "important": {
                    "type": "boolean"
                  },
                  "archived": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "important": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "lead": {
                          "$ref": "#/components/schemas/Lead"
                        },
                        "previousLead": {
                          "$ref": "#/components/schemas/Lead",
                          "description": "The lead as it was before this update."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "lead": {
                      "id": "lead-id",
                      "name": "Example lead",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteLead",
        "summary": "Delete lead",
        "description": "Delete a chatbot lead. Requires confirm=true.\n\nRequired scope: `leads:delete`.\n\nOn success, `data` contains: `deletedLead`.",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "bearerAuth": [
              "leads:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "leads:delete"
        ],
        "x-mint": {
          "title": "Delete lead",
          "description": "Delete a chatbot lead. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "leadId",
            "in": "path",
            "required": true,
            "description": "Lead ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedLead": {
                          "$ref": "#/components/schemas/Lead"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedLead": {
                      "id": "lead-id",
                      "name": "Example lead",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/leads/actions": {
      "post": {
        "operationId": "runLeadAction",
        "summary": "Run lead action",
        "description": "Run a bulk lead action.\n\nRequired scope: `leads:write`.\n\nOn success, `data` contains: `action`, `leads`.",
        "tags": [
          "Leads"
        ],
        "security": [
          {
            "bearerAuth": [
              "leads:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "leads:write"
        ],
        "x-mint": {
          "title": "Run lead action",
          "description": "Run a bulk lead action."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action",
                  "leadIds"
                ],
                "additionalProperties": false,
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "archive",
                      "delete",
                      "star",
                      "unarchive",
                      "unstar"
                    ]
                  },
                  "leadIds": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    }
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required true for bulk delete."
                  }
                }
              },
              "example": {
                "action": "star",
                "leadIds": [
                  "lead-id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "leads": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Lead"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "action": "star",
                    "leads": [
                      {
                        "id": "lead-id",
                        "name": "Example lead",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations": {
      "get": {
        "operationId": "listConversations",
        "summary": "List conversations",
        "description": "List chatbot conversations.\n\nRequired scope: `conversations:read`.\n\nOn success, `data` contains: `conversations`, `filters`, `pagination`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:read"
        ],
        "x-mint": {
          "title": "List conversations",
          "description": "List chatbot conversations."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Conversation status filter.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "open",
                "resolved"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Conversation mode filter.",
            "schema": {
              "type": "string",
              "enum": [
                "AI",
                "AGENT"
              ]
            }
          },
          {
            "name": "important",
            "in": "query",
            "required": false,
            "description": "Important flag filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "escalated",
            "in": "query",
            "required": false,
            "description": "Escalated flag filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "read",
            "in": "query",
            "required": false,
            "description": "Read flag filter.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "leadId",
            "in": "query",
            "required": false,
            "description": "Lead ID filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagId",
            "in": "query",
            "required": false,
            "description": "Repeatable tag ID filter.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "reaction",
            "in": "query",
            "required": false,
            "description": "Message reaction filter.",
            "schema": {
              "type": "string",
              "enum": [
                "NEGATIVE",
                "POSITIVE"
              ]
            }
          },
          {
            "name": "gptModel",
            "in": "query",
            "required": false,
            "description": "GPT model bucket filter.",
            "schema": {
              "type": "string",
              "enum": [
                "gpt-4.1",
                "gpt-4.1-mini"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Where the conversation started: website (the chat widget or the hosted chat page), api, or a connected channel.",
            "schema": {
              "type": "string",
              "enum": [
                "website",
                "api",
                "whatsapp",
                "messenger",
                "slack",
                "google_chat",
                "crisp",
                "freshdesk",
                "zoho_salesiq",
                "zendesk",
                "intercom",
                "email"
              ]
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeEmpty",
            "in": "query",
            "required": false,
            "description": "Include empty conversations.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "scanLimit",
            "in": "query",
            "required": false,
            "description": "Maximum conversations to scan for filters.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "conversations": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Conversation"
                          }
                        },
                        "filters": {
                          "$ref": "#/components/schemas/GenericObject",
                          "description": "Echo of the applied filters."
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "conversations": [
                      {
                        "id": "conversation-id",
                        "name": "Example conversation",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createConversation",
        "summary": "Create conversation",
        "description": "Create a chatbot conversation.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `conversation`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Create conversation",
          "description": "Create a chatbot conversation."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "threadId": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "AI",
                      "AGENT"
                    ]
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tagIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "chatUser": {
                    "type": "object",
                    "required": [
                      "email"
                    ],
                    "additionalProperties": true,
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "customData": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  },
                  "pageUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "sessionId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "example": {
                "title": "Pricing question",
                "chatUser": {
                  "email": "customer@example.com",
                  "name": "Customer"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "conversation": {
                          "$ref": "#/components/schemas/Conversation"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "conversation": {
                      "id": "conversation-id",
                      "name": "Example conversation",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/bulk": {
      "post": {
        "operationId": "runConversationAction",
        "summary": "Run conversation action",
        "description": "Run a bulk conversation action.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `action`, `conversations`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Run conversation action",
          "description": "Run a bulk conversation action."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action",
                  "threadIds"
                ],
                "additionalProperties": false,
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "delete",
                      "mark-read",
                      "mark-unread",
                      "resolve",
                      "star",
                      "unresolve",
                      "unstar"
                    ]
                  },
                  "threadIds": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string"
                    }
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Required true for bulk delete."
                  }
                }
              },
              "example": {
                "action": "mark-read",
                "threadIds": [
                  "thread-id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "conversations": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Conversation"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "action": "star",
                    "conversations": [
                      {
                        "id": "conversation-id",
                        "name": "Example conversation",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}": {
      "get": {
        "operationId": "getConversation",
        "summary": "Get conversation",
        "description": "Get one chatbot conversation.\n\nRequired scope: `conversations:read`.\n\nOn success, `data` contains: `conversation`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:read"
        ],
        "x-mint": {
          "title": "Get conversation",
          "description": "Get one chatbot conversation."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "conversation": {
                          "$ref": "#/components/schemas/Conversation"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "conversation": {
                      "id": "conversation-id",
                      "name": "Example conversation",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateConversation",
        "summary": "Update conversation",
        "description": "Update one chatbot conversation.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `conversation`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Update conversation",
          "description": "Update one chatbot conversation."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "threadId": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "AI",
                      "AGENT"
                    ]
                  },
                  "title": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tagIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "chatUser": {
                    "type": "object",
                    "required": [
                      "email"
                    ],
                    "additionalProperties": true,
                    "properties": {
                      "email": {
                        "type": "string",
                        "format": "email"
                      },
                      "name": {
                        "type": "string"
                      },
                      "phone": {
                        "type": "string"
                      },
                      "customData": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "nullable": true
                  },
                  "pageUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "sessionId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "important": {
                    "type": "boolean"
                  },
                  "resolved": {
                    "type": "boolean"
                  },
                  "escalated": {
                    "type": "boolean"
                  },
                  "webhookUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "webhookToken": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "markRead": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "important": true,
                "tagIds": [
                  "tag-id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "conversation": {
                          "$ref": "#/components/schemas/Conversation"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "conversation": {
                      "id": "conversation-id",
                      "name": "Example conversation",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteConversation",
        "summary": "Delete conversation",
        "description": "Delete one chatbot conversation. Requires confirm=true.\n\nRequired scope: `conversations:delete`.\n\nOn success, `data` contains: `deletedConversation`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:delete"
        ],
        "x-mint": {
          "title": "Delete conversation",
          "description": "Delete one chatbot conversation. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedConversation": {
                          "$ref": "#/components/schemas/Conversation"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedConversation": {
                      "id": "conversation-id",
                      "name": "Example conversation",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/escalate": {
      "post": {
        "operationId": "escalateConversation",
        "summary": "Escalate conversation",
        "description": "Escalate a conversation to human support.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `message`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Escalate conversation",
          "description": "Escalate a conversation to human support."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "description": "Optional note to add when switching conversation mode."
                  }
                }
              },
              "example": {
                "message": "Please follow up with this customer."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "message": {
                          "$ref": "#/components/schemas/Message",
                          "description": "The system message recording the escalation."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "message": {
                      "messageId": "message-id",
                      "messageType": "SYSTEM_MESSAGE",
                      "systemMessageType": "CONVERSATION_ESCALATED"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/switch-to-ai": {
      "post": {
        "operationId": "switchConversationToAi",
        "summary": "Switch to AI",
        "description": "Switch an escalated conversation back to AI mode.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `message`, `switched`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Switch to AI",
          "description": "Switch an escalated conversation back to AI mode."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "description": "Optional note to add when switching conversation mode."
                  }
                }
              },
              "example": {
                "message": "Switching back to AI support."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "message": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/Message"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "The system message recording the switch back to AI. Null when this request posted none: the AI already had the conversation, or a request at the same moment posted it. Each switch gets one message."
                        },
                        "switched": {
                          "type": "boolean",
                          "description": "True when this request handed the conversation back to the AI. False when the AI already had it."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "message": {
                      "messageId": "message-id",
                      "messageType": "SYSTEM_MESSAGE",
                      "systemMessageType": "CONVERSATION_SWITCHED_TO_AI"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/take-over": {
      "post": {
        "operationId": "takeOverConversation",
        "summary": "Take over",
        "description": "Take over a conversation as a human agent.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `message`, `tookOver`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Take over",
          "description": "Take over a conversation as a human agent."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000,
                    "description": "Optional note to add when switching conversation mode."
                  }
                }
              },
              "example": {
                "message": "A human agent has joined the conversation."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "message": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/Message"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "The system message recording the human take-over. Null when this request posted none: your team already held the conversation, or a request at the same moment posted it. Each take-over gets one message."
                        },
                        "tookOver": {
                          "type": "boolean",
                          "description": "True when this request took the conversation over. False when your team already held it."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "message": {
                      "messageId": "message-id",
                      "messageType": "SYSTEM_MESSAGE",
                      "systemMessageType": "HUMAN_TOOK_OVER"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/replies": {
      "post": {
        "operationId": "replyToConversation",
        "summary": "Reply to conversation",
        "description": "Reply to the visitor as a human agent. If your team does not handle the conversation yet, the reply takes it over first. A conversation on a channel with its own agent inbox (Slack, Crisp, and others) refuses with 409 REPLY_IN_CHANNEL.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `message`, `tookOver`, `channelDelivery`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Reply to conversation",
          "description": "Reply to the visitor as a human agent. If your team does not handle the conversation yet, the reply takes it over first. A conversation on a channel with its own agent inbox (Slack, Crisp, and others) refuses with 409 REPLY_IN_CHANNEL."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20000,
                    "description": "The reply the visitor sees, from a human agent."
                  }
                }
              },
              "example": {
                "message": "Thanks for waiting. Your order ships tomorrow."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "message": {
                          "$ref": "#/components/schemas/Message",
                          "description": "The saved reply (an AGENT_MESSAGE)."
                        },
                        "tookOver": {
                          "type": "boolean",
                          "description": "True when the reply took the conversation over first. The visitor then also sees the take-over notice."
                        },
                        "channelDelivery": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "The delivery to a messaging channel. channel is null for a website conversation. For a WhatsApp, Messenger or email conversation, delivered is false with a reason when the reply was not delivered (the reply stays in the transcript)."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "message": {
                      "messageId": "message-id",
                      "messageType": "AGENT_MESSAGE",
                      "answer": {
                        "text": "Thanks for waiting. Your order ships tomorrow."
                      }
                    },
                    "tookOver": true,
                    "channelDelivery": {
                      "channel": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/drafts": {
      "get": {
        "operationId": "listConversationDrafts",
        "summary": "List email drafts",
        "description": "List the email drafts of a conversation: AI answers to customer emails that wait for a person to send, edit or discard them. Empty for a conversation that is not on email.\n\nRequired scope: `conversations:read`.\n\nOn success, `data` contains: `drafts`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:read"
        ],
        "x-mint": {
          "title": "List email drafts",
          "description": "List the email drafts of a conversation: AI answers to customer emails that wait for a person to send, edit or discard them. Empty for a conversation that is not on email."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "drafts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "text": {
                                "type": "string",
                                "description": "The draft as the AI wrote it."
                              },
                              "subject": {
                                "type": "string"
                              },
                              "to": {
                                "type": "string",
                                "description": "The customer address it goes to."
                              },
                              "createdAt": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "drafts": [
                      {
                        "id": "draft-id",
                        "text": "Your order 4521 ships today. You will get tracking by email.",
                        "subject": "Order 4521",
                        "to": "customer@example.com",
                        "createdAt": "2026-10-12T09:00:00.000Z"
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/drafts/{draftId}/send": {
      "post": {
        "operationId": "sendConversationDraft",
        "summary": "Send email draft",
        "description": "Send an email draft to the customer. Without a body it goes out as the AI wrote it. With message, your text goes out instead, as your reply. A draft is sent once.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `sent`, `edited`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Send email draft",
          "description": "Send an email draft to the customer. Without a body it goes out as the AI wrote it. With message, your text goes out instead, as your reply. A draft is sent once."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draftId",
            "in": "path",
            "required": true,
            "description": "draftId path parameter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20000,
                    "description": "Optional. Your text instead of the draft. It goes out as your reply and joins the transcript. Leave it out to send the draft as the AI wrote it."
                  }
                }
              },
              "example": {
                "message": "Your order ships tomorrow morning. Tracking follows by email."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "sent": {
                          "type": "boolean"
                        },
                        "edited": {
                          "type": "boolean",
                          "description": "True when your text went out instead of the draft."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "sent": true,
                    "edited": false
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "502": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/drafts/{draftId}": {
      "delete": {
        "operationId": "discardConversationDraft",
        "summary": "Discard email draft",
        "description": "Discard an email draft. It is never sent.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `discarded`.",
        "tags": [
          "Conversations"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Discard email draft",
          "description": "Discard an email draft. It is never sent."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "draftId",
            "in": "path",
            "required": true,
            "description": "draftId path parameter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "discarded": {
                          "type": "boolean"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "discarded": true
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/messages": {
      "post": {
        "operationId": "sendMessageToNewConversation",
        "summary": "Send new message",
        "description": "Send a visitor message and start a new conversation.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `conversation`, `message`, `awayMessage`.",
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Send new message",
          "description": "Send a visitor message and start a new conversation."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1
                  },
                  "pageUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  }
                }
              },
              "example": {
                "message": "Can you explain your pricing?"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "conversation": {
                          "$ref": "#/components/schemas/Conversation"
                        },
                        "message": {
                          "$ref": "#/components/schemas/Message"
                        },
                        "awayMessage": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/Message"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "The away message this message got: set when the conversation is held by the team, outside the working hours of the chatbot, with an away message. Show its answer text to the visitor. Each conversation gets it one time, so later messages return null."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "message": {
                      "id": "message-id",
                      "name": "Example message",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "429": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/messages": {
      "get": {
        "operationId": "listConversationMessages",
        "summary": "List messages",
        "description": "List conversation messages.\n\nRequired scope: `conversations:read`.\n\nOn success, `data` contains: `messages`, `pagination`.",
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:read"
        ],
        "x-mint": {
          "title": "List messages",
          "description": "List conversation messages."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "messages": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Message"
                          }
                        },
                        "pagination": {
                          "$ref": "#/components/schemas/Pagination"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "messages": [
                      {
                        "id": "message-id",
                        "name": "Example message",
                        "createdAt": "2026-05-13T00:00:00.000Z"
                      }
                    ],
                    "pagination": {
                      "limit": 20,
                      "hasNextPage": false,
                      "nextCursor": null
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "sendConversationMessage",
        "summary": "Send message",
        "description": "Send a visitor message to an existing conversation.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `message`, `awayMessage`.",
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Send message",
          "description": "Send a visitor message to an existing conversation."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "message"
                ],
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string",
                    "minLength": 1
                  },
                  "pageUrl": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  }
                }
              },
              "example": {
                "message": "I have one more question."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "message": {
                          "$ref": "#/components/schemas/Message"
                        },
                        "awayMessage": {
                          "anyOf": [
                            {
                              "$ref": "#/components/schemas/Message"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "description": "The away message this message got: set when the conversation is held by the team, outside the working hours of the chatbot, with an away message. Show its answer text to the visitor. Each conversation gets it one time, so later messages return null."
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "message": {
                      "id": "message-id",
                      "name": "Example message",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          },
          "429": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/conversations/{threadId}/messages/{messageId}": {
      "patch": {
        "operationId": "updateConversationMessage",
        "summary": "Update message",
        "description": "React to or edit a conversation message.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `message`.",
        "tags": [
          "Messages"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Update message",
          "description": "React to or edit a conversation message."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "threadId",
            "in": "path",
            "required": true,
            "description": "Conversation thread ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "description": "Message ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reaction": {
                    "type": "string",
                    "enum": [
                      "NEGATIVE",
                      "NEUTRAL",
                      "POSITIVE"
                    ]
                  },
                  "text": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "reaction": "POSITIVE"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "message": {
                          "$ref": "#/components/schemas/Message"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "message": {
                      "id": "message-id",
                      "name": "Example message",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "503": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/tags": {
      "get": {
        "operationId": "listTags",
        "summary": "List tags",
        "description": "List conversation tags.\n\nRequired scope: `conversations:read`.\n\nOn success, `data` contains: `tags`.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:read"
        ],
        "x-mint": {
          "title": "List tags",
          "description": "List conversation tags."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Search query.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "tags": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Tag"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "tags": [
                      {
                        "id": "tag-id",
                        "title": "VIP",
                        "conversationCount": 3
                      }
                    ]
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "post": {
        "operationId": "createTag",
        "summary": "Create tag",
        "description": "Create a conversation tag.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `tag`.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Create tag",
          "description": "Create a conversation tag."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "example": {
                "title": "VIP"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "tag": {
                          "$ref": "#/components/schemas/Tag"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "tag": {
                      "id": "tag-id",
                      "name": "Example tag",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    },
    "/api/v2/chatbots/{chatbotId}/tags/{tagId}": {
      "get": {
        "operationId": "getTag",
        "summary": "Get tag",
        "description": "Get one conversation tag.\n\nRequired scope: `conversations:read`.\n\nOn success, `data` contains: `tag`.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:read"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:read"
        ],
        "x-mint": {
          "title": "Get tag",
          "description": "Get one conversation tag."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "description": "tagId path parameter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "tag": {
                          "$ref": "#/components/schemas/Tag"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "tag": {
                      "id": "tag-id",
                      "name": "Example tag",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "patch": {
        "operationId": "updateTag",
        "summary": "Update tag",
        "description": "Update a conversation tag.\n\nRequired scope: `conversations:write`.\n\nOn success, `data` contains: `tag`.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:write"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:write"
        ],
        "x-mint": {
          "title": "Update tag",
          "description": "Update a conversation tag."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "description": "tagId path parameter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "title"
                ],
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1
                  }
                }
              },
              "example": {
                "title": "Enterprise"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "tag": {
                          "$ref": "#/components/schemas/Tag"
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "tag": {
                      "id": "tag-id",
                      "name": "Example tag",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          },
          "409": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      },
      "delete": {
        "operationId": "deleteTag",
        "summary": "Delete tag",
        "description": "Delete a conversation tag. Requires confirm=true.\n\nRequired scope: `conversations:delete`.\n\nOn success, `data` contains: `deletedTag`.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": [
              "conversations:delete"
            ]
          }
        ],
        "x-sitegpt-auth": "bearer",
        "x-sitegpt-scopes": [
          "conversations:delete"
        ],
        "x-mint": {
          "title": "Delete tag",
          "description": "Delete a conversation tag. Requires confirm=true."
        },
        "parameters": [
          {
            "name": "chatbotId",
            "in": "path",
            "required": true,
            "description": "Chatbot ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "description": "tagId path parameter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "confirm",
            "in": "query",
            "required": false,
            "description": "Required true for destructive actions.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful SiteGPT API v2 response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "data",
                    "meta"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "deletedTag": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            },
                            "removedFromConversations": {
                              "type": "integer",
                              "description": "How many conversations had this tag stripped by the delete."
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/AgentResponseMeta"
                    }
                  },
                  "additionalProperties": false
                },
                "example": {
                  "ok": true,
                  "data": {
                    "deletedTag": {
                      "id": "tag-id",
                      "name": "Example tag",
                      "createdAt": "2026-05-13T00:00:00.000Z"
                    }
                  },
                  "meta": {
                    "requestId": "request-id"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/AgentError"
          },
          "401": {
            "$ref": "#/components/responses/AgentError"
          },
          "403": {
            "$ref": "#/components/responses/AgentError"
          },
          "404": {
            "$ref": "#/components/responses/AgentError"
          },
          "405": {
            "$ref": "#/components/responses/AgentError"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "SiteGPT API token"
      }
    },
    "schemas": {
      "AgentResponseMeta": {
        "type": "object",
        "required": [
          "requestId"
        ],
        "properties": {
          "requestId": {
            "type": "string"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "AgentSuccess": {
        "type": "object",
        "required": [
          "ok",
          "data",
          "meta"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "data": {
            "$ref": "#/components/schemas/GenericObject"
          },
          "meta": {
            "$ref": "#/components/schemas/AgentResponseMeta"
          }
        },
        "additionalProperties": false
      },
      "AgentError": {
        "type": "object",
        "required": [
          "ok",
          "error",
          "meta"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {}
            },
            "additionalProperties": false
          },
          "meta": {
            "type": "object",
            "required": [
              "requestId"
            ],
            "properties": {
              "requestId": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "GenericObject": {
        "type": "object",
        "additionalProperties": true
      },
      "AnalyticsCounters": {
        "type": "object",
        "description": "Daily engagement counters. Insight-derived fields (sentimentNegative, resolvedByAi, handedOff, classifiedThreads) are omitted when the account does not have insights enabled.",
        "additionalProperties": true,
        "properties": {
          "widgetOpens": {
            "type": "integer",
            "description": "Widget sessions opened (an empty conversation is created on open; reopening in the same visit counts once). Recorded since 2026-07-26."
          },
          "messages": {
            "type": "integer",
            "description": "Visitor messages sent."
          },
          "aiMessages": {
            "type": "integer",
            "description": "AI replies sent."
          },
          "positiveReactions": {
            "type": "integer"
          },
          "negativeReactions": {
            "type": "integer"
          },
          "threadsStarted": {
            "type": "integer",
            "description": "Conversations that received a first message."
          },
          "uniqueVisitors": {
            "type": "integer"
          },
          "escalations": {
            "type": "integer"
          },
          "leads": {
            "type": "integer"
          },
          "unansweredTurns": {
            "type": "integer",
            "description": "Turns the chatbot could not answer."
          },
          "sentimentNegative": {
            "type": "integer",
            "description": "Insight counter — present only when insights is enabled."
          },
          "resolvedByAi": {
            "type": "integer",
            "description": "Insight counter — present only when insights is enabled."
          },
          "handedOff": {
            "type": "integer",
            "description": "Insight counter — present only when insights is enabled."
          },
          "classifiedThreads": {
            "type": "integer",
            "description": "Insight counter — present only when insights is enabled."
          }
        }
      },
      "ChatbotAnalytics": {
        "type": "object",
        "description": "Daily engagement series with totals and a prior-period comparison. Requires analytics to be enabled for the account.",
        "additionalProperties": true,
        "required": [
          "startDay",
          "endDay",
          "insightsEnabled",
          "days",
          "totals",
          "prior"
        ],
        "properties": {
          "startDay": {
            "type": "string",
            "format": "date"
          },
          "endDay": {
            "type": "string",
            "format": "date"
          },
          "insightsEnabled": {
            "type": "boolean",
            "description": "Whether insight-derived counters are included for this account."
          },
          "days": {
            "type": "array",
            "description": "Dense series: one entry per UTC day in the range.",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/AnalyticsCounters"
                },
                {
                  "type": "object",
                  "properties": {
                    "day": {
                      "type": "string",
                      "format": "date"
                    }
                  }
                }
              ]
            }
          },
          "totals": {
            "$ref": "#/components/schemas/AnalyticsCounters"
          },
          "prior": {
            "$ref": "#/components/schemas/AnalyticsCounters",
            "description": "Totals for the prior period of equal length, ending the day before startDay."
          }
        }
      },
      "Pagination": {
        "type": "object",
        "description": "Cursor pagination state for paginated list endpoints.",
        "additionalProperties": false,
        "required": [
          "limit",
          "hasNextPage",
          "nextCursor"
        ],
        "properties": {
          "limit": {
            "type": "integer",
            "description": "Page size used."
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as the cursor query parameter to fetch the next page. Null on the last page."
          }
        }
      },
      "ChatUser": {
        "type": "object",
        "description": "A website visitor identified through the chat widget.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Lead": {
        "type": "object",
        "description": "A captured lead. The top-level email convenience field is present on lead endpoints; conversation payloads embed the same record without it.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "chatbotId": {
            "type": "string"
          },
          "chatUser": {
            "$ref": "#/components/schemas/ChatUser"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "description": "Convenience copy of chatUser.email."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "customData": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Custom lead-form fields collected by the widget."
          },
          "important": {
            "type": "boolean"
          },
          "archived": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Chatbot": {
        "type": "object",
        "description": "A chatbot as serialized for the agent API.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdBy": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            }
          },
          "quotas": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "pagesQuota": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "combinedMessagesQuota": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "gpt4Share": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "membersQuota": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "suggestions": {
                "type": "integer"
              },
              "nextSuggestions": {
                "type": "integer"
              },
              "tags": {
                "type": "integer"
              },
              "personas": {
                "type": "integer"
              },
              "prompts": {
                "type": "integer"
              }
            }
          },
          "connectedIntegrations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "settings": {
            "type": "object",
            "description": "Safe subset of chatbot settings. Null means the setting is unset.",
            "additionalProperties": true,
            "properties": {
              "isDisabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "mode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "gptModel": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "creativity": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "welcomeMessage": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "placeholderText": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "fallbackMessage": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "collectUserDetails": {
                "type": "string",
                "description": "Effective lead-collection mode, for example DO_NOT_COLLECT."
              },
              "collectUserData": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "enablePageContextAwareness": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "hideSources": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "supportEmail": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "humanSupportEnabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "leadCollectionEnabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            }
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "PromptButton": {
        "type": "object",
        "description": "A conversation starter or follow-up prompt button shown in the widget.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "link": {
            "type": [
              "string",
              "null"
            ]
          },
          "isEscalationPrompt": {
            "type": "boolean"
          },
          "functionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "order": {
            "type": [
              "number",
              "null"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "ESCALATION",
              "LINK",
              "PROMPT"
            ]
          },
          "paths": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "description": "Per-page scoping; starters only (followups never carry this field). Null means every page."
          }
        }
      },
      "Message": {
        "type": "object",
        "description": "One stored conversation turn. NORMAL_MESSAGE carries the visitor question plus the AI answer; USER_MESSAGE and AGENT_MESSAGE carry one side of a human conversation; SYSTEM_MESSAGE records events such as escalation.",
        "additionalProperties": true,
        "properties": {
          "messageId": {
            "type": "string"
          },
          "messageType": {
            "type": "string",
            "description": "NORMAL_MESSAGE, USER_MESSAGE, AGENT_MESSAGE, or SYSTEM_MESSAGE."
          },
          "systemMessageType": {
            "type": [
              "string",
              "null"
            ],
            "description": "Set on SYSTEM_MESSAGE rows; null otherwise."
          },
          "question": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "timestamp": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "answer": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "timestamp": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "reaction": {
            "type": "string",
            "enum": [
              "POSITIVE",
              "NEGATIVE",
              "NEUTRAL"
            ]
          },
          "gptModel": {
            "type": [
              "string",
              "null"
            ],
            "description": "Public model label for AI answers; null on human turns."
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The page URL of each knowledge passage the AI was given for this answer, in retrieval order (best match first). A page with several passages appears several times. Answers sent through this API keep an empty string for each passage from uploaded files or text; answers from the chat widget leave those out."
          },
          "agentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "agentName": {
            "type": [
              "string",
              "null"
            ]
          },
          "iconUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Conversation": {
        "type": "object",
        "description": "A conversation thread between a visitor and the chatbot.",
        "additionalProperties": true,
        "properties": {
          "threadId": {
            "type": "string"
          },
          "chatbotId": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "AI",
              "AGENT"
            ],
            "description": "AI answers automatically; AGENT means human takeover."
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "escalated": {
            "type": "boolean"
          },
          "important": {
            "type": "boolean"
          },
          "resolved": {
            "type": "boolean"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "tagIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ipAddress": {
            "type": [
              "string",
              "null"
            ]
          },
          "pageUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "website",
              "api",
              "whatsapp",
              "messenger",
              "slack",
              "google_chat",
              "crisp",
              "freshdesk",
              "zoho_salesiq",
              "zendesk",
              "intercom",
              "email"
            ],
            "description": "Where the conversation started: website (the chat widget or the hosted chat page), api, or a connected channel."
          },
          "webhookUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "webhookTokenConfigured": {
            "type": "boolean"
          },
          "chatUserId": {
            "type": [
              "string",
              "null"
            ]
          },
          "chatUser": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ChatUser"
              },
              {
                "type": "null"
              }
            ]
          },
          "lead": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Lead"
              },
              {
                "type": "null"
              }
            ]
          },
          "totalMessages": {
            "type": "integer"
          },
          "totalPositiveMessages": {
            "type": "integer"
          },
          "totalNegativeMessages": {
            "type": "integer"
          },
          "totalGpt4MessagesCount": {
            "type": "integer"
          },
          "totalMessagesRead": {
            "type": "integer"
          },
          "totalMessagesReadByUser": {
            "type": "integer"
          },
          "unreadMessages": {
            "type": "integer"
          },
          "lastMessage": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Message"
              },
              {
                "type": "null"
              }
            ]
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "description": "Full message list; present on single-conversation reads and bulk action results, absent from list endpoints."
          }
        }
      },
      "Tag": {
        "type": "object",
        "description": "A conversation tag.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "conversationCount": {
            "type": "integer"
          }
        }
      },
      "Persona": {
        "type": "object",
        "description": "A chatbot persona (built-in or custom).",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "BUILT_IN",
              "CUSTOM"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "isEditable": {
            "type": "boolean"
          },
          "isDeletable": {
            "type": "boolean"
          }
        }
      },
      "Instruction": {
        "type": "object",
        "description": "A chatbot instruction preset (built-in or custom).",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "instructions": {
            "type": "string"
          },
          "temperature": {
            "type": "number"
          },
          "source": {
            "type": "string",
            "enum": [
              "BUILT_IN",
              "CUSTOM"
            ]
          },
          "isActive": {
            "type": "boolean"
          },
          "isEditable": {
            "type": "boolean"
          },
          "isDeletable": {
            "type": "boolean"
          }
        }
      },
      "CustomResponse": {
        "type": "object",
        "description": "A curated question-and-answer override.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "chatbotId": {
            "type": "string"
          },
          "messageId": {
            "type": [
              "string",
              "null"
            ]
          },
          "question": {
            "type": "string"
          },
          "answer": {
            "type": [
              "string",
              "null"
            ]
          },
          "originalAnswer": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAnswer": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": "string",
            "description": "Review state, for example APPROVED or PENDING."
          },
          "source": {
            "type": "string",
            "enum": [
              "DOWNVOTED_BY_USER",
              "MANUALLY_ADDED",
              "MARKED_BY_ADMIN"
            ]
          },
          "document": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "carbonFileId": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "ragaasDocumentId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "error": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "carbonCustomerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "trainedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedById": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Member": {
        "type": "object",
        "description": "A chatbot team member.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "chatbotId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "AGENT, MANAGER, ADMIN, or SUPER_ADMIN."
          },
          "userId": {
            "type": "string"
          },
          "user": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "profilePicSrcId": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MemberInvite": {
        "type": "object",
        "description": "A pending member invite (the invite token is never exposed).",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "chatbotId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "invitedBy": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiToken": {
        "type": "object",
        "description": "An API token record. The secret is only present in the create and rotate responses.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tokenPrefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "chatbotIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means the token can reach every chatbot."
          },
          "source": {
            "type": "string"
          },
          "createdVia": {
            "type": "string"
          },
          "rotatedFromTokenId": {
            "type": [
              "string",
              "null"
            ]
          },
          "revokedReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiTokenWithSecret": {
        "description": "An API token record plus its plaintext secret.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ApiToken"
          },
          {
            "type": "object",
            "required": [
              "token"
            ],
            "properties": {
              "token": {
                "type": "string",
                "description": "Plaintext token, returned once. Store it immediately."
              }
            }
          }
        ]
      },
      "KnowledgeDocument": {
        "type": "object",
        "description": "A trained knowledge document.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "externalId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "description": "Ingestion source, for example SITEMAP or LOCAL_FILE."
          },
          "status": {
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Provider metadata for the document."
          },
          "properties": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenericObject",
                "description": "Document properties reported by the ingestion pipeline; null when the provider reports none."
              },
              {
                "type": "null"
              }
            ]
          },
          "rawFileUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "parsedTextFileUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "connectionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ingestJobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ingestJobRunId": {
            "type": [
              "string",
              "null"
            ]
          },
          "isContentUpdatedManually": {
            "type": "boolean"
          },
          "lastSyncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "KnowledgeSource": {
        "type": "object",
        "description": "A connected knowledge source (Notion, Google Drive, ...).",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "connector": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "statusReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "authType": {
            "type": "string"
          },
          "hasCredentials": {
            "type": "boolean"
          },
          "externalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Connector metadata."
          },
          "clientRedirectUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "tenantId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "KnowledgeSourceDocument": {
        "type": "object",
        "description": "A document discovered inside a connected knowledge source.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "externalId": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Provider metadata for the document."
          },
          "properties": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenericObject",
                "description": "Document properties reported by the provider; null when the provider reports none."
              },
              {
                "type": "null"
              }
            ]
          },
          "rawFileUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "parsedTextFileUrl": {
            "type": [
              "string",
              "null"
            ]
          },
          "ingestJobId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ingestJobRunId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IngestJobRun": {
        "type": "object",
        "description": "One run of a knowledge sync job.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "errorMessage": {
            "type": [
              "string",
              "null"
            ]
          },
          "tenantId": {
            "type": [
              "string",
              "null"
            ]
          },
          "documentStatsByStatus": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "status": {
                  "type": "string"
                },
                "count": {
                  "type": "integer"
                }
              }
            }
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IngestJob": {
        "type": "object",
        "description": "A knowledge sync job. List responses add run summaries; single reads add the full run list.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "ingestConfig": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Ingestion configuration; request headers are redacted."
          },
          "syncFrequency": {
            "type": "string"
          },
          "scanFrequency": {
            "type": [
              "string",
              "null"
            ]
          },
          "tenantId": {
            "type": [
              "string",
              "null"
            ]
          },
          "totalIngestJobRuns": {
            "type": [
              "integer",
              "null"
            ],
            "description": "List responses only."
          },
          "latestIngestJobRun": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/IngestJobRun"
              },
              {
                "type": "null"
              }
            ]
          },
          "ingestJobRuns": {
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/IngestJobRun"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Single-job reads only."
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "ChatbotIcon": {
        "type": "object",
        "description": "One chatbot icon slot and its current image.",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "settingsKey": {
            "type": "string"
          },
          "imageId": {
            "type": [
              "string",
              "null"
            ]
          },
          "imageUrl": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AccountQuotas": {
        "type": "object",
        "description": "Account-level quota ceilings.",
        "additionalProperties": true,
        "properties": {
          "chatbotsQuota": {
            "type": "integer"
          },
          "docsQuota": {
            "type": "integer"
          },
          "filesQuota": {
            "type": "integer"
          },
          "pagesQuota": {
            "type": "integer"
          },
          "maxFileSize": {
            "type": "integer",
            "description": "The largest file, in bytes, that any upload accepts (one limit for every plan)."
          },
          "combinedMessagesQuota": {
            "type": "integer"
          },
          "normalMessagesQuota": {
            "type": "integer",
            "description": "Derived; absent from the /api/v2/me variant."
          },
          "gpt4MessagesQuota": {
            "type": "integer",
            "description": "Derived; absent from the /api/v2/me variant."
          },
          "gpt4Share": {
            "type": "number"
          },
          "membersQuota": {
            "type": "integer"
          }
        }
      },
      "AccountUser": {
        "type": "object",
        "description": "The authenticated SiteGPT user.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "profilePicSrcId": {
            "type": [
              "string",
              "null"
            ],
            "description": "Absent from the /api/v2/me variant."
          },
          "globalRole": {
            "type": "string"
          },
          "brandId": {
            "type": "string"
          },
          "verified": {
            "type": "boolean"
          },
          "features": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Feature flags enabled for this account."
          },
          "quotas": {
            "$ref": "#/components/schemas/AccountQuotas"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BillingCustomer": {
        "type": "object",
        "description": "A Paddle billing customer linked to this account.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BillingSubscription": {
        "type": "object",
        "description": "A Paddle subscription as serialized for the agent API.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "collectionMode": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "startedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "firstBilledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "nextBilledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pausedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "canceledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "currentBillingPeriod": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenericObject",
                "description": "Current billing period start and end; null between periods."
              },
              {
                "type": "null"
              }
            ]
          },
          "billingCycle": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Billing interval and frequency."
          },
          "scheduledChange": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenericObject",
                "description": "Scheduled pause, cancel, or resume; null when nothing is scheduled."
              },
              {
                "type": "null"
              }
            ]
          },
          "managementUrls": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Paddle-hosted management URLs for this subscription."
          }
        }
      },
      "BillingProduct": {
        "type": "object",
        "description": "One active subscription line item.",
        "additionalProperties": true,
        "properties": {
          "productId": {
            "type": "string"
          },
          "pricingName": {
            "type": "string"
          },
          "interval": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "currencyCode": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "nextBilledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Invoice": {
        "type": "object",
        "description": "A billing transaction with its invoice download link.",
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "subscriptionStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "customerId": {
            "type": "string"
          },
          "subscriptionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "invoiceNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "currencyCode": {
            "type": "string"
          },
          "amount": {
            "type": [
              "string",
              "null"
            ]
          },
          "amountFormatted": {
            "type": [
              "string",
              "null"
            ]
          },
          "origin": {
            "type": "string"
          },
          "collectionMode": {
            "type": "string"
          },
          "billingPeriod": {
            "$ref": "#/components/schemas/GenericObject",
            "description": "Billing period start and end."
          },
          "billedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "downloadUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "PDF invoice download URL, when available."
          },
          "paymentMethod": {
            "type": [
              "string",
              "null"
            ]
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GenericObject",
              "description": "Purchased product line item."
            }
          }
        }
      }
    },
    "responses": {
      "AgentError": {
        "description": "SiteGPT agent API error response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentError"
            }
          }
        }
      },
      "AgentRateLimited": {
        "description": "Too many requests (RATE_LIMITED). Retry-After says when to try again.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before trying again.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/AgentError"
            }
          }
        }
      }
    }
  }
}