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.

Base URL

All API requests are made to:
https://sitegpt.ai/api/v0

Authentication

SiteGPT uses API keys for authentication. Include your API key in the Authorization header of every request.

Getting your API key

  1. Sign in to your SiteGPT account
  2. Navigate to Billing or Profile > 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:
Authorization: Bearer YOUR_API_KEY

Example request

curl https://sitegpt.ai/api/v0/chatbots \
  -H "Authorization: Bearer YOUR_API_KEY"

Authentication errors

If your API key is missing, malformed, or invalid, you’ll receive a 401 Unauthorized response:
{
  "success": false,
  "message": "Failed to authenticate",
  "data": null,
  "error": {
    "code": "API_KEY_NOT_VALID",
    "message": "Authorization header does not contain valid API key",
    "details": null
  }
}

Response format

All API responses use a consistent JSON structure:

Success response

{
  "success": true,
  "message": "Operation completed successfully",
  "data": {
    // Response data here
  }
}

Error response

{
  "success": false,
  "message": "Operation failed",
  "data": null,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": null // or array of validation errors
  }
}

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:
{
  "success": false,
  "message": "Failed to create chatbot",
  "data": null,
  "error": {
    "code": "REQUEST_VALIDATION_FAILED",
    "message": "Request body is not valid",
    "details": [
      {
        "path": ["chatbotName"],
        "message": "Required"
      }
    ]
  }
}

Rate limiting

API requests are rate-limited to ensure platform stability:
  • Standard plans - 100 requests per minute
  • Business plans - 500 requests per minute
  • Enterprise plans - Custom limits
When you exceed rate limits, you’ll receive a 429 Too Many Requests response.

Pagination

List endpoints support pagination using query parameters:
GET /v0/chatbots?page=1&limit=20
Parameters:
  • page - Page number (default: 1)
  • limit - Results per page (default: 20, max: 100)
Paginated responses include metadata:
{
  "success": true,
  "message": "Fetched chatbots successfully",
  "data": {
    "chatbots": [...],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 45,
      "pages": 3
    }
  }
}

Making requests

curl -X POST https://sitegpt.ai/api/v0/chatbots \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chatbotName": "My New Chatbot"
  }'

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

  • Security
  • Performance
  • Error handling
  • Data management
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

I