Base URL
All API requests are made to:Authentication
ContextGPT uses API keys for authentication. Include your API key in theAuthorization header of every request.
Getting your API key
- Sign in to your ContextGPT account
- Navigate to Billing or Profile > API Access
- Copy your API key
- Store it securely (never commit to version control)
Using your API key
Include your API key in theAuthorization header with the Bearer scheme:
Example request
Authentication errors
- 401 — Missing or invalid API key
- 403 — Plan doesn't include API access
Response format
All API responses use a consistent JSON structure:- Success response
- Error response
Error handling
HTTP status codes
HTTP status codes
- 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
Common error codes
Common error codes
API_KEY_NOT_VALID- Invalid or missing API keyREQUEST_VALIDATION_FAILED- Request body validation failedCHATBOT_NOT_FOUND- Chatbot doesn’t existCHATBOT_FETCH_FORBIDDEN- No permission to access chatbotCHATBOT_LIMIT_REACHED- Exceeded chatbot quotaMESSAGES_LIMIT_REACHED- Exceeded message quota
Validation errors
When request validation fails, theerrors array contains specific field errors:
Rate limiting
API requests are rate-limited at multiple levels to ensure platform stability and fair usage.Generic API limits
All requests are subject to these limits regardless of plan (to make platform accessible to all users):| Limit | Value | Scope |
|---|---|---|
| Per IP | 100 req/sec | Applied globally before authentication — |
| Per user | 500 req/60s | Applied after authentication on all endpoints |
| Concurrency | 10 simultaneous | Upload/ingestion endpoints only |
AI & messaging limits
Requests that trigger AI responses have additional per-plan limits:| Plan | Messages/min | AI replies/min |
|---|---|---|
| Starter | 600 | 150 |
| Growth | 3,000 | 750 |
| Scale | 12,000 | 3,000 |
429 with MESSAGES_LIMIT_REACHED.
Rate limit response
When you exceed any rate limit, you’ll receive a429 Too Many Requests response with a Retry-After header:
Pagination
List endpoints support pagination using query parameters:page- Page number (default: 1)limit- Results per page (default: 20, max: 100)
Making requests
Common workflows
Creating and configuring a chatbot
Creating and configuring a chatbot
Sending messages
Sending messages
Managing conversations
Managing conversations
API resources
The ContextGPT API provides endpoints for:- Chatbots - Create, read, update, delete chatbots
- Appearance - Customize chatbot visual design
- Conversation Starters - Manage conversation starter prompts
- Follow-up Prompts - Post-response suggestions
- Instructions - Manage chatbot instruction sets
- Personas - Manage chatbot personas
- Localization - Configure locale-specific settings
- Lead Settings - Configure lead capture behavior
- Human Support Settings - Configure escalation and handoff
- Settings - Configure general chatbot behavior
- Messages - Send and receive messages
- Threads - Manage conversation threads
- Text Snippets - Manage reusable text content
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
SDKs and libraries
Official SDKs
Currently, ContextGPT 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@ContextGPT.in
- 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