{
  "info": {
    "name": "Klik Flow API",
    "description": "Every Klik Flow API v2 endpoint. Fill in the apiKey variable with your own API key before sending. Guides: /docs/en/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": "One API for WhatsApp (scan QR) and WhatsApp Official: send text, files, templates, and OTP codes, reply to conversations, manage contacts, and read channels and templates. Test keys reach test numbers only.",
      "item": [
        {
          "name": "Send a message",
          "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": "One endpoint for WhatsApp (scan QR) and WhatsApp Official: text, a file, a template, or an OTP code.\n\nChoose 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."
          }
        },
        {
          "name": "Message status",
          "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 and error of a message sent by this key.\n\nOnly messages sent by the same key. The content of Authentication template messages is never shown."
          }
        },
        {
          "name": "List conversations",
          "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": "Conversations the key's creator can see, newest first.\n\nGet the next page with `cursor` = `next_cursor` from the previous response. Numbers and names follow the masking of the key creator's role. A key limited to specific numbers only sees the conversations of those numbers."
          }
        },
        {
          "name": "Conversation details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/conversations/812",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "conversations",
                "812"
              ]
            },
            "description": "One conversation the key's creator can see.\n\n`last_customer_at` shows when the WhatsApp Official 24-hour window started."
          }
        },
        {
          "name": "Messages in a conversation",
          "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": "Messages of one conversation, newest first.\n\n`next_cursor` opens older messages."
          }
        },
        {
          "name": "Reply to a conversation",
          "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": "Reply with text or a file in a conversation the key's creator can see, on any channel the Inbox can reply on.\n\nWhatsApp Official needs the 24-hour window; outside it, send a template with Send a message. Test keys only reply to conversations with test numbers. Use `Idempotency-Key`."
          }
        },
        {
          "name": "Search contacts",
          "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": "Contacts the key's creator can see, most recently updated first.\n\nNumbers are masked when the key creator's role masks them."
          }
        },
        {
          "name": "Create a contact",
          "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": "Add a new contact with a number or an email.\n\nA contact with the same number or email is refused (409) with the existing id. The plan's contact limit applies. Custom fields use the field keys from Settings › Contacts (Pengaturan › Kontak)."
          }
        },
        {
          "name": "Contact details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/contacts/301",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "contacts",
                "301"
              ]
            },
            "description": "One contact the key's creator can see.\n\nThe number follows the masking of the key creator's role."
          }
        },
        {
          "name": "Update a contact",
          "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": "Change contact fields; only the fields sent change.\n\nSame rules as editing a contact in the app, including the number and custom field checks."
          }
        },
        {
          "name": "List channels",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/channels",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "channels"
              ]
            },
            "description": "WhatsApp numbers this key may use, with their status.\n\n`from` in the response is used as `from` in Send a message."
          }
        },
        {
          "name": "List templates",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "templates"
              ]
            },
            "description": "WhatsApp Official templates with the variables to fill.\n\n`variables` names the Send a message field for each value: `variables`, `header_variables`, `media_url`, `button_url`, or `coupon_code`."
          }
        },
        {
          "name": "Submit a 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": "Submit a new WhatsApp Official template for approval.\n\n`template` uses the same shape as the template builder in the app and is checked with the same rules before it is submitted."
          }
        },
        {
          "name": "List webhooks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks"
              ]
            },
            "description": "This business's webhooks, with their events, 7-day health, and number of failed deliveries.\n\nSame as Settings › API & Webhook › Webhook (Pengaturan › API & Webhook › Webhook). Live keys only: webhooks receive real events. The secret is never in this response."
          }
        },
        {
          "name": "Add a 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": "Register your system's HTTPS URL and the events you want to receive.\n\nAt most 5 webhooks per business. The response contains `secret` only once (it can be viewed again in Settings › API & Webhook (Pengaturan › API & Webhook)). Use that secret to check the `Klikflow-Signature` header."
          }
        },
        {
          "name": "Webhook details",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/webhooks/6",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "webhooks",
                "6"
              ]
            },
            "description": "One webhook with its events and health.\n\nLive keys only."
          }
        },
        {
          "name": "Update a 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": "Change the URL, events, or description, or pause and reactivate it.\n\nOnly the fields sent change. `status: active` after a pause sends the waiting deliveries again, starting now."
          }
        },
        {
          "name": "Delete a 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": "Delete a webhook together with its delivery log.\n\nLater events are no longer sent to this URL. This cannot be undone."
          }
        },
        {
          "name": "Send a test event",
          "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": "Send a sample of one event (marked `test: true`) now, then see your system's response.\n\nThe sample is the same as in the Webhook events guide. Test events are not retried when they fail and do not count toward the webhook's health."
          }
        },
        {
          "name": "My key",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{apiKey}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v2/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v2",
                "me"
              ]
            },
            "description": "The key type, the permissions it can use right now, and the channels it may use.\n\nCall this first to make sure the key is correct. `usable: false` means the key creator's role no longer has that permission."
          }
        }
      ]
    }
  ]
}