API
Open Chat Studio provides a REST API that enables you to create chat sessions, send messages, manage experiments, and access session data programmatically.
API Schema and Docs
See the following links for documentation on the API endpoints:
Overview
The API is organized around REST principles and uses standard HTTP methods and status codes. All API endpoints return JSON responses and require authentication.
Base URL: https://chatbots.dimagi.com/api/
Authentication
The API supports multiple authentication methods:
- API Key Authentication: Include your API key in the
X-api-key
header - Token Authentication: Use Bearer token authentication in the
Authorization
header - Cookie Authentication: Session-based authentication using cookies (for web integrations)
Error Handling
The API uses standard HTTP status codes:
200 OK
: Request successful201 Created
: Resource created successfully202 Accepted
: Request accepted for processing400 Bad Request
: Invalid request data401 Unauthorized
: Authentication required404 Not Found
: Resource not found500 Internal Server Error
: Server error
Error responses include a JSON object with error details:
Rate Limiting
To ensure optimal performance: - Chat polling should not exceed once every 30 seconds - API requests are subject to reasonable rate limits - Use pagination for large data sets
LLM Docs
The following documents are a simplified version of the API for consumption by LLMs: