API Documentationv1 Reference

SiteGist API v1

Send messages to your chatbots, list bots, conversations, leads, and knowledge sources programmatically. REST over HTTPS, JSON in and out. All read endpoints are owner-only — the API key must belong to the chatbot owner.

Base URL

Base URL
https://www.sitegist.co/api/v1

Authentication

Create a key in the dashboard under Profile → API keys, then send it as a Bearer token on every request. Keys look like sk_live_… — keep them secret.

cURL
curl https://www.sitegist.co/api/v1/chatbots \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Rate limits

120 requests/minute per API key. Exceeding it returns 429 with a Retry-After header.

Endpoints

POST/chat

Send a message and get the AI answer (also persists the conversation).

Request body

JSON
{
  "chatbotId": "proj_abc123",   // required — the chatbot/project id
  "message": "What are your pricing plans?", // required
  "sessionId": "sess_xyz"       // optional — continue an existing conversation
}

Example

cURL
curl -X POST https://www.sitegist.co/api/v1/chat \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"chatbotId":"proj_abc123","message":"Hello"}'

Response

200 OK
{
  "sessionId": "sess_xyz",
  "answer": "Our plans are Free, Pro ($19/mo) and Enterprise…"
}
GET/chatbots

List the chatbots owned by the API key. Owner-only.

Response

200 OK
{
  "data": [
    { "id": "proj_abc123", "name": "Support Bot", "status": "ACTIVE", "createdAt": "2026-06-01T10:00:00.000Z" }
  ]
}
GET/conversations?chatbotId=proj_abc123

List recent conversations (latest 100). chatbotId is optional. Owner-only.

Response

200 OK
{
  "data": [
    {
      "id": "sess_xyz",
      "chatbotId": "proj_abc123",
      "customerEmail": "jane@example.com",
      "status": "active",
      "mode": "ai",
      "messageCount": 6,
      "createdAt": "2026-06-20T09:00:00.000Z",
      "updatedAt": "2026-06-20T09:05:00.000Z"
    }
  ]
}
GET/conversations/:id/messages

List messages for a conversation (oldest first, capped at 500). Owner-only.

Example

cURL
curl https://www.sitegist.co/api/v1/conversations/sess_xyz/messages \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Response

200 OK
{
  "data": [
    {
      "id": "msg_abc",
      "role": "user",
      "content": "What are your pricing plans?",
      "createdAt": "2026-06-20T09:00:01.000Z"
    },
    {
      "id": "msg_def",
      "role": "assistant",
      "content": "Our plans are Free, Pro ($19/mo) and Enterprise…",
      "createdAt": "2026-06-20T09:00:03.000Z"
    }
  ]
}
GET/leads?chatbotId=proj_abc123

List leads for a chatbot (latest 100). chatbotId is required. Owner-only.

Example

cURL
curl "https://www.sitegist.co/api/v1/leads?chatbotId=proj_abc123" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Response

200 OK
{
  "data": [
    {
      "id": "lead_abc",
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phone": "+1-555-0100",
      "company": "Acme Inc",
      "status": "new",
      "createdAt": "2026-06-20T09:10:00.000Z"
    }
  ]
}
GET/sources?chatbotId=proj_abc123

List knowledge sources for a chatbot (latest 100, no full content). chatbotId is required. Owner-only.

Example

cURL
curl "https://www.sitegist.co/api/v1/sources?chatbotId=proj_abc123" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Response

200 OK
{
  "data": [
    {
      "id": "src_abc",
      "type": "web",
      "source": "https://example.com/docs",
      "title": "Product docs",
      "status": "indexed",
      "lastIndexedAt": "2026-06-18T12:00:00.000Z"
    }
  ]
}

Errors

Errors return a JSON body with an error message and an appropriate status code.

Error
{ "error": "chatbotId and message are required." }
400Missing/invalid parameters
401Missing, invalid, or revoked API key
404Chatbot not found / not yours
429Rate limit exceeded (see Retry-After)
502Answer generation failed