{
  "info": {
    "name": "Klik Flow API",
    "description": "Semua endpoint API v2 Klik Flow. Isi variabel apiKey dengan Kunci API Anda sebelum mengirim. Panduan: /docs/api.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://klikflow.id"
    },
    {
      "key": "apiKey",
      "value": "KUNCI_API"
    }
  ],
  "item": [
    {
      "name": "API v2",
      "description": "Satu API untuk WhatsApp (scan QR) dan WhatsApp Official: kirim teks, file, template, dan OTP, balas percakapan, kelola kontak, baca saluran dan template. Kunci tes hanya ke nomor uji.",
      "item": [
        {
          "name": "Kirim pesan",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "messages"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"whatsapp_official\",\n  \"to\": \"6281234567890\",\n  \"type\": \"template\",\n  \"template\": {\n    \"name\": \"konfirmasi_pesanan\",\n    \"language\": \"id\",\n    \"variables\": {\n      \"nama\": \"Rina\",\n      \"orderid\": \"INV-2207\"\n    },\n    \"button_url\": \"INV-2207\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Satu endpoint untuk WhatsApp (scan QR) dan WhatsApp Official: teks, file, template, atau kode OTP.\n\nPilih saluran dengan `channel`. Klik Flow memakai nomor pertama yang boleh dipakai kunci, atau nomor di `from`. WhatsApp Official di luar 24 jam sejak pelanggan terakhir menulis hanya bisa `template` atau `otp`. Kirim header `Idempotency-Key` agar kirim ulang tidak menghasilkan pesan kedua. Kunci tes hanya mengirim ke nomor uji."
          }
        },
        {
          "name": "Status pesan",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/messages/99140",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "messages",
                "99140"
              ]
            },
            "description": "Status dan error pesan yang dikirim kunci ini.\n\nHanya pesan yang dikirim kunci yang sama. Isi pesan template Autentikasi tidak pernah ditampilkan."
          }
        },
        {
          "name": "Daftar percakapan",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/conversations?limit=25",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "conversations"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25"
                }
              ]
            },
            "description": "Percakapan dalam cakupan pembuat kunci, terbaru dulu.\n\nHalaman berikutnya dengan `cursor` = `next_cursor` dari jawaban sebelumnya. Nomor dan nama mengikuti masking role pembuat kunci. Kunci yang dibatasi ke nomor tertentu hanya melihat percakapan nomor itu."
          }
        },
        {
          "name": "Detail percakapan",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/conversations/812",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "conversations",
                "812"
              ]
            },
            "description": "Satu percakapan dalam cakupan pembuat kunci.\n\n`last_customer_at` menunjukkan kapan jendela 24 jam WhatsApp Official dimulai."
          }
        },
        {
          "name": "Pesan dalam percakapan",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/conversations/812/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "conversations",
                "812",
                "messages"
              ]
            },
            "description": "Pesan satu percakapan, terbaru dulu.\n\n`next_cursor` membuka pesan yang lebih lama."
          }
        },
        {
          "name": "Balas percakapan",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/conversations/812/messages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "conversations",
                "812",
                "messages"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"text\",\n  \"text\": {\n    \"body\": \"Ongkir ke Bandung Rp18.000, Kak.\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Balas teks atau file di percakapan yang bisa dilihat pembuat kunci, di saluran mana pun yang dibalas Inbox.\n\nWhatsApp Official butuh jendela 24 jam; di luarnya kirim template lewat Kirim pesan. Kunci tes hanya membalas percakapan dengan nomor uji. Pakai `Idempotency-Key`."
          }
        },
        {
          "name": "Cari kontak",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/contacts?search=rina",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "contacts"
              ],
              "query": [
                {
                  "key": "search",
                  "value": "rina"
                }
              ]
            },
            "description": "Kontak dalam cakupan pembuat kunci, diperbarui terakhir dulu.\n\nNomor disamarkan bila role pembuat kunci menyamarkannya."
          }
        },
        {
          "name": "Buat kontak",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/contacts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "contacts"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Rina\",\n  \"phone\": \"6281234567890\",\n  \"city\": \"Bandung\",\n  \"custom_fields\": {\n    \"member\": \"Gold\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Tambah kontak baru dengan nomor atau email.\n\nKontak dengan nomor atau email yang sama ditolak (409) dengan id yang sudah ada. Batas kontak paket berlaku. Field kustom memakai kunci field dari Pengaturan › Kontak."
          }
        },
        {
          "name": "Detail kontak",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/contacts/301",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "contacts",
                "301"
              ]
            },
            "description": "Satu kontak dalam cakupan pembuat kunci.\n\nNomor mengikuti masking role pembuat kunci."
          }
        },
        {
          "name": "Ubah kontak",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/contacts/301",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "contacts",
                "301"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"city\": \"Jakarta\",\n  \"custom_fields\": {\n    \"member\": \"Platinum\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Ubah field kontak; hanya field yang dikirim yang berubah.\n\nAturan sama dengan mengubah kontak di aplikasi, termasuk pemeriksaan nomor dan field kustom."
          }
        },
        {
          "name": "Daftar saluran",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/channels",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "channels"
              ]
            },
            "description": "Nomor WhatsApp yang boleh dipakai kunci ini, dengan statusnya.\n\n`from` di jawaban dipakai sebagai `from` di Kirim pesan."
          }
        },
        {
          "name": "Daftar template",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "templates"
              ]
            },
            "description": "Template WhatsApp Official beserta variabel yang harus diisi.\n\n`variables` menyebut field Kirim pesan untuk tiap isian: `variables`, `header_variables`, `media_url`, `button_url`, atau `coupon_code`."
          }
        },
        {
          "name": "Ajukan template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "templates"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel_id\": \"waba:3\",\n  \"template\": {\n    \"name\": \"pengingat_bayar\",\n    \"language\": \"id\",\n    \"category\": \"UTILITY\",\n    \"kind\": \"standard\",\n    \"parameterFormat\": \"NAMED\",\n    \"header\": {\n      \"format\": \"NONE\"\n    },\n    \"body\": \"Halo {{nama}}, tagihan {{orderid}} jatuh tempo besok.\",\n    \"bodyExamples\": {\n      \"nama\": \"Rina\",\n      \"orderid\": \"INV-2207\"\n    },\n    \"footer\": \"\",\n    \"buttons\": []\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Ajukan template WhatsApp Official baru untuk disetujui.\n\n`template` memakai bentuk yang sama dengan pembuat template di aplikasi dan diperiksa dengan aturan yang sama sebelum diajukan."
          }
        },
        {
          "name": "Daftar webhook",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks"
              ]
            },
            "description": "Webhook bisnis ini, dengan event, kesehatan 7 hari, dan jumlah kiriman gagal.\n\nSama dengan Pengaturan › API & Webhook › Webhook. Hanya kunci live: webhook menerima event sungguhan. Secret tidak pernah ada di jawaban ini."
          }
        },
        {
          "name": "Tambah webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://toko-anda.id/klikflow/webhook\",\n  \"events\": [\n    \"message.received\",\n    \"message.status\",\n    \"order.paid\"\n  ],\n  \"description\": \"Server toko\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Daftarkan URL HTTPS sistem Anda dan event yang ingin diterima.\n\nMaksimal 5 webhook per bisnis. Jawaban memuat `secret` sekali saja (bisa dilihat lagi di Pengaturan › API & Webhook). Pakai secret itu untuk memeriksa header `Klikflow-Signature`."
          }
        },
        {
          "name": "Detail webhook",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks/6",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks",
                "6"
              ]
            },
            "description": "Satu webhook dengan event dan kesehatannya.\n\nHanya kunci live."
          }
        },
        {
          "name": "Ubah webhook",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks/6",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks",
                "6"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"paused\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Ubah URL, event, keterangan, atau jeda dan aktifkan lagi.\n\nHanya field yang dikirim yang berubah. `status: active` setelah dijeda mengirim lagi kiriman yang menunggu, mulai sekarang."
          }
        },
        {
          "name": "Hapus webhook",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks/6",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks",
                "6"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Hapus webhook beserta log kirimannya.\n\nEvent berikutnya tidak dikirim lagi ke URL ini. Tidak bisa dibatalkan."
          }
        },
        {
          "name": "Kirim event uji",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks/6/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks",
                "6",
                "test"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event\": \"order.paid\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Kirim contoh satu event (ditandai `test: true`) sekarang, lalu lihat jawaban sistem Anda.\n\nContohnya sama dengan di panduan Event webhook. Event uji tidak diulang bila gagal dan tidak dihitung dalam kesehatan webhook."
          }
        },
        {
          "name": "Kunci saya",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "me"
              ]
            },
            "description": "Jenis kunci, izin yang bisa dipakai sekarang, dan saluran yang boleh dipakai.\n\nPanggil ini lebih dulu untuk memastikan kunci benar. `usable: false` berarti role pembuat kunci tidak lagi punya izin itu."
          }
        }
      ]
    }
  ]
}