Docs menuSend a message to an App Channel
API documentationBahasa Indonesia

POST/api/v2/app-channels/{id}/messages

Send a message to an App Channel

Pass one message from a user of your app into the Inbox; the AI Agent's and automations' replies come back in the response.

The message enters the Inbox as a chat labelled App (Aplikasi), one chat per external_user_id. Incoming message automations (Pesan masuk) and the channel's AI Agent answer it like a website live chat, and their replies are in replies. Everything sent in that chat later (team replies, files, the reply when the chat is handed over) goes to your app through the message.sent webhook. When the AI answers, the request takes a few seconds, so give it a 60-second timeout. Call it from your app's server only, with an Idempotency-Key: a message with the same key is never stored twice (the response is 200 when that message was already stored). See the App Channel guide.

Send an Idempotency-Key header (for example a new UUID per request). A repeat with the same key within 24 hours gets the first answer again, so nothing is sent twice.

When the chat has no contact yet, name, phone, or email links it to the contact with the same number or email, or creates a new contact. Without any of them, the chat stays without a contact, like an anonymous live chat.

AI and automation replies are in replies and are also sent through message.sent; use message_id so they are not shown twice.

Key
kf_live_ / kf_test_… in the Authorization: Bearer header. Created in Settings › API & Webhook › Create key (Pengaturan › API & Webhook › Buat kunci).
Key scope
app_channels:write
Plan feature
WhatsApp sending API, Website live chat

Path parameters

  • idintegerrequired

    App Channel id, shown in the channel's connection steps in Live Chat.

Body (JSON)

  • external_user_idstringrequired

    The user's id in your app: 1–120 letters, digits, or . _ : @ -. One user = one chat in the Inbox.

  • textstringrequired

    The user's message, at most 4,000 characters.

  • namestring

    The user's name, shown in the Inbox.

  • phonestring

    Number with country code, 8–15 digits. Links the chat to the contact with the same number.

  • emailstring

    Email. Links the chat to the contact with the same email.

Possible errors

Try it

Try it with a test key
Path parameters
/api/v2/app-channels/{id}/messages

Send WhatsApp from your system with the Klik Flow API.

Mulai dengan paket Free. Ajak tim setelah ruang kerja siap.