---
title: Answer API | usedocs.app
description: "Use the usedocs Answer API to get cited, honest answers from your documentation inside tickets, Slack bots, and internal tools."
image: "https://usedocs.app/og.png"
url: "https://usedocs.app/learn/answer-api"
---

Guide · Updated 2026-08-07

# Answer API

The same RAG pipeline that powers the widget is available over HTTP. Use it to add a
 “Generate answer from docs” button in your ticketing tool, a Slack slash command, or an MCP-style agent.

Need help?

Email [hello@usedocs.app](mailto:hello@usedocs.app) for product questions, setup help, sales, partnerships, or security reports.

## Authentication

- **botId** — your bot UUID from the dashboard.

- **botKey** — public bot key (Settings → Embed).

- **Origin** — browser requests must come from an allowed origin. Server-to-server calls without an `Origin` header are allowed when the bot key is valid (same rules as the widget API).

## POST /chat

JSON request body:

```
{
  "botId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "botKey": "pk_…",
  "question": "How do I reset two-factor authentication?",
  "conversationId": "optional-existing-id",
  "visitor": "zendesk-ticket-4821",
  "pageUrl": "https://docs.example.com/security/2fa"
}
```

Response (shape):

```
{
  "conversationId": "…",
  "answer": "…",
  "citations": [{ "url": "…", "title": "…" }],
  "confidence": 0.72,
  "escalate": false,
  "actions": []
}
```

- **confidence** — retrieval score 0–1. Low values often mean the docs don’t cover the question.

- **escalate** — true when the honesty gate declines to invent an answer.

- **citations** — sources used; show these to agents and customers.

## POST /chat/stream

Same body as `/chat`. Response is Server-Sent Events:
 `start` → `token`* → `result` (or `error`).

## cURL example

```
curl -sS -X POST 'https://usedocs.app/chat' \
  -H 'content-type: application/json' \
  -d '{
    "botId": "YOUR_BOT_ID",
    "botKey": "YOUR_PUBLIC_BOT_KEY",
    "question": "How do I get started?",
    "visitor": "ticket-system"
  }'
```

## Human handoff

When the bot escalates, configured Slack, Discord, Teams, or webhook integrations notify your team.
 Use **Monitor → Inbox** to assign, prioritize, add internal notes, and review the conversation on your own schedule.

## Rate limits & quotas

Chat requests count toward your plan’s monthly message quota and per-visitor rate limits.
 Handle `429` and quota errors by falling back to a human.

[Open dashboard](/dashboard)
 [More guides](/learn/)
