Skip to main content

Send Message

Send a message to the AI assistant and get a response.
POST
/api/chat

Request Body

{
  "message": "What is my car insurance policy number?",
  "documentIds": ["doc_abc123", "doc_xyz789"]
}
FieldTypeRequiredDescription
messagestringYesUser’s question or message
documentIdsarrayNoSpecific documents to search
conversationIdstringNoContinue 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

FieldTypeDescription
responsestringAI assistant’s response
sourcesarrayDocuments used to generate response
conversationIdstringID for conversation continuity

Source Object

FieldTypeDescription
documentIdstringDocument ID
documentNamestringOriginal file name
relevantTextstringQuoted 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.