{
"query": "Hello",
"pid": "3..",
"chatbot_id": "DKDvwn...",
"user_context": {
"session_id": "918727...",
"platform": "whatsapp"
}
}| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | User message received from WhatsApp. |
pid | string | Yes | Project ID associated with the chatbot. |
chatbot_id | string | Yes | Unique chatbot identifier that should process the WhatsApp message. |
user_context | object | Yes | Additional context about the WhatsApp user, session, or client application. |
user_context.session_id | string | No | Unique WhatsApp conversation identifier. This can be the user’s WhatsApp number or another stable session ID. |
user_context.platform | string | Yes | Platform where the message originated. For this endpoint, use whatsapp. |
{
"message": "Success",
"data": {
"answer": "Hello! How can I help you with your setup today?",
"session_id": "918727..."
}
}| Field | Type | Description |
|---|---|---|
message | string | Status message for the WhatsApp chat request. |
data | object | Contains the AI-generated response and session details. |
data| Field | Type | Description |
|---|---|---|
answer | string | AI-generated response returned by the chatbot. |
session_id | string | WhatsApp conversation session identifier associated with the response. |
{
"message": "Unauthorized",
"error": {
"code": "UNAUTHORIZED",
"detail": "Authentication token is missing or invalid."
}
}message, data.answer, and data.session_id.session_id is commonly mapped to the user’s WhatsApp phone number or a unique conversation ID.chatbot_id must belong to the specified project ID.answer can be forwarded back to the WhatsApp user through your WhatsApp messaging provider or webhook handler.curl --location 'https://agents.robofy.ai/v1/ai-agent/whatsapp/chat' \
--header 'Content-Type: application/json' \
--data '{
"query": "Hello",
"pid": "3..",
"chatbot_id": "DKDvwn...",
"user_context": {
"session_id": "918727...",
"platfrom": "whatsapp"
}
}'{
"message": "Success",
"data": {
"answer": "Hello! How can I help you with your setup today?",
"session_id": "918727..."
}
}