Docs menuSend a message
API documentationBahasa Indonesia

POST/api/v2/messages

Send a message

One endpoint for WhatsApp (scan QR) and WhatsApp Official: text, a file, a template, or an OTP code.

Choose the channel with channel. Klik Flow uses the first number the key may use, or the number in from. Outside 24 hours since the customer last wrote, WhatsApp Official can only send template or otp. Send an Idempotency-Key header so a retry does not produce a second message. Test keys send only to test numbers.

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.

OTP code: {"channel":"whatsapp_official","to":"62812…","type":"otp","otp":{"template":"kode_login","code":"482913"}}.

Key
kf_live_ / kf_test_… in the Authorization: Bearer header. Created in Settings › API & Webhook › Create key (Pengaturan › API & Webhook › Buat kunci).
Key scope
messages:send
Plan feature
WhatsApp sending API

Body (JSON)

  • channelstring: whatsapp_qr | whatsapp_officialrequired

    Sending channel.

  • tostringrequired

    Destination number with country code; 08… is changed to 628….

  • typestring: text | image | video | audio | document | template | otprequired

    Message type. template and otp are for whatsapp_official only.

  • fromstring

    A specific sender number: the device id (whatsapp_qr) or number id (whatsapp_official), from GET /api/v2/channels.

  • textobject

    { "body": "…" }, at most 4,000 characters. For type text.

  • mediaobject

    url (https) or base64 + mime, with filename and caption. For file types.

  • templateobject

    name, language, variables (object or array), header_variables, media_url, button_url, coupon_code.

  • otpobject

    template (an Authentication template) and code (1–15 letters, digits, or -). The code is not stored.

Possible errors

Try it

Try it with a test key
/api/v2/messages

Send WhatsApp from your system with the Klik Flow API.

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