Skip to main content
These rules apply to every endpoint in SiteGPT API v2.

Base URL

  • Send and receive JSON. Set Content-Type: application/json on requests with a body.
  • Send your API token in the Authorization: Bearer header. See API v2 authentication.
  • GET /api/v2/health needs no token. Use it to check that the API is reachable.
  • The OpenAPI document is at https://sitegpt.ai/api/v2/openapi.json.

Response envelope

Every response uses the same envelope. Success:
Error:
The OpenAPI error schema does not list error.hint, but the API sends it. Allow extra fields in your error parser.

Pagination

List endpoints that can return many items use cursor pagination. The response has the cursor in two places:
  • meta.nextCursor
  • data.pagination, which has limit, hasNextPage, and nextCursor
nextCursor is null on the last page. A page can have fewer items than limit, or no items, and still have a nextCursor. This happens when a filter matches few items. Keep reading until nextCursor is null.
These endpoints use cursor pagination: A limit outside the allowed range returns 400 VALIDATION_FAILED. On GET /chatbots, a cursor that the API did not issue returns 400 INVALID_CURSOR. Start again without a cursor. GET /chatbots lists the chatbots that you were added to most recently first. For chatbots that you own, this is the order in which you created them, newest first.

Errors

The HTTP status tells you the kind of error. error.code tells you the exact cause. A 401 response includes a WWW-Authenticate header that points to the OAuth metadata at https://sitegpt.ai/.well-known/oauth-protected-resource/api/v2. Some errors come with a hint. For example, CHATBOT_LIMIT_REACHED and CHATBOT_PAGES_LIMIT_REACHED suggest how to free space or where to see plans.

Errors from content operations

API v2 answers with the real status when SiteGPT refuses a request. This matters most for endpoints that read or change your content (documents, links, files, and connected sources): Only documents of type TEXT and FILE can be edited with PATCH /chatbots/{chatbotId}/documents/{documentId}. A URL document mirrors its web page, and a resync would replace an edit. Editing a document of another type, for example a URL document or a document from a connected app, returns 400 DOCUMENT_TYPE_NOT_SUPPORTED with the message “Only text and file documents can be edited. This document comes from a web page or a connected app, and a resync would replace any edit.” The hint tells you to change the document where it lives, the web page or the connected app, and then resync it with POST /chatbots/{chatbotId}/documents/resync. The dashboard cannot change the content of a link either. Every URL that you add as content (a website, a sitemap, links, or a YouTube video) must be a public http or https address. SiteGPT refuses localhost, private and local network addresses, names that end in .internal or .local, and names such as nip.io that point to an address written in the name. The request fails with 400 URL_NOT_PUBLIC, and the message names the URL: “URLs must be public http(s) addresses; internal, local and private addresses are not allowed: ” and the URL. A list of links with one such URL is refused whole, and nothing is added. A 500 INTERNAL_SERVER_ERROR from these endpoints means that SiteGPT failed on its side. Send the meta.requestId to support.

HIPAA workspaces

For a chatbot in a HIPAA workspace, the API does not give out or change conversations, messages, or leads. It also does not take files or text, does not read or change one document, and does not read sync jobs. This applies to every caller: your own API tokens, the CLI, the SDKs, MCP, and SiteGPT iPhone app versions before 1.0.8. Use the SiteGPT dashboard for conversations, leads, files, and text. From version 1.0.8, the iPhone app does not use the API for conversations and leads, and works with these chatbots. See iPhone app in HIPAA workspaces. Visitors still chat in the chat widget. A refused request returns one of these errors:
  • You get these errors only for a chatbot that your token can access. For another chatbot, the API returns 404 CHATBOT_NOT_FOUND, as for any chatbot.
  • The remote MCP server, the local MCP server (sitegpt mcp) of CLI 0.6.0 or later, and CLI versions before 0.6.0 that signed in with sitegpt login get 403 HIPAA_AI_ASSISTANTS_DISABLED for conversations and leads instead. See MCP server.
  • API v0 refuses the same way, with the same status, code, and message in the v0 error shape, on these endpoints: GET and POST /v0/chatbots/{chatbotId}/threads, GET and PATCH /v0/chatbots/{chatbotId}/threads/{threadId}, POST /v0/chatbots/{chatbotId}/threads/{threadId}/escalate, POST /v0/chatbots/{chatbotId}/message, and PATCH /v0/chatbots/{chatbotId}/messages/{messageId}.

Message sources

Each AI answer has a sources list, for example in POST /chatbots/{chatbotId}/messages and in the messages of a conversation. It lists the web pages that the answer used, best match first, each one time:
  • A page that the answer links.
  • A page whose text holds a link that the answer gives, for example a page that links to a form that the answer links. Each such link counts for one page only.
  • Pages that the search found but the answer did not use are left out. An answer that links none of the pages that the search found has an empty list, and so does an answer with your fallback message. With Hide Sources on, SiteGPT does not ask the AI to link pages, so the list is usually empty.
  • Answers from before November 16, 2026, list every page that the search found for the question, one entry for each matching passage. In these older answers, an answer sent through the API or a chat channel can have an empty string ("") for a passage from a file or text.
An AI answer can also have sourceFiles: the names of the files (uploads and documents from connected apps) that matched the question closely, best match first, each one time. See Sources of an answer for how close. The field is left out when no file matched closely, and for an answer with your fallback message. It is for your team only. SiteGPT does not give the AI the names of files, and the chat widget never shows file names to visitors, so do not show sourceFiles to visitors. It gives no link to the file. Messages that are not AI answers, such as replies from your team and system messages, have an empty list.

Conversation state conflicts

A conversation can be resolved (closed), or a person on your team can take it over. The API checks these states at the moment it saves your change. If the state changes while your request runs, the new state wins. See Conversations and handoff. In the take-over and release responses, message is the notice that the visitor sees when this request posted it, and null otherwise. Take-over requests that arrive at the same moment add one notice to the conversation, and only one of them gets tookOver as true. The same holds for release requests and switched. The OpenAPI document marks each operation that can return 409. This includes POST /chatbots/{chatbotId}/messages and POST /chatbots/{chatbotId}/conversations, which start a new conversation, and the member, persona, instruction, tag, and transfer operations that can return it.

Deletes need confirmation

Delete endpoints that remove account or chatbot data need confirm=true in the query string. The endpoint pages show a confirm parameter where it applies. Example:
Without it, the API returns 400 CONFIRMATION_REQUIRED and deletes nothing. Bulk deletes also need confirmation. Send "confirm": true in the request body of POST /chatbots/{chatbotId}/documents/delete, and with the delete action of POST /chatbots/{chatbotId}/conversations/bulk and POST /chatbots/{chatbotId}/leads/actions. The documents endpoint also accepts confirm=true in the query string.

Settings updates

PATCH /chatbots/{chatbotId}/settings/{section} and PATCH /chatbots/{chatbotId}/settings change only the fields that you send. You can read a section with GET, change one field, and send the whole section back. A field that you send back with the value that GET returned is never refused. The OpenAPI document lists the fields of each section. SettingsGeneral, SettingsAppearance, SettingsChatMode, and the other Settings schemas give what a PATCH accepts: the field names, types, allowed values, and ranges. SettingsGeneralRead and the other Read schemas give what GET returns, including the fields that you can only read. The settings object of a chatbot, for example in GET /chatbots/{chatbotId}, is a summary with only some settings. Read every setting with GET /chatbots/{chatbotId}/settings or GET /chatbots/{chatbotId}/settings/{section}.
  • Settings that the plan does not include. Some settings need the plan or an add-on of the chatbot owner: the message limit per conversation (rateLimits in general), the watermark fields (hideWatermark, watermarkText, watermarkLink in appearance), and the call to action button (ctaText, ctaLink in appearance). When the owner does not have one, GET shows it off or as null. If you send it back as GET showed it, the saved value stays. If you change it, the request fails with 403 and the reason:
  • Fields that you can only read. GET returns some fields that a request cannot set: collectUserData in user-data and lead-form, webhookTokenConfigured, escalationWebhookTokenConfigured, and leadsWebhookTokenConfigured in webhooks, and currentMode and visitorsAsked in chat-mode. SiteGPT never saves them. When you send one with a value other than the one GET returned, meta.warnings says so, for example “webhooks.webhookTokenConfigured is returned for reading only, so the value sent was not saved. Send webhookToken to change it.”
  • Settings that read what runs. Some fields return the value that the chatbot uses, not only the saved value. In general, emailConversationToVisitor reads false for a chatbot in a HIPAA workspace or on an account with a custom retention agreement, also when it was saved as true. In appearance, distanceFromBottom, horizontalDistance, fontSize, and height return the number that the widget uses: a saved 0 reads as the default. distanceFromBottomInMobile and horizontalDistanceInMobile are null while they follow the desktop distance. When you send these values back as GET returned them, the widget keeps what it uses.
  • Emailing conversations in HIPAA workspaces and on custom retention. A request that sets emailConversationToVisitor to true for a chatbot in a HIPAA workspace fails with 403 HIPAA_CONVERSATION_EMAIL_DISABLED and “Visitors cannot email conversations in a HIPAA workspace, so this setting cannot be turned on.” On an account with a custom retention agreement, it fails with 403 RETENTION_CONVERSATION_EMAIL_DISABLED and “Visitors cannot email conversations while your account deletes them on an agreed schedule, so this setting cannot be turned on.” When SiteGPT cannot check the HIPAA status, any general request with emailConversationToVisitor: true fails with 503 HIPAA_CHECK_UNAVAILABLE, also when the value is already saved. Nothing in the request is saved. See Let visitors email a conversation to themselves.
  • Button labels. In chat-mode, the rule that the two button labels of visitor choice must differ in more than capital letters, spaces, or end punctuation applies only when the request changes a label. SiteGPT compares a label with the saved one as it saves it: without spaces at the start and end, and an empty label as the default. So you can send back labels that were saved before the rule. See Set visitor choice with API v2.
  • A request that changes nothing. When no saved setting would change, for example when a section is an empty object {} or has only values that are already saved, SiteGPT saves nothing. The request succeeds, and meta.warnings has “No setting changed. Every field sent has the value that is saved.” PATCH /chatbots/{chatbotId}/settings with no section at all, for example an empty object {}, still fails with 400 SETTINGS_SECTION_REQUIRED.
  • updatedSections. The response of PATCH /chatbots/{chatbotId}/settings lists only the sections that changed a saved setting. When only the sections together change a setting, it lists all of them.
  • Unknown fields. A field that a section does not have still fails with 400 VALIDATION_FAILED.

Rate limits and quotas

  • There is no published per-request rate limit. Only 429 RATE_LIMITED from POST /onboarding/agent/start comes with a Retry-After header. Content operations can also return 429 RATE_LIMITED, without the header. See Errors from content operations.
  • 429 CHATBOT_PAGES_LIMIT_REACHED means that a plan quota is used up, for example the pages quota for content. Do not retry it in a loop. Remove content or change your plan. See Plans and limits.
  • 429 MESSAGE_LIMIT_REACHED means that the conversation reached Limit Messages Per Conversation. The message is not saved, and the chatbot does not answer. The error message is “This conversation reached the message limit of the chatbot (Limit Messages Per Conversation). Start a new conversation.” Send the message to a new conversation with POST /chatbots/{chatbotId}/messages. Replies from your team are not limited. See Limit messages per conversation.
  • 429 TRIAL_MESSAGE_LIMIT_REACHED means that a temporary chatbot from agent-first onboarding used its 50 messages. The message is “This trial workspace has used its 50 messages. Claim the workspace to keep chatting.” Claim the chatbot to continue. See Temporary chatbots.
  • 429 RATE_LIMITED comes from POST /onboarding/agent/start when too many onboarding workspaces were started from your network or in total. The message is, for example, “Too many onboarding workspaces were started. Try again in 3 minutes.” The Retry-After header gives the seconds to wait. Wait that long, then try again. Do not start a new workspace for each attempt. Reuse the workspace that you have.

Model names

API v2 uses the public model names gpt-4.1 and gpt-4.1-mini in requests and responses. A chatbot with no saved model answers with GPT-4.1, and GET /chatbots/{chatbotId}/settings/general shows gpt-4.1 for it.