curl --request POST \
--url https://api.example.com/api/v1/prediction/{id} \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"chatId": "<string>",
"streaming": true,
"overrideConfig": {},
"history": [
{}
],
"uploads": [
{}
]
}
'{
"401": {},
"403": {},
"404": {},
"412": {},
"429": {},
"500": {},
"text": "<string>",
"question": "<string>",
"chatId": "<string>",
"chatMessageId": "<string>",
"sessionId": "<string>",
"memoryType": "<string>",
"followUpPrompts": [
{}
],
"sourceDocuments": [
{}
]
}Send a message to a chatflow and get a prediction/response
curl --request POST \
--url https://api.example.com/api/v1/prediction/{id} \
--header 'Content-Type: application/json' \
--data '
{
"question": "<string>",
"chatId": "<string>",
"streaming": true,
"overrideConfig": {},
"history": [
{}
],
"uploads": [
{}
]
}
'{
"401": {},
"403": {},
"404": {},
"412": {},
"429": {},
"500": {},
"text": "<string>",
"question": "<string>",
"chatId": "<string>",
"chatMessageId": "<string>",
"sessionId": "<string>",
"memoryType": "<string>",
"followUpPrompts": [
{}
],
"sourceDocuments": [
{}
]
}true for streaming responsessessionId - Override the session ID[
{"role": "user", "content": "Hello"},
{"role": "assistant", "content": "Hi! How can I help?"}
]
multipart/form-data encoding:
files fieldstreaming: true, the response uses Server-Sent Events (SSE) format:
event: token
data: {"token": "Hello"}
event: token
data: {"token": " there"}
event: metadata
data: {"chatId": "...", "chatMessageId": "...", "sessionId": "..."}
curl -X POST "https://your-flowise-instance.com/api/v1/prediction/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "What are your business hours?",
"chatId": "session-abc123"
}'
const chatflowId = '123e4567-e89b-12d3-a456-426614174000';
const response = await fetch(`https://your-flowise-instance.com/api/v1/prediction/${chatflowId}`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
question: 'What are your business hours?',
chatId: 'session-abc123'
})
});
const result = await response.json();
import requests
chatflow_id = '123e4567-e89b-12d3-a456-426614174000'
response = requests.post(
f'https://your-flowise-instance.com/api/v1/prediction/{chatflow_id}',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'question': 'What are your business hours?',
'chatId': 'session-abc123'
}
)
result = response.json()
curl -X POST "https://your-flowise-instance.com/api/v1/prediction/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-N \
-d '{
"question": "Tell me a story",
"streaming": true
}'
const chatflowId = '123e4567-e89b-12d3-a456-426614174000';
const response = await fetch(`https://your-flowise-instance.com/api/v1/prediction/${chatflowId}`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
question: 'Tell me a story',
streaming: true
})
});
// Handle streaming response
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const chunk = decoder.decode(value);
// Process SSE events
console.log(chunk);
}
import requests
import json
chatflow_id = '123e4567-e89b-12d3-a456-426614174000'
response = requests.post(
f'https://your-flowise-instance.com/api/v1/prediction/{chatflow_id}',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'question': 'Tell me a story',
'streaming': True
},
stream=True
)
# Handle streaming response
for line in response.iter_lines():
if line:
decoded_line = line.decode('utf-8')
if decoded_line.startswith('data: '):
data = json.loads(decoded_line[6:])
print(data.get('token', ''))
{
"text": "Our business hours are Monday to Friday, 9 AM to 5 PM EST.",
"question": "What are your business hours?",
"chatId": "session-abc123",
"chatMessageId": "msg-xyz789",
"sessionId": "session-abc123",
"memoryType": "bufferMemory",
"followUpPrompts": [
"What holidays are you closed?",
"Do you have weekend hours?"
],
"sourceDocuments": []
}
curl -X POST "https://your-flowise-instance.com/api/v1/prediction/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "[email protected]" \
-F "question=What does this document say?" \
-F "chatId=session-abc123"
const formData = new FormData();
formData.append('files', fileInput.files[0]);
formData.append('question', 'What does this document say?');
formData.append('chatId', 'session-abc123');
const response = await fetch(`https://your-flowise-instance.com/api/v1/prediction/${chatflowId}`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
{
"message": "This site is not allowed to access this chatbot"
}
allowedOrigins listallowedOrigins in their chatbotConfig. If configured, only requests from those origins will be accepted. This is useful for restricting which websites can embed your chatbot.chatId across multiple requests to maintain conversation context. If you don’t provide a chatId, a new one will be generated automatically. Store this ID to continue the conversation later.