Getting Started
API Overview
Chat with your agents and manage your workspace from your own code, with one API key
The QwryAI API has two parts that share the same API keys. The Chat API talks to an agent the way a customer would and streams its answers back. The Tools API reads and changes everything else: agents, conversations, tickets, sources, actions and settings. Both return JSON and use the same Bearer key, so one key can power a support bot in your app and a nightly report in the same project.
What is the QwryAI API?
The API exposes what you can do in the dashboard as two surfaces:
| Surface | Base URL | What it does |
|---|---|---|
| Chat API | https://api.qwryai.com/api/v2 | Send customer messages to an agent, stream the reply, retry an answer and return the result of a client action. |
| Tools API | https://api.qwryai.com/public/v1 | Call any of the workspace tools your key allows, such as list_agents, query_conversations, query_tickets or list_sources, with a JSON body. |
The Chat API follows a REST shape with structured error codes and Server-Sent Events streaming. The Tools API is a single tool-call endpoint: you name the tool in the path and pass its arguments as the body. Every tool that changes something returns a review first, and nothing changes until you apply it. The same tools power Backstage, the MCP server and the CLI.
Base URLs:
https://api.qwryai.com/api/v2
https://api.qwryai.com/public/v1Quick Start
- Create an API key
Open Workspace settings › API keys and select Create API key. In Create New API Key, keep the permissions your integration needs switched on (the Chat API needs Chat with agents) and select Confirm. The key appears in the list; open its ⋯ menu and choose Copy key. See Authentication for every permission.
Workspace settings › API keys
- Find your agent's id
Call the
list_agentstool. Each agent comes back with itsid, which the Chat API takes in the path and the Tools API takes aschatbotId.curl -X POST 'https://api.qwryai.com/public/v1/tools/list_agents' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{}' - Send your first message
curl -X POST 'https://api.qwryai.com/api/v2/agents/YOUR_AGENT_ID/chat' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "message": "Hi! Do you ship to Canada?", "stream": false }'Response:
{ "data": { "id": "5b0e7c1a-2f4d-4c55-9a51-6d8e3f2b9c10", "role": "assistant", "parts": [ { "type": "text", "text": "Yes, we ship to Canada. Orders arrive in 5 to 8 business days." } ], "metadata": { "conversationId": "fd5ae9e1-9b30-4503-b346-ccd4d7ef16a3", "userMessageId": "0c4f6a2e-8d13-4b7a-b0e9-1a2c3d4e5f60", "userId": null, "finishReason": "stop", "usage": { "credits": 1 } } } }Without
"stream": false, the same call streams the reply as it's written. See Streaming.
Endpoints
Chat API · https://api.qwryai.com/api/v2
| Method | Endpoint | Notes |
|---|---|---|
POST | /agents/{agentId}/chat | Send a message or continue a conversation |
POST | /agents/{agentId}/conversations/{conversationId}/retry | Regenerate an answer |
POST | /agents/{agentId}/conversations/{conversationId}/tool-result | Return a client action result |
Tools API · https://api.qwryai.com/public/v1
| Method | Endpoint | Notes |
|---|---|---|
GET | /me | Your workspace, plan, the key's permissions and the tools they unlock |
GET | /tools | Every tool your key can call, with its input schema |
POST | /tools/{toolName} | Call a tool; the body is its arguments |
POST | /reviews/{reviewId}/apply | Apply a change a tool prepared for review |
A health check that needs no key lives at GET https://api.qwryai.com/api/v1/health.
The guides in this section map each area to its tools: Agents, Conversation Search, Sources, Helpdesk and WhatsApp.
Response Headers
Chat API responses carry these headers:
| Header | Description |
|---|---|
x-request-id | The request's id. Send your own x-request-id and it's echoed back; otherwise QwryAI generates one. Include it when you contact support. |
X-RateLimit-Limit | Requests allowed in the current window. |
X-RateLimit-Remaining | Requests left in the current window. |
X-RateLimit-Reset | Unix time, in seconds, when the window resets. |
Tools API responses carry X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset with that API's own limit. See Rate limiting.