/api/v2/messagesKirim satu pesan
Mengantrekan satu pesan ke satu nomor/grup. Wajib header Idempotency-Key — request ulang dengan key & body yang sama mengembalikan hasil yang sama tanpa mengirim ganda (disimpan 24 jam).
| Parameter | Lokasi | Tipe | Keterangan |
|---|---|---|---|
| Idempotency-Key* | header | string | String unik per pesan (mis. UUID / ID order), maks 200 karakter. |
| deviceId* | body | integer | ID perangkat pengirim. |
| to* | body | string | Nomor tujuan (E.164 tanpa “+”, nomor lokal 08… dinormalisasi) atau JID grup. |
| content* | body | object | MessageContent — bentuk ditentukan type. Lihat “Tipe konten”. |
| priority | body | normal | high | Default normal. high untuk transaksi/OTP. |
| skipOptOut | body | boolean | Lewati daftar opt-out (khusus pesan transaksional). Default false. |
curl -X POST "https://app.kirimpesan.id/api/v2/messages" \
-H "Authorization: Bearer kp_live_xxxxxxxxxxxxxxxx" \
-H "Idempotency-Key: order-2041-7c0e2f4a" \
-H "Content-Type: application/json" \
-d '{
"deviceId": 12,
"to": "6281234567890",
"content": {
"type": "text",
"text": "Halo! Ini pesan uji dari dokumentasi API KirimPesan 👋"
}
}'{
"id": 98231,
"deviceId": 12,
"campaignId": null,
"direction": "outbound",
"source": "api",
"peer": "6281234567890",
"participant": null,
"type": "text",
"content": { "type": "text", "text": "Halo! Ini pesan uji…" },
"status": "queued",
"statusReason": null,
"priority": 3,
"attempts": 0,
"sentAt": null,
"deliveredAt": null,
"readAt": null,
"failedAt": null,
"createdAt": "2026-10-12T03:15:22.000Z"
}Kemungkinan error (5)
400bad_request — header Idempotency-Key tidak ada400validation_failed — body/content tidak valid404not_found — perangkat tidak ditemukan409idempotency_key_reused / idempotency_in_progress422invalid_phone / quota_exceeded