Skip to content

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 successful
  • 201 Created: Resource created successfully
  • 202 Accepted: Request accepted for processing
  • 400 Bad Request: Invalid request data
  • 401 Unauthorized: Authentication required
  • 404 Not Found: Resource not found
  • 500 Internal Server Error: Server error

Error responses include a JSON object with error details:

{
  "detail": "Error description"
}

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: