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.
Path parameters
idintegerrequiredApp Channel id, shown in the channel's connection steps in Live Chat.
Body (JSON)
external_user_idstringrequiredThe user's id in your app: 1–120 letters, digits, or
. _ : @ -. One user = one chat in the Inbox.textstringrequiredThe user's message, at most 4,000 characters.
namestringThe user's name, shown in the Inbox.
phonestringNumber with country code, 8–15 digits. Links the chat to the contact with the same number.
emailstringEmail. Links the chat to the contact with the same email.
Possible errors
- 400
invalid_jsonBody is not valid JSON - 400
idempotency_key_invalidInvalid Idempotency-Key - 401
missing_keyAPI key not sent - 401
key_invalidUnknown API key - 401
key_revokedAPI key revoked - 401
key_expiredAPI key expired - 401
member_inactiveKey creator is no longer a member - 403
ip_not_allowedServer IP not in the key's list - 403
plan_no_apiPlan does not include the API for live keys - 403
tenant_blockedBusiness access suspended - 403
scope_missingKey lacks this permission - 403
permission_missingKey creator's role lacks this permission - 403
live_key_requiredLive key required - 403
app_channel_pausedApp Channel paused or outside the plan - 404
not_foundNot found - 409
idempotency_conflictIdempotency-Key used for different content - 409
request_in_progressThe same request is still being processed - 422
invalid_requestInvalid field - 422
invalid_phoneInvalid destination number - 422
message_too_longMessage too long - 429
rate_limitedToo many requests per minute - 500
internal_errorProblem at Klik Flow
Try it
Try it with a test key
/api/v2/app-channels/{id}/messages