DenserAIDenserAI Docs
API

REST API

Call Chatbot via REST API

Use the REST API to embed DenserAI anywhere--your product, internal tools, or automations. This quick start gets you started to make a first request by using Denser REST API.

Generate API Key

Navigate to Security section on the main screen of your selected chatbot.

Scroll down to the API Key section under the Security page.

If REST API access has been enabled and you know the API key, you can use that existing API key. Otherwise, click Generate API Key button to generate a new API key.

Security Note - Key Rotation

Generating a new API key will disable all the previously generated keys. You will need to apply the new key to all the places you use the key.

Find Chatbot Id

At the chatbot dashboard, find the chatbot selector on the header bar. The selector should display the name of the currently selected chatbot.

Click the chatbot selector to open the chatbot list dropdown.

Test API Request

You can quickly test calling the API with curl command. Remember to replace <chatbot-id> and <api-key> with your own values from the previous sections. Replace <example-question> with your own question to ask the chatbot.

curl https://denser.ai/api/query -X POST -H "Content-Type: application/json" -d \
'{
  "chatbotId": "<chatbot-id>",
  "question": "<example-question>",
  "key": "<api-key>"
}'

Go further

Explore payload options, streaming responses, and error codes in the API reference.