Send Message
curl --request POST \
--url https://geniusforms.ai/api/v1/forms/{id}/chat/{conversationId}/messages \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"message": "What are the most common responses?"
}
'import requests
url = "https://geniusforms.ai/api/v1/forms/{id}/chat/{conversationId}/messages"
payload = { "message": "What are the most common responses?" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'What are the most common responses?'})
};
fetch('https://geniusforms.ai/api/v1/forms/{id}/chat/{conversationId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"userMessage": {
"id": 1,
"role": "assistant",
"message": "Based on the 42 responses, the most common feedback theme is...",
"createdAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": 1,
"role": "assistant",
"message": "Based on the 42 responses, the most common feedback theme is...",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"error": "validation_error",
"message": "Invalid request"
}{
"error": "validation_error",
"message": "Invalid request"
}{
"error": "validation_error",
"message": "Invalid request"
}{
"error": "validation_error",
"message": "Invalid request"
}Chat
Send Message
Send a message to a conversation and receive an AI-generated response. The AI analyzes the form’s response data to answer your question. Full conversation history is maintained for context.
POST
/
forms
/
{id}
/
chat
/
{conversationId}
/
messages
Send Message
curl --request POST \
--url https://geniusforms.ai/api/v1/forms/{id}/chat/{conversationId}/messages \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"message": "What are the most common responses?"
}
'import requests
url = "https://geniusforms.ai/api/v1/forms/{id}/chat/{conversationId}/messages"
payload = { "message": "What are the most common responses?" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: 'What are the most common responses?'})
};
fetch('https://geniusforms.ai/api/v1/forms/{id}/chat/{conversationId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"userMessage": {
"id": 1,
"role": "assistant",
"message": "Based on the 42 responses, the most common feedback theme is...",
"createdAt": "2023-11-07T05:31:56Z"
},
"assistantMessage": {
"id": 1,
"role": "assistant",
"message": "Based on the 42 responses, the most common feedback theme is...",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"error": "validation_error",
"message": "Invalid request"
}{
"error": "validation_error",
"message": "Invalid request"
}{
"error": "validation_error",
"message": "Invalid request"
}{
"error": "validation_error",
"message": "Invalid request"
}Authorizations
API key obtained from your GeniusForms dashboard
Body
application/json
Maximum string length:
5000Example:
"What are the most common responses?"