Skip to main content
In this tutorial, you make four calls to SiteGPT API v2. You create a token, list your chatbots, send a message to one chatbot, and read the conversation that the message started. It takes about 10 minutes. You need:
  • A SiteGPT account on the Growth plan or above, with at least one chatbot that has content. See Plans and limits.
  • A terminal with curl.
The examples use placeholders such as YOUR_API_TOKEN and YOUR_CHATBOT_ID. Replace them with your own values.

Step 1: Create an API token

  1. Sign in to SiteGPT.
  2. In the top navigation, select Agents.
  3. In Create API token, enter the Token name First API calls.
  4. Keep the default Expires value and the Standard access level.
  5. Keep All accessible chatbots.
  6. Select Create token.
  7. Copy the token. It starts with sgpt_. SiteGPT shows it only once.
Save the token in your terminal so that the next commands can use it:
Check that the token works:
The response starts with "ok": true. data.user.email is the email address of your account.

Step 2: List your chatbots

The response has a data.chatbots list. Each chatbot has an id and a title:
The list has up to 100 chatbots per page. If you have more, see Pagination. Copy the id of the chatbot that you want to test, and save it:

Step 3: Send a message

Send a question as a visitor. Use a question that your content can answer.
This call starts a new conversation. It waits for the answer, so it can take a few seconds. The response has two parts:
  • data.conversation.threadId is the ID of the new conversation.
  • data.message.answer.text is the chatbot’s answer.
Save the conversation ID:

Step 4: Read the conversation

The response has data.conversation. Its messages list has your question and the chatbot’s answer. The conversation also has fields such as mode, escalated, and resolved.

What you did

You created a token, found a chatbot, started a conversation, and read it back. Every API v2 call follows the same pattern:
  • The base URL is https://sitegpt.ai/api/v2.
  • The token goes in the Authorization: Bearer header.
  • The response is { "ok": true, "data": ..., "meta": ... }, or { "ok": false, "error": ... } when something fails.

Next steps

  • API conventions: pagination, errors, and deletes.
  • Authentication: access levels, scopes, and device login.
  • TypeScript SDK and Python SDK: the same calls from code.
  • The endpoint pages in this API reference list every operation, with its scopes and fields. The OpenAPI document is at https://sitegpt.ai/api/v2/openapi.json.
  • Moving from the legacy API? See Move from API v0 to v2.