Skip to main content
The SiteGPT API allows you to programmatically manage chatbots, send messages, access conversation history, and configure settings. All endpoints use REST principles and return JSON responses.
This page documents the legacy /api/v0 API. For new integrations, use API Reference → v2 from the version selector.

Base URL

All API requests are made to:

Authentication

SiteGPT uses API keys for authentication. Include your API key in the Authorization header of every request.
This is the legacy v0 API. New integrations should use the v2 Agent API with scoped sgpt_ tokens from the Agents page.

Getting your API key

  1. Sign in to your SiteGPT account
  2. Open Billing in the top navigation; your API key is shown there when your plan includes API access
  3. Copy your API key
  4. Store it securely (never commit to version control)
Keep your API key secure. Anyone with your key can access and modify your chatbots.

Using your API key

Include your API key in the Authorization header with the Bearer scheme:

Example request

Authentication errors

If your API key is missing, malformed, or invalid, you’ll receive a 401 Unauthorized response:

Response format

All API responses use a consistent JSON structure:

Success response

Error response

Error handling

  • 200 OK - Request succeeded
  • 400 Bad Request - Invalid request parameters or body
  • 401 Unauthorized - Missing or invalid API key
  • 403 Forbidden - Insufficient permissions
  • 404 Not Found - Resource doesn’t exist
  • 405 Method Not Allowed - HTTP method not supported
  • 500 Internal Server Error - Server error
  • API_KEY_NOT_VALID - Invalid or missing API key
  • REQUEST_VALIDATION_FAILED - Request body validation failed
  • CHATBOT_NOT_FOUND - Chatbot doesn’t exist
  • CHATBOT_FETCH_FORBIDDEN - No permission to access chatbot
  • CHATBOT_LIMIT_REACHED - Exceeded chatbot quota
  • MESSAGES_LIMIT_REACHED - Exceeded message quota

Validation errors

When request validation fails, the error.details array contains specific field errors:

Rate limiting

API requests are rate-limited to keep the platform stable. Limits depend on your plan; when you exceed them you receive a 429 Too Many Requests response. Back off and retry with exponential delays.

Pagination

List endpoints support pagination using query parameters:
Parameters:
  • page - Page number (default: 1)
  • limit - Results per page (default: 20, max: 100)
Paginated responses include metadata:

Making requests

Common workflows

1

Create chatbot

POST /v0/chatbots
2

Update appearance

PATCH /v0/chatbots/{chatbotId}/appearance
3

Add training content

POST /v0/chatbots/{chatbotId}/links
4

Configure settings

PATCH /v0/chatbots/{chatbotId}/settings/general
5

Add conversation starters

POST /v0/chatbots/{chatbotId}/quick-prompts
1

Create thread

POST /v0/chatbots/{chatbotId}/threads
2

Send message

POST /v0/chatbots/{chatbotId}/message
3

Fetch response

Included in send message response
4

Update reaction

PATCH /v0/chatbots/{chatbotId}/messages/{messageId}
1

Fetch all threads

GET /v0/chatbots/{chatbotId}/threads
2

Get thread details

GET /v0/chatbots/{chatbotId}/threads/{threadId}
3

Escalate to agent

POST /v0/chatbots/{chatbotId}/threads/{threadId}/escalate
4

Update thread

PATCH /v0/chatbots/{chatbotId}/threads/{threadId}

API resources

The SiteGPT API provides endpoints for:
  • Chatbots - Create, read, update, delete chatbots
  • Appearance - Customize chatbot visual design
  • Content - Manage training data and custom responses
  • Messages - Send and receive messages
  • Threads - Manage conversation threads
  • Settings - Configure chatbot behavior
  • Prompts - Manage instructions and personas
  • Quick Prompts - Conversation starters
  • Follow-up Prompts - Post-response suggestions
  • Icons - Upload custom icons
  • Whitelabel - Manage white-label brands and users (enterprise)

Best practices

Never expose API keys - Keep them server-side only
Use environment variables - Don’t hardcode keys
Rotate keys regularly - Generate new keys periodically
Limit key scope - Use separate keys for different environments

Webhooks

Instead of polling the API, use webhooks to receive real-time updates:
  • New messages
  • Lead captures
  • Conversation escalations
  • Custom events
Configure webhooks in your chatbot settings or via the API. See Chatbot Settings - Advanced for webhook configuration.

SDKs and libraries

Official SDKs

Currently, SiteGPT doesn’t provide official SDKs. Use standard HTTP libraries in your language of choice.

Community libraries

Check our community forum for user-contributed libraries and wrappers.

Support

Need help with the API?
  • Documentation - Browse the API reference
  • Email - support@sitegpt.ai
  • Community - Join our Slack or forum
  • Enterprise - Dedicated support for enterprise customers

Next steps

Chatbot endpoints

Create and manage chatbots programmatically

Messages

Send messages and handle conversations

Settings

Configure chatbot behavior via API

Threads

Manage conversation threads