Unified Chat
This endpoint provides a unified interface for interacting with the AI. It supports general conversation as well as intent-based actions like generating LinkedIn posts. The response is streamed using Server-Sent Events (SSE) to provide real-time feedback, including URL processing status, AI reasoning, and generated content.
URL: POST https://server.feedboss.ai/api/v1/ai-conversation/chat/:workspaceId
Authentication
All endpoints require authentication. You can authenticate using a Service API Key.
Service API Key
Add your Service API Key to the x-api-key header.
x-api-key: fb_live_xxxxxxxxxxxxxxxxxxxxxxxx
Path Parameters
| Parameter | Type | Description |
|---|---|---|
workspaceId | String | The unique identifier of the workspace (e.g., 691b0d48ad2baa659bf58b4b). |
Request Headers
| Header | Value | Description |
|---|---|---|
Content-Type | application/json | Required. |
Accept | text/event-stream | Recommended to indicate handling of SSE streams. |
Request Body
{
"userInput": "Write a LinkedIn post about the future of AI in marketing.",
"conversationId": "OPTIONAL_CONVERSATION_ID",
"contentStyleId": "OPTIONAL_STYLE_ID"
}
| Field | Type | Required | Description |
|---|---|---|---|
userInput | String | Yes | The message or prompt from the user. |
conversationId | String | No | The ID of an existing conversation to continue context. |
contentStyleId | String | No | The ID of a specific content style or persona to apply to the generation. |
Response Format
The response is a Server-Sent Events (SSE) stream. Each event has a type (event name) and data (JSON payload).
Event Types
Keep Alive
- Event:
keepalive - Data:
{"ping": true} - Description: Sent every 15 seconds to keep the connection open.
URL Processing (If URLs are found in input)
- Event:
url_processing_start,scraping_url,summarizing_content,extraction_completed - Data: Contains status messages about scraping and analyzing shared links.
AI Reasoning (Thinking Process)
- Event:
reasoning_started - Event:
reasoning_delta->{"text": "..."}(Chunks of thought process) - Event:
reasoning_ended
Content Streaming (Real-time output)
- Event:
chat_delta->{"text": "..."}(Text chunks for general chat responses) - Event:
content_delta->{"text": "...", "accumulated": "..."}(Text chunks for generated post content)
Final Results
-
Event:
chat_response(For General Chat) Data:{
"conversationId": "...",
"response": "Full response text...",
"suggestedQuestions": ["..."],
"conversationHistory": [...]
} -
Event:
post_ids(For Post Generation) Data:{
"conversationId": "...",
"postId": "...",
"refinementQuestions": ["Make it shorter", "Add emojis"]
}
Errors
- Event:
error - Data:
{"message": "Error description"}
Example Request (cURL)
curl -X POST http://localhost:5000/api/v1/ai-conversation/chat/691b0d48ad2baa659bf58b4b \
-H "Content-Type: application/json" \
-H "x-api-key: fb_live_YOUR_API_KEY_HERE" \
-d '{
"userInput": "Create a post about remote work leadership"
}'
Example Response Stream
event: url_processing_start
data: {"message":"Analyzing shared links...","count":0}
event: reasoning_started
data: {}
event: reasoning_delta
data: {"text":"The user wants"}
event: reasoning_delta
data: {"text":" a post about remote work."}
event: reasoning_ended
data: {}
event: content_delta
data: {"text":"Leading","accumulated":"Leading"}
event: content_delta
data: {"text":" remote","accumulated":"Leading remote"}
...
event: post_ids
data: {"conversationId":"65a1...","postId":"65a2...","refinementQuestions":["..."]}