Skip to content
QwryAI
Documentation
Pages

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.

POSThttps://api.qwryai.com/public/v1/tools/send_agent_message

For 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

NameTypeRequiredDescription
chatbotIdstringYesThe agent's id, from list_agents.
conversationIdstringYesThe ticket's conversation, as the _id that query_conversations or search_conversations returns.
contentstringYesThe reply the customer receives, 1 to 10,000 characters.

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:

Bash
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

Bash
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!"
  }'

Response

Neither tool is reviewed: the reply or note is sent as soon as the call succeeds.

JSON
{
  "success": true,
  "data": {
    "conversationId": "CONVERSATION_ID",
    "messageId": "<messageId>",
    "sent": true
  }
}
FieldTypeDescription
conversationIdstringThe conversation you wrote in.
messageIdstring or nullThe reply's message id.
noteIdstringThe note's message id.
sent, addedbooleantrue once the reply or note is saved.

To close the conversation afterwards, call resolve_conversation with the same conversationId.

Errors

HTTP statuscodeWhen
400INVALID_ARGUMENTSconversationId isn't a conversation _id, or content or note is empty or too long.
400CHATBOT_ID_REQUIREDchatbotId is missing or isn't a valid agent id.
403INSUFFICIENT_PERMISSIONThe key doesn't hold Manage conversations and helpdesk.
404CHATBOT_NOT_FOUNDNo agent with that chatbotId in your workspace.
404CONVERSATION_NOT_FOUNDNo 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.

Explore the documentation