API Reference

Complete API documentation for developers integrating with AleaChatbot.

Authentication Chat API Documents Websites Customization

Authentication

AleaChatbot uses JWT tokens for authentication. Include your token in the Authorization header.

POST /token/

Obtain JWT Token

Get an access token using your email and password.

Request Body
{
  "email": "user@example.com",
  "password": "your_password"
}
Response
{
  "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
  "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}

Chat API

Send messages and receive AI responses from your chatbot.

POST /chat/data/

Send Chat Message

Send a message to the chatbot and receive an AI response.

Requires Authentication
Request Body
{
  "message": "How do I upload documents?",
  "guest_uuid": "optional-guest-uuid"
}
Response
{
  "success": true,
  "response": "You can upload documents by going to the Documents section...",
  "message_id": "msg_123456",
  "timestamp": "2025-01-15T10:30:00Z"
}

Error Codes

400 Bad Request - Invalid request format or missing parameters
401 Unauthorized - Invalid or missing authentication token
404 Not Found - Resource does not exist
500 Internal Server Error - Server-side error