This endpoint requires authentication via JWT (for web users) or API key (for bot services).
Overview
The chat endpoint provides conversational AI capabilities powered by Anthropic tool use. The LLM understands natural language in any supported language, decides which tools to call (get_tasks, create_task_draft, log_mood, etc.), and returns responses grounded in real data. When tasks are detected, it creates drafts for user confirmation.
Request
The user’s message (1-2000 characters)
Source platform: web, slack, teams, or whatsapp
User identifier on the platform (user ID or UUID)
Recent conversation history for context. Each item should have role ("user" or "assistant")
and content (the message content).
Response
The AI’s response message
Detected intent: task_create, task_list, mood, help, greeting, or general
Single task draft (when one task is detected). Contains id (Draft UUID), title (Parsed task
title), priority (1-5), and optional dueDate.
Multiple task drafts (when several tasks are detected) Each item contains id, title, priority, and optional dueDate
Task list returned when the LLM calls get_tasks tool. Each item contains id, title,
status, priority, dueDate, createdAt
Task that was just completed via the complete_task tool. Contains id, title, status
Mood entry just logged via the log_mood tool. Contains id, value, note, createdAt
Recent mood entries returned from get_mood_history tool
Task statistics from get_task_stats tool. Contains totalTasks, completedTasks,
completionRate, openTasks, overdueTasks
Whether to show mood logging UI
Mood value (1-5) inferred from the message, if detected
Intents
Intent Description Typical Response task_createUser wants to create a task Returns taskDraft or taskDrafts task_listUser asks about their tasks Returns task summary in text moodUser wants to log mood Sets showMoodPrompt: true helpUser asks for help Returns help information greetingCasual greeting Friendly response generalGeneral conversation Conversational response
curl -X POST "https://api.hitler.app/api/chat" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "tomorrow I need to review the budget and send invoices",
"platform": "web",
"platformUserId": "user-123",
"history": []
}'
200 - Multiple Tasks
200 - Single Task
200 - Greeting
200 - Mood Detected
{
"text" : "got it, adding 2 tasks" ,
"intent" : "task_create" ,
"taskDrafts" : [
{
"id" : "draft-uuid-1" ,
"title" : "review the budget" ,
"priority" : 3 ,
"dueDate" : "2024-01-16T09:00:00.000Z"
},
{
"id" : "draft-uuid-2" ,
"title" : "send invoices" ,
"priority" : 3 ,
"dueDate" : "2024-01-16T09:00:00.000Z"
}
],
"showMoodPrompt" : false ,
"inferredMood" : null
}
Service Endpoint
For bot services (Slack, Teams), use the service endpoint with API key authentication:
This endpoint uses the X-API-Key header instead of JWT Bearer token.
curl -X POST "https://api.hitler.app/api/chat/service" \
-H "X-API-Key: hitler_org123_secret456" \
-H "Content-Type: application/json" \
-d '{
"message": "what tasks do I have?",
"platform": "slack",
"platformUserId": "U123ABC456"
}'
Language Support
Hitler supports 13 languages with automatic detection:
Language Code Script Detection English englishLatin (default) Hinglish hinglishHindi patterns Spanish spanishSpanish diacritics French frenchFrench diacritics German germanGerman characters Portuguese portuguesePortuguese diacritics Italian italianItalian patterns Dutch dutchDutch words Japanese japaneseHiragana/Katakana/Kanji Korean koreanHangul Chinese chineseCJK ideographs Arabic arabicArabic script Russian russianCyrillic
The AI automatically detects the user’s language and responds appropriately:
{
"message" : "añade una tarea: revisar el presupuesto" ,
"platform" : "web" ,
"platformUserId" : "user-123"
}
{
"text" : "vale, añadiendo \" revisar el presupuesto \" " ,
"intent" : "task_create" ,
"taskDraft" : {
"id" : "draft-uuid" ,
"title" : "revisar el presupuesto" ,
"priority" : 3
}
}
Language Endpoints
Get Supported Languages
Returns the list of all supported languages.
Get User’s Language
GET /api/chat/language
Authorization: Bearer YOUR_TOKEN
Returns the user’s current language preference.
Update User’s Language
PATCH /api/chat/language
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{ "language": "spanish" }
Sets the user’s preferred language, overriding auto-detection.
Notes
Task drafts created via chat must be confirmed using the Confirm Draft endpoint
The AI uses conversation history for context, but history is not persisted server-side
Mood inference happens silently and doesn’t interrupt the conversation
Response messages are kept short (8-12 words) for chat-like UX
Language is auto-detected from each message but can be manually set