{"message":"İhracat Satış Asistanı API","version":"1.0.0","features":{"chat":"SSE streaming at POST /chat/stream (recommended) or WebSocket at /ws/chat","chat_history":"Chat history management at /chats","research":"Company research at /research","ai_generate":"Content generation at /ai-generate","crm":"CRM for managing researched companies at /crm"},"endpoints":{"POST /chat/stream":"SSE streaming chat (recommended - simpler, stateless)","POST /research":"Start new research with confirmation workflow","GET /research/{id}":"Get research data with status info","GET /research/{id}/status":"Get research status with confirmation data","POST /research/{id}/confirm":"Confirm company info and continue research","GET /research":"List all research reports (supports user_id filter)","DELETE /research/{id}":"Delete research","WebSocket /ws/chat":"Real-time AI chat with history (legacy)","WebSocket /ws/test":"Test WebSocket for debugging","POST /chats":"Create new chat session","GET /chats":"List user chat sessions","GET /chats/{id}":"Get chat history with messages","PUT /chats/{id}":"Update chat name","DELETE /chats/{id}":"Delete chat and messages","POST /ai-generate":"Generate custom AI content","GET /users":"List all users","GET /users/{id}":"Get user by ID","POST /users/assign-research":"Assign existing research to random users","POST /market-research/generate-industries":"Generate/retrieve cached industries for user","DELETE /market-research/industries/{user_id}":"Delete cached industries for user","POST /market-research":"Create new market research","GET /market-research":"List market research entries","GET /market-research/{id}/status":"Get market research status","GET /market-research/{id}":"Get market research results","GET /market-research/{id}/companies":"Get companies from market research","GET /crm/companies":"List CRM companies with filters","POST /crm/companies":"Add company to CRM manually","POST /crm/companies/from-market-research":"Add company from market research to CRM","POST /crm/companies/from-research":"Add company from deep dive research to CRM","GET /crm/companies/{id}":"Get CRM company with activities and tasks","PATCH /crm/companies/{id}":"Update CRM company (stage, notes)","DELETE /crm/companies/{id}":"Delete CRM company","POST /crm/companies/{id}/activities":"Log activity for company","POST /crm/companies/{id}/tasks":"Create task for company","PATCH /crm/tasks/{id}":"Update task","DELETE /crm/tasks/{id}":"Delete task"},"chat_sse_workflow":{"1":"POST /chat/stream with {user_id, messages: [{role, content}], chat_id?, research_id?}","2":"Receive SSE events: chat_start → chat_chunk* → tool_use* → chat_complete","3":"Events are JSON in format: event: <type>\\ndata: <json>\\n\\n"},"research_workflow":{"1":"POST /research - Start research, get research_id","2":"GET /research/{id}/status - Poll for awaiting_confirmation=true","3":"POST /research/{id}/confirm - Confirm or correct company info","4":"GET /research/{id}/status - Poll for completion updates","5":"GET /research/{id} - Get final research results"},"crm_workflow":{"1":"GET /crm/companies - List companies in CRM with filters (stage, country, score)","2":"POST /crm/companies/from-market-research - Add company from market research","3":"PATCH /crm/companies/{id} - Update pipeline stage (new→contacted→interested→negotiating→won/lost)","4":"POST /crm/companies/{id}/activities - Log activities (note, email, call, linkedin, meeting)","5":"POST /crm/companies/{id}/tasks - Create follow-up tasks with due dates"}}