{
  "openapi": "3.0.4",
  "info": {
    "title": "SLAtech AI Platform API",
    "description": "The developer API of the SLAtech AI platform: ask questions against a\r\nsite's knowledge base, keep that knowledge base up to date, and read the\r\nsite's conversations, leads and usage numbers.\r\n\r\n**Base URL.** `https://api.slatech.ai` - every path below is relative to it.\r\n\r\n**Authentication.** Send a key in the `X-Api-Key` header. Keys are issued\r\nper site in the dashboard: app.slatech.ai -> API Keys. A key carries one\r\nor more scopes:\r\n\r\n* `query` - asking questions. This is the widget key; it is visible in\r\n  your site's page source, so treat it as public.\r\n* `ingest` - adding content to the knowledge base and removing it.\r\n* `data:read` - reading conversations, leads and analytics.\r\n\r\nEach operation states the key it needs, and carries the same as\r\n`x-slatech-scope`: `none`, `any` (any active key of the site), `ingest`\r\nor `data:read`. A missing or invalid key gets 401; a valid key without\r\nthe scope gets 403.\r\n\r\n**Errors.** Error responses are JSON with an `error` field, for example\r\n`{\"error\": \"Invalid API key\"}`. Request validation failures (400) add\r\n`details`, a list of `{\"field\": ..., \"message\": ...}`. A few responses\r\nhave no body or use the standard problem-details shape (`title`,\r\n`status`) instead; each operation says where.\r\n\r\n**Rate limits.** A request over a rate limit gets 429 with a\r\n`Retry-After` header in seconds. A 429 can also mean the plan's monthly\r\nquota is used up; that body carries `currentUsage` and `maxAllowed`\r\ninstead, and waiting a minute does not help.\r\n\r\n**Agents.** The same knowledge base is callable over the Model Context\r\nProtocol at `https://api.slatech.ai/mcp`. See the\r\n[MCP setup guide](https://www.slatech.ai/en/docs/mcp/).\r\n\r\n**Not listed here.** Endpoints that are not in this document are not part\r\nof the supported API and may change without notice.",
    "termsOfService": "https://www.slatech.ai/en/terms/",
    "contact": {
      "name": "SLAtech",
      "url": "https://www.slatech.ai/en/api-docs/",
      "email": "dev@slatech.ai"
    },
    "license": {
      "name": "Proprietary - SLAtech LTD",
      "url": "https://www.slatech.ai/en/terms/"
    },
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.slatech.ai"
    }
  ],
  "paths": {
    "/v1/query": {
      "post": {
        "tags": [
          "Ask"
        ],
        "summary": "Ask a question",
        "description": "Asks a question and returns the whole answer at once. The answer is grounded in the site's knowledge base; `sources` lists the passages it used.\n\nFor a follow-up question, send the earlier turns in `conversationHistory` (roles `user` and `assistant` only). `additionalSiteIds` searches other sites of the same account as well; a site whose monthly quota is used up is skipped. `topK` and `scoreThreshold` take effect only when the site allows clients to override its search settings. Every call counts toward the site's monthly question quota.\n\nThis response carries no id for the answer. To rate answers with PATCH /v1/query/{id}/feedback, use POST /v1/query/stream, whose first event carries it.\n\n**API key:** any active key of the site in the `X-Api-Key` header, the widget key included. No scope is checked.",
        "operationId": "ask",
        "requestBody": {
          "description": "Question, optional retrieval tuning parameters, and optional conversation history.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AskAnswerResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskAnswerResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskAnswerResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is invalid: `question` missing or over 2000 characters, `topK` outside 1-20, `scoreThreshold` outside 0-1, or a `conversationHistory` entry with another role or empty content. Field-level failures carry `details`.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing, invalid, expired or revoked.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "An id in `additionalSiteIds` is not a site of the key's account.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`), or the site's monthly question quota is used up (`currentUsage`, `maxAllowed`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          },
          "499": {
            "description": "The client closed the connection before the answer was ready. Recorded on the server only; a client that disconnected never receives it. No body."
          },
          "500": {
            "description": "Unexpected error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The assistant is temporarily unavailable (`reason`: `provider_unavailable`). Retry later.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "any"
      }
    },
    "/v1/query/{id}/feedback": {
      "patch": {
        "tags": [
          "Ask"
        ],
        "summary": "Rate an answer",
        "description": "Records whether an answer helped, and/or that the visitor opened one of its sources. Send `isHelpful` (true or false) and/or `sourceClicked: true`; a later rating overwrites an earlier one. Only answers given on the key's own site can be rated.\n\n**API key:** any active key of the site in the `X-Api-Key` header, the widget key included. No scope is checked.",
        "operationId": "rateAnswer",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The `queryLogId` from the `meta` event of POST /v1/query/stream.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFeedbackRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFeedbackRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetFeedbackRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Recorded. No body."
          },
          "400": {
            "description": "The body is not a JSON object of this shape.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing, invalid, expired or revoked.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No answer with this id on the key's site. The body is a standard problem-details object (`title`, `status`), not `{\"error\"}`.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "any"
      }
    },
    "/v1/query/ask-multimodal": {
      "get": {
        "tags": [
          "Ask"
        ],
        "summary": "Describe the image endpoint",
        "description": "Returns the form contract of POST /v1/query/ask-multimodal, so a client can check that the endpoint is available before uploading an image.\n\n**API key:** not required.",
        "operationId": "describeAskAboutImage",
        "responses": {
          "200": {
            "description": "The contract.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AskImageContractResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskImageContractResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskImageContractResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [ ],
        "x-slatech-scope": "none"
      },
      "post": {
        "tags": [
          "Ask"
        ],
        "summary": "Ask about an image",
        "description": "Answers a question about an uploaded image, sent as multipart/form-data. The answer is about the image itself: it is not grounded in the site's knowledge base and carries no sources. Counts toward the site's monthly question quota like POST /v1/query.\n\n**API key:** any active key of the site in the `X-Api-Key` header, the widget key included. No scope is checked.",
        "operationId": "askAboutImage",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "question": {
                    "type": "string",
                    "description": "The question, at most 2000 characters. Required."
                  },
                  "image": {
                    "type": "string",
                    "description": "The image: JPEG, PNG, WebP or GIF, at most 10 MB. Required.",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "question": {
                  "style": "form"
                },
                "image": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The answer.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/AskImageAnswerResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskImageAnswerResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskImageAnswerResponse"
                }
              }
            }
          },
          "400": {
            "description": "`question` missing or over 2000 characters, or `image` missing, empty, over 10 MB or not JPEG/PNG/WebP/GIF.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "415": {
            "description": "The body is not multipart/form-data. The body is a standard problem-details object (`title`, `status`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`), or the site's monthly question quota is used up (`currentUsage`, `maxAllowed`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          },
          "502": {
            "description": "The image could not be processed right now. Retry later.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "any"
      }
    },
    "/v1/query/stream": {
      "post": {
        "tags": [
          "Ask"
        ],
        "summary": "Ask a question, streamed",
        "description": "Asks a question and streams the answer as Server-Sent Events. Same request body, checks and quota as POST /v1/query.\n\nEach event is a `data:` line carrying JSON, in this order:\n\n1. `{\"type\":\"meta\",\"queryLogId\":\"...\"}` - always first. `queryLogId` is the id for PATCH /v1/query/{id}/feedback.\n2. `{\"type\":\"sources-early\",\"sources\":[{\"sourceUrl\",\"snippet\",\"title\"}]}` - optional, before the first text.\n3. `{\"text\":\"...\"}` - answer fragments, in order. Concatenate them.\n4. `{\"done\":true,\"hasSufficientContext\":...,\"escalateLead\":...,\"sources\":[...],\"department\":...,\"departmentId\":...}` - the last event with data, followed by `data: [DONE]`.\n\nIf the answer fails after the stream has opened, the status stays 200 and the stream ends with `{\"type\":\"error\",\"reason\":\"provider_unavailable\"}` (or `stream_error`) followed by `data: [DONE]`.\n\n**API key:** any active key of the site in the `X-Api-Key` header, the widget key included. No scope is checked.",
        "operationId": "askStream",
        "requestBody": {
          "description": "Question, optional retrieval tuning parameters, and optional conversation history.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The event stream (`text/event-stream`), described above.",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "The body is invalid: `question` missing or over 2000 characters, `topK` outside 1-20, `scoreThreshold` outside 0-1, or a `conversationHistory` entry with another role or empty content. Field-level failures carry `details`.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing, invalid, expired or revoked.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "An id in `additionalSiteIds` is not a site of the key's account.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`), or the site's monthly question quota is used up (`currentUsage`, `maxAllowed`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error before the stream opened (`reason`: `stream_error`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              }
            }
          },
          "503": {
            "description": "The assistant is temporarily unavailable and the stream had not opened yet (`reason`: `provider_unavailable`). Retry later.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiUnavailableResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "any"
      }
    },
    "/v1/documents/{documentId}": {
      "delete": {
        "tags": [
          "Knowledge base"
        ],
        "summary": "Delete a document",
        "description": "Deletes a document of the key's site and everything indexed from it, so answers stop using it. To delete text you sent with a `sourceUrl`, DELETE /v1/ingest/document?sourceUrl= is usually simpler: it needs no document id.\n\n**API key:** a key with the `ingest` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "deleteDocument",
        "parameters": [
          {
            "name": "documentId",
            "in": "path",
            "description": "Id of the document.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted. No body."
          },
          "401": {
            "description": "`X-Api-Key` is missing, invalid, expired or revoked.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the `ingest` scope.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such document on the key's site.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "ingest"
      }
    },
    "/v1/ingest/document": {
      "delete": {
        "tags": [
          "Knowledge base"
        ],
        "summary": "Delete a document by source URL",
        "description": "Deletes the document that text sent with this `sourceUrl` was written to (see POST /v1/ingest/text), and withdraws queued text jobs for it. Deleting what is not there is not an error: the response says `deleted: 0`, so a sync can safely retry.\n\n**API key:** a key with the `ingest` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "deleteDocumentBySourceUrl",
        "parameters": [
          {
            "name": "sourceUrl",
            "in": "query",
            "description": "The `sourceUrl` the text was sent with: an absolute http(s) URL of at most 2000 characters.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "How many documents were deleted.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IngestDeleteResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestDeleteResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestDeleteResponse"
                }
              }
            }
          },
          "400": {
            "description": "`sourceUrl` missing, not an absolute http(s) URL, or over 2000 characters.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the `ingest` scope.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "ingest"
      }
    },
    "/v1/ingest/file": {
      "post": {
        "tags": [
          "Knowledge base"
        ],
        "summary": "Upload a file",
        "description": "Adds a document to the knowledge base from a file: PDF, DOCX, TXT or MD, at most 10 MB, sent as the multipart/form-data field `file`. Processing runs in the background: poll GET /v1/ingest/jobs/{jobId}. Each call counts toward the site's monthly ingestion quota.\n\n**API key:** a key with the `ingest` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "ingestFile",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "The file: PDF, DOCX, TXT or MD, at most 10 MB.",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "file": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. `status` is the word `Pending` here, unlike the other ingest operations.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IngestFileAcceptedResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestFileAcceptedResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestFileAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "`file` missing or empty, or not PDF/DOCX/TXT/MD.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the `ingest` scope.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "413": {
            "description": "The upload is over the size limit (10 MB per file).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`), or the site's monthly ingestion quota is used up (`currentUsage`, `maxAllowed`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "ingest"
      }
    },
    "/v1/ingest/jobs/{jobId}": {
      "get": {
        "tags": [
          "Knowledge base"
        ],
        "summary": "Get an ingestion job",
        "description": "Returns the state of an ingestion job of the key's site. `status`: 0 Pending, 1 Processing, 2 Completed, 3 Failed, 4 Cancelled. When a job failed, `errorCode` and `errorMessage` say why.\n\n**API key:** a key with the `ingest` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "getIngestionJob",
        "parameters": [
          {
            "name": "jobId",
            "in": "path",
            "description": "The `jobId` returned when the job was submitted.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The job.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobStatusResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the `ingest` scope.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No such job on the key's site.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "ingest"
      }
    },
    "/v1/ingest/sitemap": {
      "post": {
        "tags": [
          "Knowledge base"
        ],
        "summary": "Crawl a sitemap",
        "description": "Queues a crawl of every page listed in a sitemap XML. `sitemapUrl` must be an absolute http(s) URL on a public host. Processing runs in the background: poll GET /v1/ingest/jobs/{jobId}. Each call counts toward the site's monthly ingestion quota.\n\n**API key:** a key with the `ingest` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "ingestSitemap",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestSitemapRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestSitemapRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IngestSitemapRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. `status` is 0 (Pending).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "`sitemapUrl` missing, over 2048 characters, not an absolute http(s) URL, or not on a public host.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the `ingest` scope.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`), or the site's monthly ingestion quota is used up (`currentUsage`, `maxAllowed`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "ingest"
      }
    },
    "/v1/ingest/text": {
      "post": {
        "tags": [
          "Knowledge base"
        ],
        "summary": "Add text",
        "description": "Adds raw text (at most 500,000 characters) to the knowledge base. `sourceUrl` names the document the text is written to: text sent again with the same `sourceUrl` updates that one document, and DELETE /v1/ingest/document?sourceUrl= removes it. It is shown to visitors as the source link, so it must be an absolute http(s) URL. Text sent without `sourceUrl` all goes to one shared document of the site. Processing runs in the background: poll GET /v1/ingest/jobs/{jobId}. Each call counts toward the site's monthly ingestion quota.\n\n**API key:** a key with the `ingest` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "ingestText",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestTextRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestTextRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IngestTextRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. `status` is 0 (Pending).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "`text` missing or over 500,000 characters, or `sourceUrl` not an absolute http(s) URL of at most 2000 characters.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the `ingest` scope.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`), or the site's monthly ingestion quota is used up (`currentUsage`, `maxAllowed`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "ingest"
      }
    },
    "/v1/ingest/url": {
      "post": {
        "tags": [
          "Knowledge base"
        ],
        "summary": "Add a web page",
        "description": "Queues the fetch of one web page into the knowledge base. `url` must be an absolute http(s) URL on a public host. Processing runs in the background: poll GET /v1/ingest/jobs/{jobId}. Each call counts toward the site's monthly ingestion quota.\n\n**API key:** a key with the `ingest` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "ingestUrl",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestUrlRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestUrlRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/IngestUrlRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted. `status` is 0 (Pending).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestJobAcceptedResponse"
                }
              }
            }
          },
          "400": {
            "description": "`url` missing, over 2048 characters, not an absolute http(s) URL, or not on a public host.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiValidationErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The key does not have the `ingest` scope.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`), or the site's monthly ingestion quota is used up (`currentUsage`, `maxAllowed`).",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "ingest"
      }
    },
    "/v1/zapier/conversations": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "List recent conversations",
        "description": "The site's most recent answered questions asked at or after `since`, newest first, at most 50. For polling: pass the time of the previous poll. Use `sessionId` with GET /v1/zapier/conversations/{sessionId} for a whole session.\n\nRequires the Zapier integration on the site's plan.\n\n**API key:** a key with the `data:read` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "listConversations",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "UTC date-time (ISO 8601). Only questions asked at or after it. Default: one hour ago.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DataConversationTurn"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`since` is not a valid date-time. No body."
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the Zapier integration (`error`: `feature_disabled`), or the key does not have the `data:read` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiForbiddenResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "data:read"
      }
    },
    "/v1/zapier/conversations/{sessionId}": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "Get a conversation",
        "description": "Every question and answer of one chat session of the site, oldest first. A session the site does not have gives an empty list, not 404.\n\nRequires the Zapier integration on the site's plan.\n\n**API key:** a key with the `data:read` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "getConversation",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "description": "The `sessionId` from GET /v1/zapier/conversations.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DataSessionMessage"
                  }
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the Zapier integration (`error`: `feature_disabled`), or the key does not have the `data:read` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiForbiddenResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "data:read"
      }
    },
    "/v1/zapier/leads": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "List recent leads",
        "description": "The site's most recent leads captured at or after `since`, newest first, at most 50. For polling: pass the time of the previous poll.\n\nRequires the Zapier integration on the site's plan.\n\n**API key:** a key with the `data:read` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "listLeads",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "description": "UTC date-time (ISO 8601). Only leads captured at or after it. Default: one hour ago.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DataLead"
                  }
                }
              }
            }
          },
          "400": {
            "description": "`since` is not a valid date-time. No body."
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the Zapier integration (`error`: `feature_disabled`), or the key does not have the `data:read` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiForbiddenResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "data:read"
      }
    },
    "/v1/zapier/test": {
      "get": {
        "tags": [
          "Data"
        ],
        "summary": "Check a key",
        "description": "Confirms that the key works and names its site. Meant for the connection step of an automation platform.\n\nRequires the Zapier integration on the site's plan.\n\n**API key:** a key with the `data:read` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "testConnection",
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataConnectionTestResponse"
                }
              }
            }
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "The plan does not include the Zapier integration (`error`: `feature_disabled`), or the key does not have the `data:read` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiForbiddenResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "data:read"
      }
    },
    "/v1/embed/analytics/quality-trend": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Answer quality per day",
        "description": "Average confidence and factuality scores of the answers given on each day of the last `days` days, today included. Days without scored answers are present with null scores and `samples: 0`.\n\nAggregates only: no question text, no visitor details. Responses carry CORS headers so a browser dashboard can call this directly; when the site has allowed origins configured, only those origins may read it.\n\n**API key:** a key with the `data:read` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "getQualityTrend",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "Window length in days, today included: 1-90, values outside are clamped. Default 30.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsQualityTrendResponse"
                }
              }
            }
          },
          "400": {
            "description": "`days` is not an integer. No body."
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid. No body."
          },
          "403": {
            "description": "The key does not have the `data:read` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "data:read"
      }
    },
    "/v1/embed/analytics/queries-by-day": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Questions per day",
        "description": "Questions asked and resolved on each day of the last `days` days, today included. Days without questions are present with zeros.\n\nAggregates only: no question text, no visitor details. Responses carry CORS headers so a browser dashboard can call this directly; when the site has allowed origins configured, only those origins may read it.\n\n**API key:** a key with the `data:read` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "getQuestionsByDay",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "Window length in days, today included: 1-90, values outside are clamped. Default 30.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsByDayResponse"
                }
              }
            }
          },
          "400": {
            "description": "`days` is not an integer. No body."
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid. No body."
          },
          "403": {
            "description": "The key does not have the `data:read` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "data:read"
      }
    },
    "/v1/embed/analytics/queries-summary": {
      "get": {
        "tags": [
          "Analytics"
        ],
        "summary": "Usage totals",
        "description": "Totals for the last `days` days, today included: questions asked, how many were resolved, the resolution rate, the average answer confidence score, and the five most frequent `utm_source` values of the pages questions were asked on (returned as `topIntents`).\n\nAggregates only: no question text, no visitor details. Responses carry CORS headers so a browser dashboard can call this directly; when the site has allowed origins configured, only those origins may read it.\n\n**API key:** a key with the `data:read` scope in the `X-Api-Key` header. A valid key without that scope gets 403.",
        "operationId": "getUsageSummary",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "description": "Window length in days, today included: 1-90, values outside are clamped. Default 30.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "`days` is not an integer. No body."
          },
          "401": {
            "description": "`X-Api-Key` is missing or invalid. No body."
          },
          "403": {
            "description": "The key does not have the `data:read` scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the rate limit (with `Retry-After`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTooManyRequestsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": [ ]
          }
        ],
        "x-slatech-scope": "data:read"
      }
    }
  },
  "components": {
    "schemas": {
      "AnalyticsByDayResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "First day of the window, `yyyy-MM-dd` (UTC).",
            "nullable": true
          },
          "to": {
            "type": "string",
            "description": "Last day of the window, `yyyy-MM-dd` (UTC).",
            "nullable": true
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsDayCount"
            },
            "description": "One entry per day, days without questions included.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Questions per day."
      },
      "AnalyticsDayCount": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The day, `yyyy-MM-dd` (UTC).",
            "nullable": true
          },
          "count": {
            "type": "integer",
            "description": "Questions asked.",
            "format": "int32"
          },
          "resolved": {
            "type": "integer",
            "description": "Of those, how many were judged resolved.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Questions on one day."
      },
      "AnalyticsDayQuality": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The day, `yyyy-MM-dd` (UTC).",
            "nullable": true
          },
          "avgConfidence": {
            "type": "number",
            "description": "Average confidence score, one decimal; null on a day without scores.",
            "format": "double",
            "nullable": true
          },
          "avgFactuality": {
            "type": "number",
            "description": "Average factuality score, one decimal; null on a day without scores.",
            "format": "double",
            "nullable": true
          },
          "samples": {
            "type": "integer",
            "description": "Answers scored that day.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Answer quality on one day."
      },
      "AnalyticsQualityTrendResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "First day of the window, `yyyy-MM-dd` (UTC).",
            "nullable": true
          },
          "to": {
            "type": "string",
            "description": "Last day of the window, `yyyy-MM-dd` (UTC).",
            "nullable": true
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsDayQuality"
            },
            "description": "One entry per day, days without scores included.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Answer quality per day."
      },
      "AnalyticsSummaryResponse": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "description": "First day of the window, `yyyy-MM-dd` (UTC).",
            "nullable": true
          },
          "to": {
            "type": "string",
            "description": "Last day of the window, `yyyy-MM-dd` (UTC, today).",
            "nullable": true
          },
          "totalQueries": {
            "type": "integer",
            "description": "Questions asked in the window.",
            "format": "int32"
          },
          "resolved": {
            "type": "integer",
            "description": "Of those, how many were judged resolved.",
            "format": "int32"
          },
          "resolutionRate": {
            "type": "number",
            "description": "Resolved share in percent, one decimal; 0 when there were no questions.",
            "format": "double"
          },
          "avgConfidence": {
            "type": "number",
            "description": "Average answer confidence score in the window, one decimal; 0 when there are no scores.",
            "format": "double"
          },
          "topIntents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsTopIntent"
            },
            "description": "Up to five most frequent `utm_source` values of the pages questions were asked on.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Totals for the window."
      },
      "AnalyticsTopIntent": {
        "type": "object",
        "properties": {
          "intent": {
            "type": "string",
            "description": "The `utm_source` value.",
            "nullable": true
          },
          "count": {
            "type": "integer",
            "description": "Questions asked with it.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "One `utm_source` value and its question count."
      },
      "ApiErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, in English.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An error. Most error responses have this shape."
      },
      "ApiForbiddenResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "`\"feature_disabled\"`, or the missing scope.",
            "nullable": true
          },
          "feature": {
            "type": "string",
            "description": "The plan feature that is not enabled. Present only with `feature_disabled`.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "Explanation. Present only with `feature_disabled`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A 403 from a Data operation. When the plan does not include the integration:\r\n`error` is `\"feature_disabled\"` and `feature`/`message` explain.\r\nWhen the key lacks the scope: `error` alone."
      },
      "ApiTooManyRequestsResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Why the request was refused.",
            "nullable": true
          },
          "retryAfterSeconds": {
            "type": "integer",
            "description": "Seconds to wait. Present on rate-limit refusals from the per-route limiter.",
            "format": "int32",
            "nullable": true
          },
          "currentUsage": {
            "type": "integer",
            "description": "Requests counted this month. Present on quota refusals.",
            "format": "int32",
            "nullable": true
          },
          "maxAllowed": {
            "type": "integer",
            "description": "The plan's monthly allowance. Present on quota refusals.",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A 429. Over a rate limit: `error` is `\"rate_limited\"` (or a sentence) and\r\n`retryAfterSeconds` repeats the `Retry-After` header. Over the plan's\r\nmonthly quota: `error` says so and `currentUsage`/`maxAllowed` give\r\nthe numbers."
      },
      "ApiUnavailableResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable explanation.",
            "nullable": true
          },
          "reason": {
            "type": "string",
            "description": "Machine-readable reason, `\"provider_unavailable\"`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A 503: the assistant cannot answer right now. Retry later."
      },
      "ApiValidationErrorDetail": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "The field, as named in the request.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "What is wrong with it.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One invalid field of a request."
      },
      "ApiValidationErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "\"Validation failed\", or the reason the request was refused.",
            "nullable": true
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiValidationErrorDetail"
            },
            "description": "One entry per invalid field. Present only for validation failures.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A 400. `details` is present only when request validation failed (field-level\r\nproblems); other 400s carry `error` alone."
      },
      "AskAnswerResponse": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string",
            "description": "The answer text.",
            "nullable": true
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuerySource"
            },
            "description": "The knowledge-base passages the answer was grounded in.",
            "nullable": true
          },
          "hasSufficientContext": {
            "type": "boolean",
            "description": "False when the knowledge base held nothing relevant; the answer is then a fallback message and `sources` is empty."
          },
          "escalateLead": {
            "type": "boolean",
            "description": "True when the question showed buying intent the answer did not resolve: a cue to offer a contact form."
          },
          "latencyMs": {
            "type": "integer",
            "description": "Server-side processing time in milliseconds.",
            "format": "int32"
          },
          "department": {
            "type": "string",
            "description": "The department the question was routed to, when department routing is set up; otherwise null.",
            "nullable": true
          },
          "departmentId": {
            "type": "string",
            "description": "Id of that department; otherwise null.",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An answer."
      },
      "AskImageAnswerResponse": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string",
            "description": "The answer text.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An answer about an image."
      },
      "AskImageContractField": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Field name.",
            "nullable": true
          },
          "type": {
            "type": "string",
            "description": "`\"string\"` or `\"file\"`.",
            "nullable": true
          },
          "required": {
            "type": "boolean",
            "description": "Whether the field must be sent."
          },
          "description": {
            "type": "string",
            "description": "Constraints, where there are any.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One form field of the image endpoint."
      },
      "AskImageContractResponse": {
        "type": "object",
        "properties": {
          "supported": {
            "type": "boolean",
            "description": "Always true."
          },
          "method": {
            "type": "string",
            "description": "`\"POST\"`.",
            "nullable": true
          },
          "contentType": {
            "type": "string",
            "description": "`\"multipart/form-data\"`.",
            "nullable": true
          },
          "auth": {
            "type": "string",
            "description": "`\"X-Api-Key header\"`.",
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AskImageContractField"
            },
            "description": "The form fields.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The contract the image endpoint accepts."
      },
      "AskRequest": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "description": "The question, at most 2000 characters. Required.",
            "nullable": true
          },
          "topK": {
            "type": "integer",
            "description": "How many knowledge-base passages to retrieve, 1-20. Used only when the site allows clients to override its search settings.",
            "format": "int32"
          },
          "scoreThreshold": {
            "type": "number",
            "description": "Minimum relevance of a retrieved passage, 0-1. Used only when the site allows clients to override its search settings.",
            "format": "float"
          },
          "pageUrl": {
            "type": "string",
            "description": "The page the visitor is on, at most 2048 characters. Recorded with the conversation.",
            "nullable": true
          },
          "visitorId": {
            "type": "string",
            "description": "Your identifier for the visitor, at most 100 characters. Recorded with the conversation.",
            "nullable": true
          },
          "conversationHistory": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessageDto"
            },
            "description": "Earlier turns of this conversation, oldest first, for follow-up questions.",
            "nullable": true
          },
          "sessionId": {
            "type": "string",
            "description": "Your identifier for the chat session, at most 100 characters. Groups questions into one conversation.",
            "nullable": true
          },
          "additionalSiteIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Other sites of the same account whose knowledge bases are searched as well.",
            "nullable": true
          },
          "utmSource": {
            "type": "string",
            "description": "utm_source of the page, recorded with the conversation.",
            "nullable": true
          },
          "utmMedium": {
            "type": "string",
            "description": "utm_medium of the page, recorded with the conversation.",
            "nullable": true
          },
          "utmCampaign": {
            "type": "string",
            "description": "utm_campaign of the page, recorded with the conversation.",
            "nullable": true
          },
          "attachmentIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Files the visitor uploaded earlier in this session through the chat widget; their text is taken into account for this question. At most 5 are used.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A question."
      },
      "ConversationMessageDto": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "description": "`user` or `assistant`.",
            "nullable": true
          },
          "content": {
            "type": "string",
            "description": "The text of the turn, at most 4000 characters.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One earlier turn of the conversation."
      },
      "DataConnectionTestResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "description": "Always true."
          },
          "siteId": {
            "type": "string",
            "description": "The key's site.",
            "format": "uuid"
          },
          "siteName": {
            "type": "string",
            "description": "Site name, else its domain, else `\"(unknown)\"`.",
            "nullable": true
          },
          "siteDomain": {
            "type": "string",
            "description": "Site domain.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The site a key belongs to."
      },
      "DataConversationTurn": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id of this question and answer.",
            "format": "uuid"
          },
          "sessionId": {
            "type": "string",
            "description": "The chat session it belongs to; pass to GET /v1/zapier/conversations/{sessionId}.",
            "nullable": true
          },
          "question": {
            "type": "string",
            "description": "The visitor's question.",
            "nullable": true
          },
          "answer": {
            "type": "string",
            "description": "The answer given.",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "When it was asked (UTC).",
            "format": "date-time"
          },
          "wasResolved": {
            "type": "boolean",
            "description": "Whether the answer was judged to resolve the question."
          },
          "sourceClicked": {
            "type": "boolean",
            "description": "Whether the visitor opened a cited source; null when not recorded.",
            "nullable": true
          },
          "userCountry": {
            "type": "string",
            "description": "Visitor's country, when known.",
            "nullable": true
          },
          "pageUrl": {
            "type": "string",
            "description": "Page the question was asked on, when known.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One answered question."
      },
      "DataLead": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Lead id.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Name, when given.",
            "nullable": true
          },
          "email": {
            "type": "string",
            "description": "Email address.",
            "nullable": true
          },
          "phone": {
            "type": "string",
            "description": "Phone number, when given.",
            "nullable": true
          },
          "message": {
            "type": "string",
            "description": "The visitor's message, else their question.",
            "nullable": true
          },
          "vertical": {
            "type": "string",
            "description": "Industry vertical of the site, when set.",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "When the lead was captured (UTC).",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "description": "`\"Pending\"`, `\"Approved\"` or `\"Rejected\"`.",
            "nullable": true
          },
          "pageUrl": {
            "type": "string",
            "description": "Page the lead was captured on, when known.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One lead."
      },
      "DataSessionMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Id of this question and answer.",
            "format": "uuid"
          },
          "question": {
            "type": "string",
            "description": "The visitor's question.",
            "nullable": true
          },
          "answer": {
            "type": "string",
            "description": "The answer given.",
            "nullable": true
          },
          "timestamp": {
            "type": "string",
            "description": "When it was asked (UTC).",
            "format": "date-time"
          },
          "wasResolved": {
            "type": "boolean",
            "description": "Whether the answer was judged to resolve the question."
          }
        },
        "additionalProperties": false,
        "description": "One message of a session."
      },
      "IngestDeleteResponse": {
        "type": "object",
        "properties": {
          "deleted": {
            "type": "integer",
            "description": "Documents deleted; 0 when there was nothing to delete.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Result of a delete by source URL."
      },
      "IngestFileAcceptedResponse": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Id to poll with GET /v1/ingest/jobs/{jobId}.",
            "format": "uuid"
          },
          "fileId": {
            "type": "string",
            "description": "Id of the stored file.",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "description": "Always `\"Pending\"`.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "An accepted file. Unlike the other ingest operations, `status` here is the word `\"Pending\"`, not a number."
      },
      "IngestJobAcceptedResponse": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "Id to poll with GET /v1/ingest/jobs/{jobId}.",
            "format": "uuid"
          },
          "status": {
            "type": "integer",
            "description": "0 Pending, 1 Processing, 2 Completed, 3 Failed, 4 Cancelled.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "An accepted ingestion job. `status` is the job status as a number: 0 Pending, 1 Processing, 2 Completed, 3 Failed, 4 Cancelled - a new job is 0."
      },
      "IngestJobStatusResponse": {
        "type": "object",
        "properties": {
          "jobId": {
            "type": "string",
            "description": "The job id.",
            "format": "uuid"
          },
          "status": {
            "type": "integer",
            "description": "0 Pending, 1 Processing, 2 Completed, 3 Failed, 4 Cancelled.",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "description": "When the job was submitted (UTC).",
            "format": "date-time"
          },
          "startedAt": {
            "type": "string",
            "description": "When processing started (UTC); null until then.",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "type": "string",
            "description": "When processing ended (UTC); null until then.",
            "format": "date-time",
            "nullable": true
          },
          "errorCode": {
            "type": "string",
            "description": "Short machine-readable failure code; null unless the job failed.",
            "nullable": true
          },
          "errorMessage": {
            "type": "string",
            "description": "Failure explanation; null unless the job failed.",
            "nullable": true
          },
          "retryCount": {
            "type": "integer",
            "description": "How many times processing has been retried.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "An ingestion job."
      },
      "IngestSitemapRequest": {
        "type": "object",
        "properties": {
          "sitemapUrl": {
            "type": "string",
            "description": "Absolute http(s) URL of the sitemap XML on a public host, at most 2048 characters.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A sitemap to crawl."
      },
      "IngestTextRequest": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "description": "The text, at most 500,000 characters.",
            "nullable": true
          },
          "sourceUrl": {
            "type": "string",
            "description": "Optional. Names the document the text is written to and is shown to visitors as the source link: an absolute http(s) URL of at most 2000 characters.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Text to add."
      },
      "IngestUrlRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Absolute http(s) URL of the page on a public host, at most 2048 characters.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A web page to add."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "QuerySource": {
        "type": "object",
        "properties": {
          "chunkId": {
            "type": "string",
            "description": "Id of the passage.",
            "format": "uuid"
          },
          "sourceUrl": {
            "type": "string",
            "description": "URL of the page or document the passage comes from.",
            "nullable": true
          },
          "score": {
            "type": "number",
            "description": "Relevance of the passage to the question; higher is more relevant.",
            "format": "float"
          },
          "chunkIndex": {
            "type": "integer",
            "description": "Zero-based position of the passage within its document.",
            "format": "int32"
          },
          "snippet": {
            "type": "string",
            "description": "The start of the passage, about 200 characters on one line, for showing under the\r\nsource link. Can be empty.",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "The title of the source page. Can be empty, for example for an uploaded file; label\r\nthe link from the URL then.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A knowledge-base passage an answer was grounded in."
      },
      "SetFeedbackRequest": {
        "type": "object",
        "properties": {
          "isHelpful": {
            "type": "boolean",
            "description": "True if the answer helped, false if not. Omit to leave the rating unchanged.",
            "nullable": true
          },
          "sourceClicked": {
            "type": "boolean",
            "description": "True when the visitor opened one of the answer's sources.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "A rating of one answer."
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "Per-site API key, issued in the dashboard: app.slatech.ai -> API Keys. Scopes: query, ingest, data:read.",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "Ask",
      "description": "Ask a question against the site's knowledge base and get an answer with its sources."
    },
    {
      "name": "Knowledge base",
      "description": "Add content to the knowledge base, follow the job that processes it, and remove it."
    },
    {
      "name": "Data",
      "description": "Read the site's conversations and leads, for example from an automation platform. Requires the Zapier integration on the plan."
    },
    {
      "name": "Analytics",
      "description": "Aggregate usage numbers for dashboards: no question text, no visitor details."
    }
  ]
}