v1

latestOpenAPI 3.0.32026-07-26870417.2 KB
ai

Trigger AI Reply

Triggers an AI-generated reply to a specific message in a chat. The AI agent processes the message context and generates an appropriate response asynchronously.

Requirements:

  • Organization must have an active subscription
  • Organization must be on the Pro plan
  • AI agent must be enabled at the organization level
  • AI agent must be enabled for the specific chat

This is an asynchronous endpoint - it queues the AI reply for processing and returns immediately with a trace ID for tracking.

post/ai/reply

Headers

x-phonestring
Example:919874532456

The connected WhatsApp phone number for scope validation

Request body

chat_idstring required

The unique identifier of the chat to reply in

unique_idstring required

The unique_id of the message to reply to. The AI will use this message and its surrounding context to generate a reply

org_phonestring required

The phone number of the organization (connected WhatsApp number) in the format country_code + number without special characters

Example request

{
  "chat_id": "120363025896399300@g.us",
  "unique_id": "BAE58B775A57D71E",
  "org_phone": "919874532456"
}

Response

AI reply triggered successfully

successboolean
messagestring
trace_idstring uuid

A unique trace ID for tracking the AI reply processing

Example response

{
  "success": true,
  "message": "AI reply triggered",
  "trace_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
All 87 operations