Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Chapter 10: REST Endpoints

HTTP API endpoints for integrating with BotServer.

Overview

BotServer exposes REST endpoints organized by functional area. All endpoints follow consistent patterns for authentication, pagination, and error handling.

Base URL

http://localhost:8000/api/v1

Authentication

Authorization: Bearer <token>

API Categories

CategoryPrefixDescription
User APIs/api/user/*Personal settings, profile, preferences
Admin APIs/api/admin/*Organization management (requires admin role)
Files/files/*Drive operations
Chat/chat/*Conversations and messages

User vs Admin Endpoints

The API separates user-level and admin-level operations:

User Endpoints (/api/user/*):

  • Personal profile and settings
  • User’s own files and data
  • Individual preferences
  • Accessible by all authenticated users

Admin Endpoints (/api/admin/*):

  • Organization-wide settings
  • User management
  • Group management
  • DNS, billing, audit logs
  • Requires admin role

Quick Example

curl -X POST http://localhost:8000/api/v1/chat \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello", "session_id": "abc123"}'

Response Format

{
  "success": true,
  "data": { ... },
  "error": null
}

Chapter Contents

See Also