Send Message
Send a message to the AI assistant and get a response.
Request Body
{
"message" : "What is my car insurance policy number?" ,
"documentIds" : [ "doc_abc123" , "doc_xyz789" ]
}
Field Type Required Description messagestring Yes User’s question or message documentIdsarray No Specific documents to search conversationIdstring No Continue existing conversation
Response
{
"response" : "Based on your documents, your car insurance policy number is AUTO-2024-56789. This is from your policy with XYZ Insurance." ,
"sources" : [
{
"documentId" : "doc_abc123" ,
"documentName" : "car-insurance-2024.pdf" ,
"relevantText" : "Policy Number: AUTO-2024-56789"
}
],
"conversationId" : "conv_abc123"
}
Response Object
Field Type Description responsestring AI assistant’s response sourcesarray Documents used to generate response conversationIdstring ID for conversation continuity
Source Object
Field Type Description documentIdstring Document ID documentNamestring Original file name relevantTextstring Quoted text from document
Example Usage
Basic Question
curl -X POST https://api.adminest.com/api/chat \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "When does my home insurance expire?"
}'
Scoped to Specific Documents
curl -X POST https://api.adminest.com/api/chat \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "Summarize this policy",
"documentIds": ["doc_abc123"]
}'
Continuing a Conversation
curl -X POST https://api.adminest.com/api/chat \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"message": "What about the excess amount?",
"conversationId": "conv_abc123"
}'
Best Practices
Be Specific Clear questions get better answers
Scope When Possible Pass documentIds for focused searches
Use Conversations Continue conversations for follow-ups
Verify Sources Always check source references
AI responses are informational. Always verify critical details with the original documents.