Skip to content
QwryAI
Documentation
Pages

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:

SurfaceBase URLWhat it does
Chat APIhttps://api.qwryai.com/api/v2Send customer messages to an agent, stream the reply, retry an answer and return the result of a client action.
Tools APIhttps://api.qwryai.com/public/v1Call 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:

Code
https://api.qwryai.com/api/v2
https://api.qwryai.com/public/v1

Quick Start

  1. 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
  1. Find your agent's id

    Call the list_agents tool. Each agent comes back with its id, which the Chat API takes in the path and the Tools API takes as chatbotId.

    Bash
    curl -X POST 'https://api.qwryai.com/public/v1/tools/list_agents' \
      -H 'Authorization: Bearer YOUR_API_KEY' \
      -H 'Content-Type: application/json' \
      -d '{}'
  2. Send your first message
    Bash
    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:

    JSON
    {
      "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

MethodEndpointNotes
POST/agents/{agentId}/chatSend a message or continue a conversation
POST/agents/{agentId}/conversations/{conversationId}/retryRegenerate an answer
POST/agents/{agentId}/conversations/{conversationId}/tool-resultReturn a client action result

Tools API · https://api.qwryai.com/public/v1

MethodEndpointNotes
GET/meYour workspace, plan, the key's permissions and the tools they unlock
GET/toolsEvery tool your key can call, with its input schema
POST/tools/{toolName}Call a tool; the body is its arguments
POST/reviews/{reviewId}/applyApply 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:

HeaderDescription
x-request-idThe 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-LimitRequests allowed in the current window.
X-RateLimit-RemainingRequests left in the current window.
X-RateLimit-ResetUnix 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.

Next Steps

Explore the documentation