Endpoints
Add a message to a ticket
Reply to the customer behind a ticket as a teammate, or leave a private note for your team
A QwryAI ticket belongs to a conversation, and replies go through that conversation. The send_agent_message tool sends your reply to the customer on the conversation's channel as a human agent. The add_internal_note tool adds a note only your team sees. Both act as the member who created the API key.
https://api.qwryai.com/public/v1/tools/send_agent_messageFor a private note, call POST https://api.qwryai.com/public/v1/tools/add_internal_note with note in place of content.
Authentication
Send your API key as Authorization: Bearer YOUR_API_KEY. The key needs Manage conversations and helpdesk. See Authentication.
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The agent's id, from list_agents. |
conversationId | string | Yes | The ticket's conversation, as the _id that query_conversations or search_conversations returns. |
content | string | Yes | The reply the customer receives, 1 to 10,000 characters. |
| Name | Type | Required | Description |
|---|---|---|---|
chatbotId | string | Yes | The agent's id, from list_agents. |
conversationId | string | Yes | The ticket's conversation, as the _id that query_conversations or search_conversations returns. |
note | string | Yes | The note for your team, 1 to 5,000 characters. The customer never sees it. |
Finding the ticket's conversation
These tools take the conversation's _id, not the ticket number. Find it with query_conversations, filtering by the customer's name or email in contact:
curl -X POST 'https://api.qwryai.com/public/v1/tools/query_conversations' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"chatbotId": "YOUR_AGENT_ID",
"startDate": "2026-11-30",
"endDate": "2026-11-30",
"page": 1,
"contact": "sam.tester@example.com"
}'Each item's _id is the value to pass as conversationId. See List conversations.
Request example
curl -X POST 'https://api.qwryai.com/public/v1/tools/send_agent_message' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"chatbotId": "YOUR_AGENT_ID",
"conversationId": "CONVERSATION_ID",
"content": "Hi Sam, the courier confirmed order 1043 arrives tomorrow. Sorry for the wait!"
}'const response = await fetch("https://api.qwryai.com/public/v1/tools/send_agent_message", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
chatbotId: "YOUR_AGENT_ID",
conversationId: "CONVERSATION_ID",
content: "Hi Sam, the courier confirmed order 1043 arrives tomorrow. Sorry for the wait!",
}),
});
const { data } = await response.json();import requests
response = requests.post(
"https://api.qwryai.com/public/v1/tools/add_internal_note",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"chatbotId": "YOUR_AGENT_ID",
"conversationId": "CONVERSATION_ID",
"note": "Courier confirmed delivery for tomorrow.",
},
)
data = response.json()["data"]Response
Neither tool is reviewed: the reply or note is sent as soon as the call succeeds.
{
"success": true,
"data": {
"conversationId": "CONVERSATION_ID",
"messageId": "<messageId>",
"sent": true
}
}{
"success": true,
"data": {
"conversationId": "CONVERSATION_ID",
"noteId": "<noteId>",
"added": true
}
}| Field | Type | Description |
|---|---|---|
conversationId | string | The conversation you wrote in. |
messageId | string or null | The reply's message id. |
noteId | string | The note's message id. |
sent, added | boolean | true once the reply or note is saved. |
To close the conversation afterwards, call resolve_conversation with the same conversationId.
Errors
| HTTP status | code | When |
|---|---|---|
| 400 | INVALID_ARGUMENTS | conversationId isn't a conversation _id, or content or note is empty or too long. |
| 400 | CHATBOT_ID_REQUIRED | chatbotId is missing or isn't a valid agent id. |
| 403 | INSUFFICIENT_PERMISSION | The key doesn't hold Manage conversations and helpdesk. |
| 404 | CHATBOT_NOT_FOUND | No agent with that chatbotId in your workspace. |
| 404 | CONVERSATION_NOT_FOUND | No conversation with that id belongs to this agent. |
If the Inbox refuses the reply, the error carries the Inbox's own code and HTTP status. See Error Handling for authentication and rate-limit errors.