DenserAIDenserAI Docs
IntegrationsRESTful API

Chatbot API

POST
/api/query

Query chatbot

Send a message to the chatbot to get a response.

/api/query

Request Body

question
Required
string

Question to ask the chatbot.

Example: What are the pricing options for denserbot?

key
Required
string

API key for the chatbot.

Example: 11111111-1111-1111-1111-111111111111

chatbotId
Required
string

Identifier for a chatbot.

Example: 00000000-0000-0000-0000-000000000000

contextarray

Include previous conversation in the question. Help the chatbot understand the context of the conversation.

Example: [{"role": "user", "content": "last question"}, {"role": "assistant", "content": "last response"}]

promptstring

Customized prompt for the LLM model.

Example: Please provide your answer in the following format: ...

modelstring

Select LLM model to provide a response. Defaults to gpt-4o-mini.

Available options: gpt-3.5 | gpt-4o-mini | gpt-4o | gpt-4 | claude-3-5-sonnet | claude-3-5-haiku | claude-3-7-sonnet

citationboolean

Whether to include citations in the response. Defaults to true.

Status codeDescription
200Success
400Bad Request
401Unauthorized
500Internal server error
curl -X POST "https://denser.ai/api/query" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "What are the pricing options for denserbot?",
    "chatbotId": "11111111-1111-1111-1111-111111111111",
    "key": "00000000-0000-0000-0000-000000000000",
    "context": [],
    "prompt": "",
    "model": "gpt-4o-mini",
    "citation": true
  }'

A successful response will return the answer from the chatbot, together with the original document passages that the answer is based on.

{
  "statusCode": "200",
  "answer": "Denser.ai offers several pricing plans to accommodate businesses of different sizes and needs:...",
  "passages": [
  {
    "source": "https://docs.denser.ai/docs/billing/upgrade",
    "text": "offer four different subscription plans: Free Trial, Starter, Standard, and Business...",
    "score": 7.904721
  },
  {
    "source": "https://denser.ai/pricing",
    "text": "Use DenserChat for free. Upgrade to enable custom domains and more advanced features...",
    "score": 7.236598,
    "score_rerank": 5.964538097381592
  },
  ...
  ]
}

On this page