# Table of Contents - [Overview | Kirimdev](#overview-kirimdev) - [Platform mode overview | Kirimdev](#platform-mode-overview-kirimdev) - [Changelog | Kirimdev](#changelog-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Quickstart | Kirimdev](#quickstart-kirimdev) - [Authentication | Kirimdev](#authentication-kirimdev) - [Send image | Kirimdev](#send-image-kirimdev) - [Send text | Kirimdev](#send-text-kirimdev) - [Send video | Kirimdev](#send-video-kirimdev) - [Send audio | Kirimdev](#send-audio-kirimdev) - [Send document | Kirimdev](#send-document-kirimdev) - [Send interactive buttons | Kirimdev](#send-interactive-buttons-kirimdev) - [Send reply buttons | Kirimdev](#send-reply-buttons-kirimdev) - [Send interactive lists | Kirimdev](#send-interactive-lists-kirimdev) - [React to messages | Kirimdev](#react-to-messages-kirimdev) - [Mark messages as read | Kirimdev](#mark-messages-as-read-kirimdev) - [Send templates | Kirimdev](#send-templates-kirimdev) - [Receive messages | Kirimdev](#receive-messages-kirimdev) - [Send templates with buttons | Kirimdev](#send-templates-with-buttons-kirimdev) - [Send templates with a media header | Kirimdev](#send-templates-with-a-media-header-kirimdev) - [Create templates | Kirimdev](#create-templates-kirimdev) - [Send OTP (authentication templates) | Kirimdev](#send-otp-authentication-templates-kirimdev) - [Send templates with named parameters | Kirimdev](#send-templates-with-named-parameters-kirimdev) - [Send templates with a Flow button | Kirimdev](#send-templates-with-a-flow-button-kirimdev) - [Event Catalogue | Kirimdev](#event-catalogue-kirimdev) - [Webhooks Overview | Kirimdev](#webhooks-overview-kirimdev) - [Verifying Signatures | Kirimdev](#verifying-signatures-kirimdev) - [Payload Examples | Kirimdev](#payload-examples-kirimdev) - [SDK Quickstart | Kirimdev](#sdk-quickstart-kirimdev) - [TypeScript SDK | Kirimdev](#typescript-sdk-kirimdev) - [SDK Errors | Kirimdev](#sdk-errors-kirimdev) - [SDK Pagination | Kirimdev](#sdk-pagination-kirimdev) - [MCP Server | Kirimdev](#mcp-server-kirimdev) - [Setup | Kirimdev](#setup-kirimdev) - [SDK Webhooks | Kirimdev](#sdk-webhooks-kirimdev) - [Prompting the AI | Kirimdev](#prompting-the-ai-kirimdev) - [Hermes Agent Integration | Kirimdev](#hermes-agent-integration-kirimdev) - [Hermes Setup | Kirimdev](#hermes-setup-kirimdev) - [Errors | Kirimdev](#errors-kirimdev) - [Available Tools | Kirimdev](#available-tools-kirimdev) - [Idempotency | Kirimdev](#idempotency-kirimdev) - [Rate Limits | Kirimdev](#rate-limits-kirimdev) - [Polling list endpoints | Kirimdev](#polling-list-endpoints-kirimdev) - [Pagination | Kirimdev](#pagination-kirimdev) - [Resource IDs | Kirimdev](#resource-ids-kirimdev) - [Message Retention | Kirimdev](#message-retention-kirimdev) - [Jendela 24 jam & template (FAQ) | Kirimdev](#jendela-24-jam-template-faq-kirimdev) - [Subscribe to Webhooks | Kirimdev](#subscribe-to-webhooks-kirimdev) - [Handle Failed Sends | Kirimdev](#handle-failed-sends-kirimdev) - [Retries & Auto-Disable | Kirimdev](#retries-auto-disable-kirimdev) - [Sync Your CRM | Kirimdev](#sync-your-crm-kirimdev) - [WhatsApp Business payment setup | Kirimdev](#whatsapp-business-payment-setup-kirimdev) - [Send WhatsApp Order Notifications | Kirimdev](#send-whatsapp-order-notifications-kirimdev) - [Broadcast | Kirimdev](#broadcast-kirimdev) - [WhatsApp Support Bot with n8n + AI | Kirimdev](#whatsapp-support-bot-with-n8n-ai-kirimdev) - [Webhook number filters keep working after a number is reconnected | Kirimdev](#webhook-number-filters-keep-working-after-a-number-is-reconnected-kirimdev) - [message.sent outbound webhook | Kirimdev](#message-sent-outbound-webhook-kirimdev) - [Automatic WhatsApp slots for setup-link onboarding | Kirimdev](#automatic-whatsapp-slots-for-setup-link-onboarding-kirimdev) - [message.sent media_url for outbound attachments | Kirimdev](#message-sent-media-url-for-outbound-attachments-kirimdev) - [New `setup_link_inactive` error code replaces wrong-domain `webhook_subscription_disabled` on customer setup links | Kirimdev](#new-setup-link-inactive-error-code-replaces-wrong-domain-webhook-subscription-disabled-on-customer-setup-links-kirimdev) - [Contextual replies on Public API sends | Kirimdev](#contextual-replies-on-public-api-sends-kirimdev) - [Voice note played status + played_at on messages | Kirimdev](#voice-note-played-status-played-at-on-messages-kirimdev) - [Contact erasure now covers linked hosted-chat data | Kirimdev](#contact-erasure-now-covers-linked-hosted-chat-data-kirimdev) - [AI Agent labels now send contact.updated | Kirimdev](#ai-agent-labels-now-send-contact-updated-kirimdev) - [Labels in contact and conversation responses | Kirimdev](#labels-in-contact-and-conversation-responses-kirimdev) - [Sends to a blocked contact are refused with contact_blocked | Kirimdev](#sends-to-a-blocked-contact-are-refused-with-contact-blocked-kirimdev) - [Enriched message.received webhooks | Kirimdev](#enriched-message-received-webhooks-kirimdev) - [Dropped the duplicate `token` field from customer setup link create responses | Kirimdev](#dropped-the-duplicate-token-field-from-customer-setup-link-create-responses-kirimdev) - [One slow webhook endpoint no longer delays everyone's events | Kirimdev](#one-slow-webhook-endpoint-no-longer-delays-everyone-s-events-kirimdev) - [Message status error details restored | Kirimdev](#message-status-error-details-restored-kirimdev) - [MCP server adds OAuth sign-in | Kirimdev](#mcp-server-adds-oauth-sign-in-kirimdev) - [Pre-send compliance checks on POST /messages | Kirimdev](#pre-send-compliance-checks-on-post-messages-kirimdev) - [Operator suspend now blocks outbound sends on customer-owned accounts | Kirimdev](#operator-suspend-now-blocks-outbound-sends-on-customer-owned-accounts-kirimdev) - [Faster Public API polling | Kirimdev](#faster-public-api-polling-kirimdev) - [Hermes integration docs clarified | Kirimdev](#hermes-integration-docs-clarified-kirimdev) - [MCP server supports protocol revision 2026-07-28 | Kirimdev](#mcp-server-supports-protocol-revision-2026-07-28-kirimdev) - [Clearer undeliverable message errors | Kirimdev](#clearer-undeliverable-message-errors-kirimdev) - [WhatsApp reactions in Public API v1 | Kirimdev](#whatsapp-reactions-in-public-api-v1-kirimdev) - [Guide — message correlation & tenant routing for platform mode | Kirimdev](#guide-message-correlation-tenant-routing-for-platform-mode-kirimdev) - [Clearer template validation errors | Kirimdev](#clearer-template-validation-errors-kirimdev) - [BSUID identity-change ingestion & webhook accuracy | Kirimdev](#bsuid-identity-change-ingestion-webhook-accuracy-kirimdev) - [Disconnect a customer's WhatsApp account over the Public API | Kirimdev](#disconnect-a-customer-s-whatsapp-account-over-the-public-api-kirimdev) - [/v1/me now returns the org's teams | Kirimdev](#-v1-me-now-returns-the-org-s-teams-kirimdev) - [MCP adds safe bulk labeling by message keyword | Kirimdev](#mcp-adds-safe-bulk-labeling-by-message-keyword-kirimdev) - [Create templates with media header from public URL | Kirimdev](#create-templates-with-media-header-from-public-url-kirimdev) - [Complete contact and conversation pagination | Kirimdev](#complete-contact-and-conversation-pagination-kirimdev) - [Template parameters are checked before sending | Kirimdev](#template-parameters-are-checked-before-sending-kirimdev) - [Webhooks for pre-delivery send failures + longer transient retries | Kirimdev](#webhooks-for-pre-delivery-send-failures-longer-transient-retries-kirimdev) - [MCP server gains label tools | Kirimdev](#mcp-server-gains-label-tools-kirimdev) - [Webhook deliveries now tell you why they failed | Kirimdev](#webhook-deliveries-now-tell-you-why-they-failed-kirimdev) - [Customers — multi-tenant platform mode | Kirimdev](#customers-multi-tenant-platform-mode-kirimdev) - [Message history is now deleted after your plan's retention window | Kirimdev](#message-history-is-now-deleted-after-your-plan-s-retention-window-kirimdev) - [A past-due subscription no longer reports itself as a quota problem | Kirimdev](#a-past-due-subscription-no-longer-reports-itself-as-a-quota-problem-kirimdev) - [Setup links | Kirimdev](#setup-links-kirimdev) - [Quickstart | Kirimdev](#quickstart-kirimdev) - [Voice notes + faster inbound media downloads | Kirimdev](#voice-notes-faster-inbound-media-downloads-kirimdev) - [MCP retries, limits, and audit controls hardened | Kirimdev](#mcp-retries-limits-and-audit-controls-hardened-kirimdev) - [BSUID + WhatsApp username support | Kirimdev](#bsuid-whatsapp-username-support-kirimdev) - [Hermes Agent integration docs | Kirimdev](#hermes-agent-integration-docs-kirimdev) - [MCP server gains 5 new tools | Kirimdev](#mcp-server-gains-5-new-tools-kirimdev) - [Edit message templates via API and SDK | Kirimdev](#edit-message-templates-via-api-and-sdk-kirimdev) - [Template names are validated, and inbound messages with control characters no longer disappear | Kirimdev](#template-names-are-validated-and-inbound-messages-with-control-characters-no-longer-disappear-kirimdev) - [API reference readability improvements | Kirimdev](#api-reference-readability-improvements-kirimdev) - [Onboarding flow | Kirimdev](#onboarding-flow-kirimdev) - [Customers | Kirimdev](#customers-kirimdev) - [Redirect URLs | Kirimdev](#redirect-urls-kirimdev) - [media_upload_failed names the real cause, WebP uploads are rejected early, and the failed-sends error tables are corrected | Kirimdev](#media-upload-failed-names-the-real-cause-webp-uploads-are-rejected-early-and-the-failed-sends-error-tables-are-corrected-kirimdev) - [Media card carousel templates (create + send) | Kirimdev](#media-card-carousel-templates-create-send-kirimdev) - [Header and footer on interactive CTA URL messages | Kirimdev](#header-and-footer-on-interactive-cta-url-messages-kirimdev) - [Panduan FAQ jendela 24 jam & template | Kirimdev](#panduan-faq-jendela-24-jam-template-kirimdev) - [Revoke/edit webhook events and unsupported sub-kind hint | Kirimdev](#revoke-edit-webhook-events-and-unsupported-sub-kind-hint-kirimdev) - [Interactive reply buttons | Kirimdev](#interactive-reply-buttons-kirimdev) - [Initial release | Kirimdev](#initial-release-kirimdev) - [Per-account filter for webhook subscriptions | Kirimdev](#per-account-filter-for-webhook-subscriptions-kirimdev) - [Webhooks | Kirimdev](#webhooks-kirimdev) - [Template responses now include category | Kirimdev](#template-responses-now-include-category-kirimdev) - [Message correlation & tenant routing | Kirimdev](#message-correlation-tenant-routing-kirimdev) - [Register a WhatsApp number via API and SDK | Kirimdev](#register-a-whatsapp-number-via-api-and-sdk-kirimdev) - [Create message templates via API, SDK, and MCP | Kirimdev](#create-message-templates-via-api-sdk-and-mcp-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Introspect the calling API key | Kirimdev](#introspect-the-calling-api-key-kirimdev) - [Delete a label | Kirimdev](#delete-a-label-kirimdev) - [Fetch a label by id | Kirimdev](#fetch-a-label-by-id-kirimdev) - [Delete a webhook subscription | Kirimdev](#delete-a-webhook-subscription-kirimdev) - [List connected WhatsApp accounts | Kirimdev](#list-connected-whatsapp-accounts-kirimdev) - [Update a customer | Kirimdev](#update-a-customer-kirimdev) - [Archive a customer | Kirimdev](#archive-a-customer-kirimdev) - [Create a label | Kirimdev](#create-a-label-kirimdev) - [Fetch a contact by id | Kirimdev](#fetch-a-contact-by-id-kirimdev) - [Fetch a conversation by id | Kirimdev](#fetch-a-conversation-by-id-kirimdev) - [Overview | Kirimdev](#overview-kirimdev) - [Detach a label from a contact | Kirimdev](#detach-a-label-from-a-contact-kirimdev) - [Redirect to the media asset for a message | Kirimdev](#redirect-to-the-media-asset-for-a-message-kirimdev) - [Detach a label from a conversation | Kirimdev](#detach-a-label-from-a-conversation-kirimdev) - [Delete a contact | Kirimdev](#delete-a-contact-kirimdev) - [List customers | Kirimdev](#list-customers-kirimdev) - [Liveness probe | Kirimdev](#liveness-probe-kirimdev) - [Fetch a sent message by id | Kirimdev](#fetch-a-sent-message-by-id-kirimdev) - [Attach or detach a label across many contacts | Kirimdev](#attach-or-detach-a-label-across-many-contacts-kirimdev) - [List messages | Kirimdev](#list-messages-kirimdev) - [Update redirect URLs on an active setup link | Kirimdev](#update-redirect-urls-on-an-active-setup-link-kirimdev) - [Register a phone number | Kirimdev](#register-a-phone-number-kirimdev) - [List webhook deliveries | Kirimdev](#list-webhook-deliveries-kirimdev) - [List setup links for a customer | Kirimdev](#list-setup-links-for-a-customer-kirimdev) - [Update a label | Kirimdev](#update-a-label-kirimdev) - [Replay deliveries in bulk (DLQ) | Kirimdev](#replay-deliveries-in-bulk-dlq-kirimdev) - [Fetch a customer by id | Kirimdev](#fetch-a-customer-by-id-kirimdev) - [Update a webhook subscription | Kirimdev](#update-a-webhook-subscription-kirimdev) - [List templates | Kirimdev](#list-templates-kirimdev) - [Update a contact | Kirimdev](#update-a-contact-kirimdev) - [Create a webhook subscription | Kirimdev](#create-a-webhook-subscription-kirimdev) - [Attach a label to a conversation | Kirimdev](#attach-a-label-to-a-conversation-kirimdev) - [Disconnect a WhatsApp account from a customer | Kirimdev](#disconnect-a-whatsapp-account-from-a-customer-kirimdev) - [Create a customer | Kirimdev](#create-a-customer-kirimdev) - [Add a new signing secret (rotation) | Kirimdev](#add-a-new-signing-secret-rotation-kirimdev) - [Fetch one webhook subscription | Kirimdev](#fetch-one-webhook-subscription-kirimdev) - [Fetch a single template by name | Kirimdev](#fetch-a-single-template-by-name-kirimdev) - [Revoke a signing secret | Kirimdev](#revoke-a-signing-secret-kirimdev) - [Create a contact | Kirimdev](#create-a-contact-kirimdev) - [Update a conversation | Kirimdev](#update-a-conversation-kirimdev) - [Revoke a setup link | Kirimdev](#revoke-a-setup-link-kirimdev) - [Replay a single delivery | Kirimdev](#replay-a-single-delivery-kirimdev) - [List contacts | Kirimdev](#list-contacts-kirimdev) - [List webhook subscriptions | Kirimdev](#list-webhook-subscriptions-kirimdev) - [Fetch one delivery (with full payload) | Kirimdev](#fetch-one-delivery-with-full-payload-kirimdev) - [List labels | Kirimdev](#list-labels-kirimdev) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/#_top) Getting started Overview ======== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev is the WhatsApp Cloud API, packaged for developers. Clean REST, predictable contracts, batteries-included webhooks, real-time receipts. [Quickstart](https://docs.kirimdev.com/quickstart/) [API Reference](https://docs.kirimdev.com/api/) Why Kirimdev ------------ [Section titled “Why Kirimdev”](https://docs.kirimdev.com/#why-kirimdev) One bearer token, full org access Issue keys in the dashboard, pass them as `Authorization: Bearer kdv_live_…`, and you’re done. No OAuth dance, no PKCE, no refresh tokens. Meta-style path routing Sender lives in the URL path (`POST /v1/{phone_number_id}/messages`) — drop-in compatible with Meta’s WhatsApp Cloud API. Copy-paste a payload from Meta’s docs and it works. Production-grade webhooks HMAC-SHA256 signatures, 8-attempt exponential backoff, dead-letter queue, single + bulk replay, secret rotation with overlap windows. Stable contracts Every endpoint is permanent the moment it ships. Adding fields is non-breaking. Programmatic error codes are forever-stable. Send a message in five lines ---------------------------- [Section titled “Send a message in five lines”](https://docs.kirimdev.com/#send-a-message-in-five-lines) * [TypeScript](https://docs.kirimdev.com/#tab-panel-66) * [cURL](https://docs.kirimdev.com/#tab-panel-67) * [Python](https://docs.kirimdev.com/#tab-panel-68) * [n8n](https://docs.kirimdev.com/#tab-panel-69) import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers('106540352242922') await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'text', text: { body: 'Halo dari Kirimdev' },}) curl https://api.kirimdev.com/v1/106540352242922/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": { "body": "Halo dari Kirimdev" } }' import os, httpx httpx.post( "https://api.kirimdev.com/v1/106540352242922/messages", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}, json={ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": {"body": "Halo dari Kirimdev"}, },) Install `@kirimdev/n8n-nodes-kirim`, add a **Kirim** action node, pick **Message → Send Text**, select your account from the **From** dropdown, fill **To** and **Message**. Full walkthrough in the [Support Bot recipe](https://docs.kirimdev.com/recipes/support-bot/) . The recipient sees the WhatsApp message in a couple of seconds. What’s inside ------------- [Section titled “What’s inside”](https://docs.kirimdev.com/#whats-inside) 35+ endpoints Message send + read, contact CRUD, conversation lifecycle, label management, webhook operations, delivery observability. OpenAPI 3.1 spec [`/v1/openapi.json`](https://api.kirimdev.com/v1/openapi.json) — generate SDKs, validate schemas, import into Postman or Insomnia. Real-time receipts Inbound messages and status callbacks fanned out to subscribers within seconds of Meta delivering them to Kirimdev. Audit log Every authenticated API call is logged and queryable in the dashboard for 30 days, with full request/response context. TypeScript SDK `@kirimdev/sdk` with auto-retry, automatic `Idempotency-Key`, async pagination, and typed errors. n8n integration `@kirimdev/n8n-nodes-kirim` — drag-and-drop messaging in n8n workflows, including AI Agent tool support. Hermes Agent Self-hosted WhatsApp AI gateway via the open-source [kirimdev-hermes](https://github.com/kirimdev/kirimdev-hermes) plugin. [Guide →](https://docs.kirimdev.com/tools/hermes/) Where to start -------------- [Section titled “Where to start”](https://docs.kirimdev.com/#where-to-start) Quickstart Send your first WhatsApp message in five minutes flat, end to end. [Read →](https://docs.kirimdev.com/quickstart/) Webhooks 101 Subscribe to events, verify HMAC signatures, deduplicate by event id. [Read →](https://docs.kirimdev.com/webhooks/overview/) API Reference Every endpoint, every parameter, every error code — generated live from the production OpenAPI spec. [Browse →](https://docs.kirimdev.com/api/) Recipes End-to-end patterns: order notifications, AI support bot, broadcast campaigns. [Browse →](https://docs.kirimdev.com/recipes/order-notifications/) --- # Platform mode overview | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/#_top) Platform mode overview ====================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2F%20and%20help%20me%20with%20the%20following%3A%20) If you’re building a **SaaS that resells WhatsApp messaging to your own clients** — a CRM for logistics companies, a helpdesk for retail brands, an agency managing 200 client inboxes — _platform mode_ gives each of your tenants a first-class home on Kirimdev. Each end-customer: * Connects their own WhatsApp Business number via Meta Embedded Signup * Keeps their own inbox, contacts, and message history * Gets attributed back to your organization via every API response * Stays cleanly isolated when archived …all under your single Kirimdev integration. The mental model ---------------- [Section titled “The mental model”](https://docs.kirimdev.com/platform/#the-mental-model) Each row owns the rows nested beneath it. Soft delete cascades inward (archive a customer → its accounts remain); hard delete never happens. | Layer | Example | Public id | Owns | | --- | --- | --- | --- | | Organization | ”Your Platform Inc” | `org_…` | Teams | | └─ Team | ”Operations” | (internal) | Customers + direct-org accounts | | └─ Customer | ”Acme Logistics — Jakarta” | `cus_…` | One or more WhatsApp accounts | | └─ WhatsApp account | +6281-1111-1111 | `phone_number_id` | Conversations, contacts, messages | | Layer | Owns | API surface | | --- | --- | --- | | **Organization** | Your platform’s Kirimdev account | `/v1/me` | | **Team** | An operations unit inside the org | Returned in `/v1/me` | | **Customer** | Your end-tenant (logistics company, store, agency, …) | `/v1/customers` | | **WhatsApp account** | A single phone number a customer owns | `/v1/accounts` | | **Conversation / Message / Contact** | Customer’s chats and partners | `/v1/{phone_number_id}/...` | When to use it -------------- [Section titled “When to use it”](https://docs.kirimdev.com/platform/#when-to-use-it) Good fits * A SaaS automating reminders for 200+ tenant businesses, each with their own number * An agency managing WhatsApp for 50 client brands * An e-commerce platform sending order updates from each store’s own number * A helpdesk where every business owns their support number Don't use it for * A single in-house team running their own numbers — just connect them under your Team directly, no Customer layer needed * WhatsApp chat partners — those go to `contacts` What’s included --------------- [Section titled “What’s included”](https://docs.kirimdev.com/platform/#whats-included) | Surface | Where | | --- | --- | | Public REST API (`/v1/customers/*`) | Same auth and conventions as the rest of `/v1` — bearer token, idempotency keys, error envelope | | Onboarding page (`{APP_URL}/onboard/{token}`) | Branded landing page your end-customer opens to complete Meta Embedded Signup | | TypeScript SDK (`kirim.customers`) | `@kirimdev/sdk` ≥ 3.3 | | Webhook events | Six `customer.*` event types | | MCP server tools | Five customer-scoped tools for AI agent integration | | Dashboard pages | `/customers` list + detail in the operator dashboard | Where to start -------------- [Section titled “Where to start”](https://docs.kirimdev.com/platform/#where-to-start) Quickstart Five minutes from `kirim.customers.create({...})` to a tenant sending their first message. [Open quickstart](https://docs.kirimdev.com/platform/quickstart/) Customers Concept reference — fields, status transitions, multi-team resolution. [Read customers](https://docs.kirimdev.com/platform/customers/) Setup links How tokens are minted, stored, expired, and consumed — plus the security model. [Read setup links](https://docs.kirimdev.com/platform/setup-links/) Onboarding flow The end-to-end sequence diagram from `POST /setup_links` to `customer.onboarded`. [Read flow](https://docs.kirimdev.com/platform/onboarding-flow/) Redirect URLs Stripe Connect-style return URLs that bounce the tenant back to your own UI. [Read redirects](https://docs.kirimdev.com/platform/redirect-urls/) Webhooks Six `customer.*` events with realistic sample payloads. [Read webhooks](https://docs.kirimdev.com/platform/webhooks/) Message correlation Route each message webhook to the right tenant, and link a `msg_…` send to its `wamid` status updates. [Read correlation](https://docs.kirimdev.com/platform/message-correlation/) [Start the quickstart →](https://docs.kirimdev.com/platform/quickstart/) --- # Changelog | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/#_top) Changelog ========= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F%20and%20help%20me%20with%20the%20following%3A%20) Every customer-visible change to the Kirimdev platform ships with a release note here — new endpoints, SDK versions, MCP tool additions, behavior changes, and deprecations. Newest first. * October 17, 2026[Sends to a blocked contact are refused with contact\_blocked](https://docs.kirimdev.com/changelog/2026-10-17-contact-blocked-error/) Agents can now block a contact on a WhatsApp number from the dashboard. Sends to that contact through the Public API, the SDK and MCP send tools return 422 contact\_blocked. * October 9, 2026[Template parameters are checked before sending](https://docs.kirimdev.com/changelog/2026-10-09-template-parameter-checks/) Template sends whose parameters WhatsApp would reject now return 400 right away instead of 202 followed by a failed status. * October 9, 2026[Webhook number filters keep working after a number is reconnected](https://docs.kirimdev.com/changelog/2026-10-09-webhook-filter-follows-number/) A subscription scoped with phone\_number\_ids now keeps receiving events after the same number is removed and connected again. * October 9, 2026[One slow webhook endpoint no longer delays everyone's events](https://docs.kirimdev.com/changelog/2026-10-09-webhook-endpoint-isolation/) Webhook deliveries are now limited per endpoint host, and attempts to an endpoint that keeps timing out fail fast instead of waiting 10 seconds each. * October 9, 2026[MCP server adds OAuth sign-in](https://docs.kirimdev.com/changelog/2026-10-09-mcp-oauth/) MCP clients can now connect with just the server URL and a browser sign-in, scoped to one organization and to the permissions you approve. API keys keep working unchanged. * October 8, 2026[AI Agent labels now send contact.updated](https://docs.kirimdev.com/changelog/2026-10-08-ai-label-contact-updated/) Labels applied by the AI Agent now reach the contact and fire the contact.updated webhook, like labels added from the dashboard or the API. * October 1, 2026[Complete contact and conversation pagination](https://docs.kirimdev.com/changelog/2026-10-01-contact-conversation-pagination/) Contact and conversation list cursors now preserve full timestamp precision so bulk-created rows are not skipped between pages. * October 1, 2026[MCP adds safe bulk labeling by message keyword](https://docs.kirimdev.com/changelog/2026-10-01-mcp-bulk-label-by-message/) Preview, start, and progress tools now label up to 10,000 contacts from an inbound-message keyword search without sending thousands of individual mutations. * September 30, 2026[Clearer undeliverable message errors](https://docs.kirimdev.com/changelog/2026-09-30-clearer-undeliverable-errors/) Error 131026 now explains its possible recipient-side causes instead of returning only Message undeliverable. * September 27, 2026[Automatic WhatsApp slots for setup-link onboarding](https://docs.kirimdev.com/changelog/2026-09-27-automatic-setup-link-slots/) Setup-link onboarding can now purchase an Extra WhatsApp Number from wallet balance and automatically refund failed connections. * September 24, 2026[Labels in contact and conversation responses](https://docs.kirimdev.com/changelog/2026-09-24-contact-conversation-labels/) Public API and TypeScript SDK contact and conversation list/detail responses now include their attached labels. * September 22, 2026[Contact erasure now covers linked hosted-chat data](https://docs.kirimdev.com/changelog/2026-09-22-contact-erasure-covers-hosted-chat/) Permanent contact deletion removes linked Kichat identity snapshots, sessions, messages, and private media references. * September 20, 2026[MCP retries, limits, and audit controls hardened](https://docs.kirimdev.com/changelog/2026-09-20-mcp-production-hardening/) MCP mutations now support explicit idempotency keys, enforce subscription state, publish safety annotations, use accurate read/write limits, and produce per-tool audit logs. * September 15, 2026[Clearer template validation errors](https://docs.kirimdev.com/changelog/2026-09-15-template-validation-details/) Template creation errors now preserve Meta's actionable validation details instead of reducing them to Invalid parameter. * September 10, 2026[API reference readability improvements](https://docs.kirimdev.com/changelog/2026-09-10-api-reference-readability/) Public API operation pages now include complete parameter guidance, pagination semantics, retry headers, and status-specific error examples. * September 9, 2026[Message status error details restored](https://docs.kirimdev.com/changelog/2026-09-09-message-status-error-passthrough/) Meta delivery failures now preserve structured errors and pricing metadata in message.status webhooks. * September 8, 2026[WhatsApp reactions in Public API v1](https://docs.kirimdev.com/changelog/2026-09-08-whatsapp-reactions/) Send emoji reactions through the messages endpoint and reliably receive inbound reaction webhooks. * August 30, 2026[Media card carousel templates (create + send)](https://docs.kirimdev.com/changelog/2026-08-30-media-card-carousel-templates/) Create and send WhatsApp media card carousel marketing templates — up to 10 swipeable product cards, each with an image/video header and its own buttons — via the API, SDK, and MCP. * August 29, 2026[Guide — message correlation & tenant routing for platform mode](https://docs.kirimdev.com/changelog/2026-08-29-platform-message-correlation-guide/) A new platform-mode reference page explains, end to end, how to route each message webhook to the right end-customer and correlate a msg\_ send with the wamid in its delivery-status webhooks. * August 26, 2026[Edit message templates via API and SDK](https://docs.kirimdev.com/changelog/2026-08-26-edit-template/) New PATCH /v1/{phone\_number\_id}/templates/{name} endpoint (plus SDK templates.update()) edits an existing WhatsApp template's content and re-submits it to Meta for review. * August 16, 2026[BSUID identity-change ingestion & webhook accuracy](https://docs.kirimdev.com/changelog/2026-08-16-bsuid-identity-change-ingestion/) contact.identity\_updated now also fires when a WhatsApp user changes their phone number (delivered by Meta as a system message), batched multi-sender webhooks label each message with its own contact, and outbound status webhooks report the parent BSUID field under its current name. * August 13, 2026[MCP server supports protocol revision 2026-07-28](https://docs.kirimdev.com/changelog/2026-08-13-mcp-protocol-2026-07-28/) The Kirimdev MCP server now speaks MCP protocol revision 2026-07-28 alongside the 2025-era revisions. Clients that negotiate the newer revision connect without change; existing clients are unaffected. * August 10, 2026[Template responses now include category](https://docs.kirimdev.com/changelog/2026-08-10-template-category-in-responses/) GET template list and retrieve responses now return the Meta template category (MARKETING / UTILITY / AUTHENTICATION), closing the gap where category could be submitted on create but not read back. * August 9, 2026[Webhooks for pre-delivery send failures + longer transient retries](https://docs.kirimdev.com/changelog/2026-08-09-pre-meta-failed-webhook/) message.status now fires a failed event for sends that fail before Meta admits them (131000 outages, quota/compliance refusals), and transient Meta failures retry on a longer 1m/5m/15m schedule before giving up. * August 9, 2026[Disconnect a customer's WhatsApp account over the Public API](https://docs.kirimdev.com/changelog/2026-08-09-disconnect-customer-whatsapp-account/) New DELETE /v1/customers/{id}/whatsapp\_accounts/{phone\_number\_id} endpoint (plus kirim.customers.disconnectWhatsappAccount in the SDK) lets you remove a WhatsApp account a customer connected via a setup link, without touching the dashboard. * August 4, 2026[media\_upload\_failed names the real cause, WebP uploads are rejected early, and the failed-sends error tables are corrected](https://docs.kirimdev.com/changelog/2026-08-04-media-upload-failed-message-and-code-corrections/) The media\_upload\_failed message now points at Content-Type instead of connectivity, WebP image uploads are rejected before they reach Meta, and the failed-sends guide no longer documents error codes and statuses the API never returns. * August 2, 2026[Message history is now deleted after your plan's retention window](https://docs.kirimdev.com/changelog/2026-08-02-message-retention/) Messages older than your plan's history retention window are permanently deleted, along with the inbound media Kirimdev downloaded for them. Contacts, conversations, Media Library files and broadcast campaigns are unaffected. Aggregate analytics remain available for deleted periods. * August 1, 2026[A past-due subscription no longer reports itself as a quota problem](https://docs.kirimdev.com/changelog/2026-08-01-subscription-inactive-message-error/) Sends refused because your Kirimdev subscription lapsed now return \`subscription\_inactive\` instead of \`invalid\_request\` with a "monthly quota exceeded" message. * July 26, 2026[Webhook deliveries now tell you why they failed](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/) New \`error\_code\` and \`error\_message\` fields separate what your endpoint returned from why we could not deliver. Terminating a delivery no longer erases its attempt history. * July 25, 2026[Template names are validated, and inbound messages with control characters no longer disappear](https://docs.kirimdev.com/changelog/2026-07-25-template-name-validation-and-control-char-fix/) POST /v1/{phone\_number\_id}/messages now trims and validates template.name instead of forwarding malformed names to Meta. Separately, an inbound message containing a NUL byte no longer fails to arrive. * July 21, 2026[Register a WhatsApp number via API and SDK](https://docs.kirimdev.com/changelog/2026-07-21-register-phone-number/) New POST /v1/{phone\_number\_id}/register endpoint (plus SDK phoneNumbers(id).register()) finishes onboarding a number with its two-step-verification PIN. GET /v1/accounts now also returns meta\_status. * July 11, 2026[Revoke/edit webhook events and unsupported sub-kind hint](https://docs.kirimdev.com/changelog/2026-07-11-message-revoked-edited-and-unsupported-hint/) Two new webhook events (message.revoked, message.edited) and an unsupported.type hint on message.received so integrators can react to deleted or edited messages from Coexistence numbers. * July 3, 2026[Per-account filter for webhook subscriptions](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/) Scope a webhook subscription to a subset of WhatsApp accounts by passing \`phone\_number\_ids\`. Omit the field to keep the current behaviour and receive events from every account in the organisation. * July 3, 2026[Header and footer on interactive CTA URL messages](https://docs.kirimdev.com/changelog/2026-07-03-cta-url-header-footer/) The \`interactive.type=cta\_url\` variant now accepts an optional header (text / image / video / document) and footer text — matching Meta's documented shape and the reply\_buttons variant. * July 1, 2026[BSUID + WhatsApp username support](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/) Public API, SDK, MCP tools, and webhooks now accept and expose Business-Scoped User IDs (BSUID) so you can reach users who adopted a WhatsApp username. Auth OTP templates require a phone number; every other message type accepts BSUID recipients. * June 24, 2026[MCP server gains label tools](https://docs.kirimdev.com/changelog/2026-06-24-mcp-label-tools/) Six new MCP tools expose label CRUD and contact-scoped attach/detach — labels sync to conversations automatically, so no separate conversation label tools. * June 23, 2026[Hermes integration docs clarified](https://docs.kirimdev.com/changelog/2026-06-23-hermes-docs-clarification/) Hermes + Kirimdev documentation now states the integration is for owner access to Kirimdev via WhatsApp chat — not end-customer AI support. * June 21, 2026[message.sent media\_url for outbound attachments](https://docs.kirimdev.com/changelog/2026-06-21-message-sent-media-url/) Outbound image, video, audio, document, and sticker webhooks now include message.media\_url — parity with inbound kirim.media\_url. * June 19, 2026[Faster Public API polling](https://docs.kirimdev.com/changelog/2026-06-19-conversation-list-polling/) Redis-backed caches, updated\_since delta sync, and ETag/304 on conversation list and message retrieve. * June 17, 2026[Create templates with media header from public URL](https://docs.kirimdev.com/changelog/2026-06-17-create-template-media-url/) POST /v1/{phone\_number\_id}/templates now accepts example.header\_url (or an https URL in header\_handle); Kirimdev uploads the sample to Meta server-side. Meta validation errors return 400 instead of 502. * June 17, 2026[Voice note played status + played\_at on messages](https://docs.kirimdev.com/changelog/2026-06-17-voice-played-status/) Meta's new \`played\` delivery webhook is ingested without worker errors; GET /v1 messages expose an optional played\_at timestamp for outbound voice notes. * June 16, 2026[message.sent outbound webhook](https://docs.kirimdev.com/changelog/2026-06-16-message-sent-webhook/) Subscribe to message.sent for full outbound message bodies when Kirimdev sends to a customer — API, dashboard, broadcast, or phone-app echo. * June 15, 2026[Contextual replies on Public API sends](https://docs.kirimdev.com/changelog/2026-06-15-public-api-reply-context/) POST /v1/{phone\_number\_id}/messages now accepts optional context.message\_id to reply to an inbound wamid — same Meta wire shape as the Cloud API. * June 15, 2026[Enriched message.received webhooks](https://docs.kirimdev.com/changelog/2026-06-15-message-received-kirim-enrichment/) Customer webhooks for inbound messages now include an optional kirim block with conversation ids, labels, and a hosted media URL when ready. * June 15, 2026[Hermes Agent integration docs](https://docs.kirimdev.com/changelog/2026-06-15-hermes-agent-integration/) New documentation for the open-source kirimdev-hermes plugin — self-hosted WhatsApp AI gateway on Kirimdev webhooks and the Public API. * June 15, 2026[Panduan FAQ jendela 24 jam & template](https://docs.kirimdev.com/changelog/2026-06-15-24h-window-templates-faq/) Halaman docs-site baru dalam Bahasa Indonesia untuk pertanyaan berulang tentang jendela layanan pelanggan WhatsApp, kapan wajib pakai template, dan error outside\_24h\_window. * June 14, 2026[Create message templates via API, SDK, and MCP](https://docs.kirimdev.com/changelog/2026-06-14-create-template/) New POST /v1/{phone\_number\_id}/templates endpoint (plus SDK templates.create() and the create\_template MCP tool) submits a new WhatsApp message template to Meta for review and persists it locally as pending. * June 14, 2026[/v1/me now returns the org's teams](https://docs.kirimdev.com/changelog/2026-06-14-me-teams/) GET /v1/me adds a \`teams\` array so API and SDK consumers can discover the team\_id values required by team-scoped writes (e.g. POST /v1/customers on multi-team orgs) without leaving the API surface. * June 10, 2026[Voice notes + faster inbound media downloads](https://docs.kirimdev.com/changelog/2026-06-10-voice-notes-and-inline-media-url/) Send audio as a voice-note bubble with audio.voice=true, and have inbound media show up in your inbox roughly twice as fast thanks to a Meta webhook optimisation. * June 5, 2026[Dropped the duplicate \`token\` field from customer setup link create responses](https://docs.kirimdev.com/changelog/2026-06-05-drop-duplicate-token-field/) The create-setup-link response previously returned \`token\` alongside \`setup\_url\`; the same plaintext token was already embedded in the URL's path. The duplicate field is removed in this release. * June 5, 2026[New \`setup\_link\_inactive\` error code replaces wrong-domain \`webhook\_subscription\_disabled\` on customer setup links](https://docs.kirimdev.com/changelog/2026-06-05-setup-link-inactive-error-code/) PATCH / DELETE on a customer setup link that's no longer active now returns the dedicated \`setup\_link\_inactive\` error code (HTTP 409 conflict), instead of the misleading \`webhook\_subscription\_disabled\` that previously surfaced. * June 5, 2026[Operator suspend now blocks outbound sends on customer-owned accounts](https://docs.kirimdev.com/changelog/2026-06-05-customer-suspended-enforcement/) When an operator flips a Customer (tenant-of-tenant) to status \`suspended\` or \`archived\`, all outbound sends from that Customer's WhatsApp accounts are now blocked at the send-guard layer with the new \`customer\_suspended\` error code on a 422 response. * June 5, 2026[Customers — multi-tenant platform mode](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/) New /v1/customers resource lets you onboard end-customers (tenant-of-tenant) and have them connect their own WhatsApp accounts via setup links. Five new MCP tools plus a TypeScript SDK namespace ship alongside. * June 4, 2026[Pre-send compliance checks on POST /messages](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/) The messages endpoint now validates marketing opt-out and WhatsApp account compliance state before queuing the send. New 422 error codes — marketing\_opted\_out, account\_restricted, consent\_required, upstream\_error — let integrations distinguish recoverable from non-recoverable failures without round-tripping to Meta. * June 2, 2026[MCP server gains 5 new tools](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/) The Kirimdev MCP server now exposes 11 tools — adds get\_message, list\_messages, mark\_as\_read, create\_contact, and update\_contact so AI assistants can close the full read-then-reply loop. * June 1, 2026[Interactive reply buttons](https://docs.kirimdev.com/changelog/2026-06-01-interactive-reply-buttons/) Send up to 3 tappable quick-reply buttons via interactive.type=reply\_buttons. Taps arrive on your webhook as button\_reply events. * May 26, 2026[Initial release](https://docs.kirimdev.com/changelog/2026-05-26-initial-release/) First public cut of the Kirimdev Public API, TypeScript SDK, MCP server, and developer documentation. --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/#_top) API Reference Overview ======== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev Public API 1.0.0 ------------------------- [Section titled “Kirimdev Public API 1.0.0”](https://docs.kirimdev.com/api/#overview) Self-service REST API for sending WhatsApp messages, subscribing to events, and managing your inbox programmatically. See docs.kirimdev.com for guides and reference. Kirimdev Support * [https://kirimdev.com](https://kirimdev.com/) Information * OpenAPI version: `3.1.0` Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/#operations) GET [/health](https://docs.kirimdev.com/api/operations/health/) GET [/me](https://docs.kirimdev.com/api/operations/me/) GET [/accounts](https://docs.kirimdev.com/api/operations/accounts/) POST [/{phone\_number\_id}/register](https://docs.kirimdev.com/api/operations/phone_number_idregister/) GET [/{phone\_number\_id}/messages](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/) POST [/{phone\_number\_id}/messages](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) GET [/{phone\_number\_id}/messages/{id}](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/) GET [/{phone\_number\_id}/messages/{id}/media](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/) GET [/{phone\_number\_id}/templates](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/) POST [/{phone\_number\_id}/templates](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/post/) GET [/{phone\_number\_id}/templates/{name}](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/) PATCH [/{phone\_number\_id}/templates/{name}](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/patch/) POST [/{phone\_number\_id}/templates/sync](https://docs.kirimdev.com/api/operations/phone_number_idtemplatessync/) GET [/{phone\_number\_id}/conversations](https://docs.kirimdev.com/api/operations/phone_number_idconversations/) GET [/{phone\_number\_id}/conversations/{id}](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/) PATCH [/{phone\_number\_id}/conversations/{id}](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/) POST [/{phone\_number\_id}/conversations/{id}/labels](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/) DELETE [/{phone\_number\_id}/conversations/{id}/labels/{label\_id}](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/) GET [/{phone\_number\_id}/contacts](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/) POST [/{phone\_number\_id}/contacts](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/) GET [/{phone\_number\_id}/contacts/{id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/) DELETE [/{phone\_number\_id}/contacts/{id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/) PATCH [/{phone\_number\_id}/contacts/{id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/) POST [/{phone\_number\_id}/contacts/{id}/labels](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabels/) DELETE [/{phone\_number\_id}/contacts/{id}/labels/{label\_id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/) POST [/{phone\_number\_id}/contacts/bulk\_label](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/) GET [/labels](https://docs.kirimdev.com/api/operations/labels/get/) POST [/labels](https://docs.kirimdev.com/api/operations/labels/post/) GET [/labels/{id}](https://docs.kirimdev.com/api/operations/labelsid/get/) DELETE [/labels/{id}](https://docs.kirimdev.com/api/operations/labelsid/delete/) PATCH [/labels/{id}](https://docs.kirimdev.com/api/operations/labelsid/patch/) GET [/customers](https://docs.kirimdev.com/api/operations/customers/get/) POST [/customers](https://docs.kirimdev.com/api/operations/customers/post/) GET [/customers/{id}](https://docs.kirimdev.com/api/operations/customersid/get/) DELETE [/customers/{id}](https://docs.kirimdev.com/api/operations/customersid/delete/) PATCH [/customers/{id}](https://docs.kirimdev.com/api/operations/customersid/patch/) GET [/customers/{id}/setup\_links](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/) POST [/customers/{id}/setup\_links](https://docs.kirimdev.com/api/operations/customersidsetup_links/post/) DELETE [/customers/{id}/setup\_links/{link\_id}](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/) PATCH [/customers/{id}/setup\_links/{link\_id}](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/) DELETE [/customers/{id}/whatsapp\_accounts/{phone\_number\_id}](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/) GET [/webhook\_subscriptions](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/) POST [/webhook\_subscriptions](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/) GET [/webhook\_subscriptions/{id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/) DELETE [/webhook\_subscriptions/{id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/) PATCH [/webhook\_subscriptions/{id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/) POST [/webhook\_subscriptions/{id}/secrets](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/) DELETE [/webhook\_subscriptions/{id}/secrets/{secret\_id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/) GET [/webhook\_deliveries](https://docs.kirimdev.com/api/operations/webhook_deliveries/) GET [/webhook\_deliveries/{id}](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/) POST [/webhook\_deliveries/{id}/replay](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/) POST [/webhook\_deliveries/bulk\_replay](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/) Authentication -------------- [Section titled “ Authentication ”](https://docs.kirimdev.com/api/#authentication) ### bearerAuth [Section titled “bearerAuth ”](https://docs.kirimdev.com/api/#bearerauth) Kirimdev Public API key. Format: `kdv_live_<24-char base64url>`. Issue keys in Settings → API Keys. **Security scheme type:** http **Bearer format:** API Key --- # Quickstart | Kirimdev [Skip to content](https://docs.kirimdev.com/quickstart/#_top) Getting started Quickstart ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fquickstart%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fquickstart%2F%20and%20help%20me%20with%20the%20following%3A%20) You need a connected Kirimdev organization with at least one approved WhatsApp Business number. If you haven’t onboarded yet, sign up at [app.kirimdev.com](https://app.kirimdev.com/) and connect your number first — the dashboard walks you through Meta’s embedded signup flow. Goal ---- [Section titled “Goal”](https://docs.kirimdev.com/quickstart/#goal) By the end of this page you’ll have: 1. Issued an API key. 2. Resolved your `phone_number_id` (Meta’s stable account identifier). 3. Sent a `text` message to your own phone. 4. Polled the message status and seen `delivered`. Total time: under five minutes if Meta is in a cooperative mood. Steps ----- [Section titled “Steps”](https://docs.kirimdev.com/quickstart/#steps) 1. **Issue an API key.** In the Kirimdev dashboard, navigate to **Developers → API Keys** and click **Create key**. Give it a descriptive label (e.g. `local-laptop` or `n8n-prod`) and copy the plaintext value immediately — Kirimdev shows it exactly once. # Store the key in your shell — never commit it.export KIRIM_KEY=kdv_live_xxxxxxxxxxxxxxxxxxxxxxxx 2. **Verify the key works.** The `/v1/me` endpoint introspects your key and returns the organization context. curl -sS https://api.kirimdev.com/v1/me \ -H "Authorization: Bearer $KIRIM_KEY" Expected response: { "data": { "organization": { "id": "org_…", "object": "organization", "name": "Your Org" }, "api_key": { "id": "key_…", "object": "api_key", "label": "local-laptop", "last4": "abcd" }, "rate_limits": { "tier": "default", "write_per_minute": 60, "read_per_minute": 600 }, "teams": [ { "id": "team_01H…", "object": "team", "name": "Default", "slug": "default" } ] }, "request_id": "req_…"} 3. **Resolve your phone number ID.** Kirimdev uses Meta-style path routing — sender lives in the URL, not the body. Look up your connected accounts and grab the `phone_number_id`: curl -sS https://api.kirimdev.com/v1/accounts \ -H "Authorization: Bearer $KIRIM_KEY" { "data": [ { "object": "account", "phone_number_id": "106540352242922", "phone_number": "+628111222333", "name": "Customer Support", "status": "connected" } ], "has_more": false, "next_cursor": null, "request_id": "req_…"} Stash the id — every per-account endpoint takes it as a path segment. export PHONE_ID=106540352242922 4. **Send your first message.** Replace `+628123456789` with a phone number Meta has already received a message from in the past 24 hours — Meta only allows free-form text inside an open conversation window. * [@kirimdev/sdk](https://docs.kirimdev.com/quickstart/#tab-panel-76) * [cURL](https://docs.kirimdev.com/quickstart/#tab-panel-77) * [Node fetch](https://docs.kirimdev.com/quickstart/#tab-panel-78) * [Python](https://docs.kirimdev.com/quickstart/#tab-panel-79) * [Go](https://docs.kirimdev.com/quickstart/#tab-panel-80) // bun add @kirimdev/sdkimport { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) const msg = await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'text', text: { body: 'Halo dari Kirimdev' },})console.log(msg.id) // -> msg_... The official SDK adds auto-retry, automatic `Idempotency-Key`, async pagination, and typed errors. Cache the per-phone client at module top-level for the common single-account case. See the [SDK Quickstart](https://docs.kirimdev.com/sdks/typescript/quickstart/) for the full walkthrough. curl -sS "https://api.kirimdev.com/v1/$PHONE_ID/messages" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": { "body": "Halo dari Kirimdev" } }' const res = await fetch( `https://api.kirimdev.com/v1/${process.env.PHONE_ID}/messages`, { method: 'POST', headers: { Authorization: `Bearer ${process.env.KIRIM_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ messaging_product: 'whatsapp', to: '+628123456789', type: 'text', text: { body: 'Halo dari Kirimdev' }, }), },)const json = await res.json()console.log(json.data.id) // -> msg_... import osimport httpx r = httpx.post( f"https://api.kirimdev.com/v1/{os.environ['PHONE_ID']}/messages", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}, json={ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": {"body": "Halo dari Kirimdev"}, },)print(r.json()["data"]["id"]) # -> msg_... package main import ( "bytes" "encoding/json" "fmt" "net/http" "os") func main() { body, _ := json.Marshal(map[string]any{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": map[string]string{"body": "Halo dari Kirimdev"}, }) url := fmt.Sprintf( "https://api.kirimdev.com/v1/%s/messages", os.Getenv("PHONE_ID"), ) req, _ := http.NewRequest("POST", url, bytes.NewReader(body)) req.Header.Set("Authorization", "Bearer "+os.Getenv("KIRIM_KEY")) req.Header.Set("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() // read & decode `data.id`...} Expected response: { "data": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "to": "+628123456789", "type": "text", "status": "pending", "created_at": "2026-05-26T08:00:00.000Z" }, "request_id": "req_…"} The recipient should receive the message within a few seconds. 5. **Poll the status.** The send is asynchronous — `status` flips from `pending` → `sent` → `delivered` → `read` as Meta returns callbacks. curl -sS \ "https://api.kirimdev.com/v1/$PHONE_ID/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX" \ -H "Authorization: Bearer $KIRIM_KEY" { "data": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "status": "delivered", "to": "+628111111111", "type": "text", "created_at": "…" }, "request_id": "…"} Polling is fine for a quickstart but wasteful at scale. Set up a webhook (next section) to receive `message.status` callbacks instead. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/quickstart/#whats-next) TypeScript SDK `@kirimdev/sdk` wraps every endpoint with auto-retry, idempotency, async pagination, and typed errors. [Read →](https://docs.kirimdev.com/sdks/typescript/) Subscribe to webhooks Stop polling, start receiving events as they happen. [Read →](https://docs.kirimdev.com/guides/webhooks/) Authentication deep dive Key rotation, expiration, security guidance. [Read →](https://docs.kirimdev.com/authentication/) Handle failed sends Structured error envelope and stable error codes you can branch on. [Read →](https://docs.kirimdev.com/guides/failed-sends/) API Reference Every endpoint, every parameter, every error code. [Browse →](https://docs.kirimdev.com/api/) Recipes End-to-end patterns for common workflows. [Browse →](https://docs.kirimdev.com/recipes/order-notifications/) --- # Authentication | Kirimdev [Skip to content](https://docs.kirimdev.com/authentication/#_top) Getting started Authentication ============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fauthentication%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fauthentication%2F%20and%20help%20me%20with%20the%20following%3A%20) The Kirimdev Public API uses **bearer-token authentication**. Every request to `/v1/*` (except `/v1/health` and `/v1/openapi.json`) must carry an `Authorization: Bearer ` header. GET /v1/me HTTP/1.1Host: api.kirimdev.comAuthorization: Bearer kdv_live_TavbPKwIuqOr69ALEKLNennZ Key format ---------- [Section titled “Key format”](https://docs.kirimdev.com/authentication/#key-format) kdv_live_<24 url-safe base64 chars> * The `kdv_` prefix identifies the key as issued by Kirimdev. * `live` indicates the production environment. * The 24-character suffix is generated from 18 bytes of CSPRNG entropy. * Total length: 33 characters. Only `kdv_live_*` keys are issued today; there is no separate test/sandbox key prefix. Lifecycle --------- [Section titled “Lifecycle”](https://docs.kirimdev.com/authentication/#lifecycle) ### Issue [Section titled “Issue”](https://docs.kirimdev.com/authentication/#issue) API keys are issued through the dashboard under **Developers → API Keys**. Each key belongs to **one organization** and grants **full org-wide access** — there is no scoped permission system today (deferred to a later phase, non-breaking when added). The plaintext is shown **once** in the create-key modal and never again. Kirimdev stores only an argon2id hash plus the first 12 and last 4 characters for display. ### Use [Section titled “Use”](https://docs.kirimdev.com/authentication/#use) Pass the plaintext as a bearer token on every request: * [@kirimdev/sdk](https://docs.kirimdev.com/authentication/#tab-panel-34) * [cURL](https://docs.kirimdev.com/authentication/#tab-panel-35) * [Python](https://docs.kirimdev.com/authentication/#tab-panel-36) import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const ctx = await kirim.me() curl https://api.kirimdev.com/v1/me \ -H "Authorization: Bearer $KIRIM_KEY" import os, httpxctx = httpx.get( "https://api.kirimdev.com/v1/me", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"},).json() The API does **not** accept the key as a query parameter, basic auth, or cookie. Bearer header only. ### Set an expiration [Section titled “Set an expiration”](https://docs.kirimdev.com/authentication/#set-an-expiration) Keys may be issued with an optional `expires_at` timestamp. Once the clock passes that moment, requests return: HTTP/1.1 401 Unauthorized{ "error": { "type": "authentication_error", "code": "expired_api_key", "message": "This API key has expired.", "request_id": "req_…" }} Expiration is enforced server-side at the auth-middleware layer; there is no client-visible warning before it triggers, so wire your own heads-up alert if needed. ### Revoke [Section titled “Revoke”](https://docs.kirimdev.com/authentication/#revoke) Click **Revoke** next to a key in the dashboard. Effective immediately — the verification cache is invalidated synchronously. The next request with that key returns: HTTP/1.1 401 Unauthorized{ "error": { "type": "authentication_error", "code": "revoked_api_key", "message": "This API key has been revoked.", "request_id": "req_…" }} Revocation is irreversible. To rotate, issue a new key first, update your application, then revoke the old key. Verification semantics ---------------------- [Section titled “Verification semantics”](https://docs.kirimdev.com/authentication/#verification-semantics) For each request Kirimdev: 1. Reads the `Authorization: Bearer ` header. 2. Parses the first 20 characters as the `key_prefix` index. 3. Looks up the row in `api_keys` (single-row index hit). 4. Verifies the full plaintext against the stored argon2id hash in constant time. 5. Checks `revoked_at IS NULL` and `expires_at IS NULL OR expires_at > now()`. A 60-second Redis cache amortises the argon2id cost for high-RPS keys. Revoke / rotate / expiration changes invalidate the cache synchronously. Error reference --------------- [Section titled “Error reference”](https://docs.kirimdev.com/authentication/#error-reference) | HTTP | `type` | `code` | Trigger | | --- | --- | --- | --- | | 401 | `authentication_error` | `missing_api_key` | No `Authorization` header | | 401 | `authentication_error` | `invalid_api_key` | Malformed token, unknown prefix, or hash mismatch | | 401 | `authentication_error` | `revoked_api_key` | Key has been revoked | | 401 | `authentication_error` | `expired_api_key` | `expires_at` has passed | All four return the standard [error envelope](https://docs.kirimdev.com/concepts/errors/) with a `request_id` you can quote in support tickets. Security guidance ----------------- [Section titled “Security guidance”](https://docs.kirimdev.com/authentication/#security-guidance) Store keys in a secrets manager Doppler, 1Password, AWS Secrets Manager, Vault — never in `.env` files committed to git, never in client-side bundles. One key per environment + consumer Dev / staging / prod, and per integration (Zapier, n8n, your backend). Granular tracking makes leak response painless. Rotate proactively No enforced cadence, but every 90 days is a reasonable default. Issue new → update apps → revoke old. Set expirations on temporary keys For one-off scripts, contractor access, or trial integrations. Audit the API log Every `/v1/*` call appears under **Developers → API Logs** with method, path, status, latency, IP, request id. 30-day retention. Subscribe to key-lifecycle webhooks Once shipped, `webhook.subscription.*` events give real-time alerts when a key is created or revoked. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/authentication/#whats-next) * [Rate limits](https://docs.kirimdev.com/concepts/rate-limits/) — how requests are budgeted per organization. * [Idempotency](https://docs.kirimdev.com/concepts/idempotency/) — safe retries on mutation endpoints. * [API Reference → /v1/me](https://docs.kirimdev.com/api/) — full introspection payload, including the `teams` array used to discover `team_id` values for team-scoped writes (e.g. [`POST /v1/customers`](https://docs.kirimdev.com/platform/customers/) ). --- # Send image | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-image/#_top) Media Send image ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-image%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-image%2F%20and%20help%20me%20with%20the%20following%3A%20) Send an image by passing a public HTTPS URL in `image.link`. WhatsApp fetches the asset server-side; you don’t upload anything through Kirimdev. * [cURL](https://docs.kirimdev.com/sending/send-image/#tab-panel-122) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-image/#tab-panel-123) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "image", "image": { "link": "https://cdn.example.com/promo.jpg", "caption": "Promo akhir bulan — diskon 30%" } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'image', image: { link: 'https://cdn.example.com/promo.jpg', caption: 'Promo akhir bulan — diskon 30%', },}) Requirements ------------ [Section titled “Requirements”](https://docs.kirimdev.com/sending/send-image/#requirements) | Field | Constraint | | --- | --- | | `image.link` | Public HTTPS URL; either `link` **or** `id` (not both) | | `image.id` | Meta-uploaded media id (advanced — see [Meta docs](https://developers.facebook.com/docs/whatsapp/cloud-api/reference/media)
) | | `image.caption` | Optional, ≤ 1024 chars | | Format | JPG, PNG | | Max size | 5 MB | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-image/#see-also) * [Send video](https://docs.kirimdev.com/sending/send-video/) · [Send audio](https://docs.kirimdev.com/sending/send-audio/) · [Send document](https://docs.kirimdev.com/sending/send-document/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Send text | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-text/#_top) Messages Send text ========= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-text%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-text%2F%20and%20help%20me%20with%20the%20following%3A%20) Send a plain-text message — up to 4,096 characters, optional URL preview. Body shape mirrors Meta’s WhatsApp Cloud API exactly. * [cURL](https://docs.kirimdev.com/sending/send-text/#tab-panel-144) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-text/#tab-panel-145) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": { "body": "Halo dari Kirimdev" } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'text', text: { body: 'Halo dari Kirimdev' },}) Optional: link previews ----------------------- [Section titled “Optional: link previews”](https://docs.kirimdev.com/sending/send-text/#optional-link-previews) Set `text.preview_url: true` to ask WhatsApp to render a rich preview for the first URL found in `body`. Meta fetches the page server-side — no extra payload needed from your side. { "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": { "body": "Cek harga terbaru: https://example.com/pricing", "preview_url": true }} Send to a Business-Scoped User ID (BSUID) ----------------------------------------- [Section titled “Send to a Business-Scoped User ID (BSUID)”](https://docs.kirimdev.com/sending/send-text/#send-to-a-business-scoped-user-id-bsuid) WhatsApp usernames (2026 rollout) let users hide their phone number. When you receive an inbound message from a username-adopted user, the webhook may omit `wa_id` and only carry `user_id` — a **Business-Scoped User ID** in the form `US.13491208655302741918`. Send back to that user by setting `recipient` instead of `to`: * [cURL](https://docs.kirimdev.com/sending/send-text/#tab-panel-146) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-text/#tab-panel-147) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "recipient": "US.13491208655302741918", "type": "text", "text": { "body": "Halo dari Kirimdev" } }' await phone.messages.send({ messaging_product: 'whatsapp', recipient: 'US.13491208655302741918', type: 'text', text: { body: 'Halo dari Kirimdev' },}) * **Either `to` or `recipient` is required.** If both are supplied, Meta uses `to` (documented precedence). * BSUIDs are **scoped to the business portfolio** that received the inbound. You cannot cross-message a BSUID from another business. * **Authentication OTP templates** (one-tap / zero-tap / copy-code) do NOT accept BSUID recipients — Meta rejects them with error `131062` and the public API mirrors the error before hitting Meta. Send auth OTP to a phone number (`to`). * The response echoes back `bsuid`, `parent_bsuid`, and `username` for the recipient contact so you can persist them. Reply to a message ------------------ [Section titled “Reply to a message”](https://docs.kirimdev.com/sending/send-text/#reply-to-a-message) Add optional `context.message_id` with the inbound **wamid** from your webhook (`messages[0].id`) to send a quoted reply. Use the Meta id, not a Kirim `msg_*` external id. * [cURL](https://docs.kirimdev.com/sending/send-text/#tab-panel-148) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-text/#tab-panel-149) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "context": { "message_id": "wamid...." }, "text": { "body": "Terima kasih, sudah kami terima." } }' await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'text', context: { message_id: inboundWamid }, text: { body: 'Terima kasih, sudah kami terima.' },}) See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-text/#see-also) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) * [Quickstart](https://docs.kirimdev.com/quickstart/) — full account-setup walkthrough before your first send * [Idempotency](https://docs.kirimdev.com/concepts/idempotency/) — safely retrying a send --- # Send video | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-video/#_top) Media Send video ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-video%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-video%2F%20and%20help%20me%20with%20the%20following%3A%20) Send a video by passing a public HTTPS URL in `video.link`. WhatsApp fetches the asset server-side; you don’t upload anything through Kirimdev. * [cURL](https://docs.kirimdev.com/sending/send-video/#tab-panel-150) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-video/#tab-panel-151) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "video", "video": { "link": "https://cdn.example.com/demo.mp4", "caption": "Demo singkat fitur baru" } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'video', video: { link: 'https://cdn.example.com/demo.mp4', caption: 'Demo singkat fitur baru', },}) Requirements ------------ [Section titled “Requirements”](https://docs.kirimdev.com/sending/send-video/#requirements) | Field | Constraint | | --- | --- | | `video.link` | Public HTTPS URL; either `link` **or** `id` (not both) | | `video.caption` | Optional, ≤ 1024 chars | | Format | MP4 (H.264 + AAC), 3GPP | | Max size | 16 MB | | Audio | Mandatory — silent videos may fail validation at Meta | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-video/#see-also) * [Send image](https://docs.kirimdev.com/sending/send-image/) · [Send audio](https://docs.kirimdev.com/sending/send-audio/) · [Send document](https://docs.kirimdev.com/sending/send-document/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Send audio | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-audio/#_top) Media Send audio ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-audio%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-audio%2F%20and%20help%20me%20with%20the%20following%3A%20) Send a hosted audio file by passing its HTTPS URL in `audio.link`. Use this for music clips, podcasts, or pre-recorded voice notes. * [cURL](https://docs.kirimdev.com/sending/send-audio/#tab-panel-112) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-audio/#tab-panel-113) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "audio", "audio": { "link": "https://cdn.example.com/welcome.mp3" } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'audio', audio: { link: 'https://cdn.example.com/welcome.mp3' },}) Send as a voice note -------------------- [Section titled “Send as a voice note”](https://docs.kirimdev.com/sending/send-audio/#send-as-a-voice-note) Set `audio.voice: true` to have WhatsApp render the message as a voice-note bubble (waveform + play icon + microphone glyph) instead of a generic audio file attachment. Voice-note presentation is also what unlocks the recipient-side speech-to-text transcript feature, where the recipient sees a typed-out version of the audio below the bubble (when they have enabled it in their WhatsApp settings). * [cURL](https://docs.kirimdev.com/sending/send-audio/#tab-panel-114) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-audio/#tab-panel-115) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "audio", "audio": { "link": "https://cdn.example.com/order-ready.ogg", "voice": true } }' await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'audio', audio: { link: 'https://cdn.example.com/order-ready.ogg', voice: true, },}) Omit the field (or set it to `false`) to fall back to the default audio-file presentation. Forwarded verbatim to Meta — see Meta’s [audio message guide](https://developers.facebook.com/docs/whatsapp/cloud-api/messages/audio-messages/) for the original spec. Requirements ------------ [Section titled “Requirements”](https://docs.kirimdev.com/sending/send-audio/#requirements) | Field | Constraint | | --- | --- | | `audio.link` | Public HTTPS URL; either `link` **or** `id` (not both) | | `audio.voice` | Optional boolean. `true` renders the message as a voice note bubble. | | Format | AAC, M4A, AMR, MP3, OGG (Opus codec only) | | Max size | 16 MB | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-audio/#see-also) * [Send image](https://docs.kirimdev.com/sending/send-image/) · [Send video](https://docs.kirimdev.com/sending/send-video/) · [Send document](https://docs.kirimdev.com/sending/send-document/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Send document | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-document/#_top) Media Send document ============= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-document%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-document%2F%20and%20help%20me%20with%20the%20following%3A%20) Send any file type WhatsApp recognises as a document. The `filename` shown to the recipient defaults to the URL’s last segment if you don’t override it. * [cURL](https://docs.kirimdev.com/sending/send-document/#tab-panel-120) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-document/#tab-panel-121) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "document", "document": { "link": "https://cdn.example.com/invoices/INV-4521.pdf", "filename": "INV-4521.pdf", "caption": "Invoice bulan Mei" } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'document', document: { link: 'https://cdn.example.com/invoices/INV-4521.pdf', filename: 'INV-4521.pdf', caption: 'Invoice bulan Mei', },}) Requirements ------------ [Section titled “Requirements”](https://docs.kirimdev.com/sending/send-document/#requirements) | Field | Constraint | | --- | --- | | `document.link` | Public HTTPS URL; either `link` **or** `id` (not both) | | `document.filename` | Optional, ≤ 255 chars — shown to the recipient | | `document.caption` | Optional, ≤ 1024 chars | | Format | PDF, Word, Excel, PowerPoint, plain text, more | | Max size | 100 MB | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-document/#see-also) * [Send image](https://docs.kirimdev.com/sending/send-image/) · [Send video](https://docs.kirimdev.com/sending/send-video/) · [Send audio](https://docs.kirimdev.com/sending/send-audio/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Send interactive buttons | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-buttons/#_top) Interactive Send interactive buttons ======================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev exposes WhatsApp’s interactive button surface as `type: "interactive"` with one of four nested subtypes: `cta_url` (this page), `reply_buttons` ([Send reply buttons](https://docs.kirimdev.com/sending/send-reply-buttons/) ), `list` ([Send lists](https://docs.kirimdev.com/sending/send-lists/) ), and `carousel` (a horizontally scrollable strip of cards — see the [API reference](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) for the full schema). A CTA URL button replaces a raw URL in the message body with a labelled tap target — better click-through and no exposed link. For in-conversation choices (Confirm / Cancel / etc.) that route back to your webhook instead of opening a browser, use [reply buttons](https://docs.kirimdev.com/sending/send-reply-buttons/) instead. * [cURL](https://docs.kirimdev.com/sending/send-buttons/#tab-panel-116) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-buttons/#tab-panel-117) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "cta_url", "body": { "text": "Pesananmu siap diambil." }, "action": { "name": "cta_url", "parameters": { "display_text": "Lihat detail", "url": "https://example.com/orders/42" } } } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'interactive', interactive: { type: 'cta_url', body: { text: 'Pesananmu siap diambil.' }, action: { name: 'cta_url', parameters: { display_text: 'Lihat detail', url: 'https://example.com/orders/42', }, }, },}) Optional header and footer -------------------------- [Section titled “Optional header and footer”](https://docs.kirimdev.com/sending/send-buttons/#optional-header-and-footer) Add a `header` (text / image / video / document) and/or a short `footer` line to give the button context. Mirrors Meta’s [interactive CTA URL message shape](https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-cta-url-messages/) 1:1. * [cURL](https://docs.kirimdev.com/sending/send-buttons/#tab-panel-118) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-buttons/#tab-panel-119) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "cta_url", "header": { "type": "image", "image": { "link": "https://cdn.example.com/order-banner.png" } }, "body": { "text": "Pesananmu siap diambil." }, "footer": { "text": "Pickup sebelum 20:00 WIB" }, "action": { "name": "cta_url", "parameters": { "display_text": "Lihat detail", "url": "https://example.com/orders/42" } } } }' await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'interactive', interactive: { type: 'cta_url', header: { type: 'image', image: { link: 'https://cdn.example.com/order-banner.png' }, }, body: { text: 'Pesananmu siap diambil.' }, footer: { text: 'Pickup sebelum 20:00 WIB' }, action: { name: 'cta_url', parameters: { display_text: 'Lihat detail', url: 'https://example.com/orders/42', }, }, },}) Header variants: | `header.type` | Extra field | Notes | | --- | --- | --- | | `text` | `text` (≤60 chars) | Bold headline above the body | | `image` | `image.link` (public HTTPS URL) | Rendered inline above the body | | `video` | `video.link` (public HTTPS URL) | Inline playable preview | | `document` | `document.link` (public HTTPS URL) | Inline attachment tile | Limits ------ [Section titled “Limits”](https://docs.kirimdev.com/sending/send-buttons/#limits) | Field | Limit | | --- | --- | | `header.text` | 1–60 chars (text header only) | | `body.text` | 1–1024 chars | | `footer.text` | 1–60 chars | | `parameters.display_text` | 1–20 chars | | `parameters.url` | Valid HTTPS URL | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-buttons/#see-also) * [Send reply buttons](https://docs.kirimdev.com/sending/send-reply-buttons/) — quick-reply (up to 3) that webhook back * [Send interactive lists](https://docs.kirimdev.com/sending/send-lists/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) (see the **Interactive** request-body tab) --- # Send reply buttons | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-reply-buttons/#_top) Interactive Send reply buttons ================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-reply-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-reply-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) Reply buttons let you offer the recipient **up to 3 predefined replies** to tap instead of typing. When they pick one, a [`message.received` webhook](https://docs.kirimdev.com/webhooks/events/) fires carrying a `button_reply` object whose `id` matches the `id` you set when sending. Use them for confirmations, branching menus, and short multiple-choice questions where each option is a single short label. This is distinct from [CTA URL buttons](https://docs.kirimdev.com/sending/send-buttons/) — those open a link in the device browser; reply buttons stay inside WhatsApp and route back to your webhook. Send ---- [Section titled “Send”](https://docs.kirimdev.com/sending/send-reply-buttons/#send) * [cURL](https://docs.kirimdev.com/sending/send-reply-buttons/#tab-panel-128) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-reply-buttons/#tab-panel-129) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "reply_buttons", "body": { "text": "Konfirmasi jadwal workshop besok jam 9?" }, "action": { "buttons": [ { "type": "reply", "reply": { "id": "confirm", "title": "Confirm" } }, { "type": "reply", "reply": { "id": "reschedule", "title": "Reschedule" } }, { "type": "reply", "reply": { "id": "cancel", "title": "Cancel" } } ] } } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'interactive', interactive: { type: 'reply_buttons', body: { text: 'Konfirmasi jadwal workshop besok jam 9?' }, action: { buttons: [ { type: 'reply', reply: { id: 'confirm', title: 'Confirm' } }, { type: 'reply', reply: { id: 'reschedule', title: 'Reschedule' } }, { type: 'reply', reply: { id: 'cancel', title: 'Cancel' } }, ], }, },}) ### With a header and footer [Section titled “With a header and footer”](https://docs.kirimdev.com/sending/send-reply-buttons/#with-a-header-and-footer) The optional header accepts text or a media URL (image / video / document). The footer is short muted text shown beneath the buttons. { "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "reply_buttons", "header": { "type": "image", "image": { "link": "https://example.com/banner.png" } }, "body": { "text": "Workshop besok jam 9. Pilih salah satu:" }, "footer": { "text": "Tap di luar pesan ini untuk batal." }, "action": { "buttons": [ { "type": "reply", "reply": { "id": "confirm", "title": "Confirm" } }, { "type": "reply", "reply": { "id": "cancel", "title": "Cancel" } } ] } }} Handle the reply ---------------- [Section titled “Handle the reply”](https://docs.kirimdev.com/sending/send-reply-buttons/#handle-the-reply) The recipient’s tap arrives on your [webhook](https://docs.kirimdev.com/webhooks/events/) as a `message.received` event. The inbound message has `type: "interactive"` with a nested `button_reply` discriminator: { "type": "interactive", "interactive": { "type": "button_reply", "button_reply": { "id": "confirm", "title": "Confirm" } }} Route on `button_reply.id` (stable, set by you) — not on `title`, which is human-readable and may be localized. Limits ------ [Section titled “Limits”](https://docs.kirimdev.com/sending/send-reply-buttons/#limits) | Field | Limit | | --- | --- | | `body.text` | 1–1024 chars, required | | `header.text` (when `header.type` is `text`) | 1–60 chars | | `header.{image,video,document}.link` | Valid HTTPS URL | | `footer.text` | 1–60 chars | | `action.buttons` | 1–3 entries | | Each `button.reply.id` | 1–256 chars, **unique** across the set | | Each `button.reply.title` | 1–20 chars, **unique** across the set | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-reply-buttons/#see-also) * [Send interactive CTA URL buttons](https://docs.kirimdev.com/sending/send-buttons/) — for opening a link * [Send interactive lists](https://docs.kirimdev.com/sending/send-lists/) — for >3 options * [Webhook events: `message.received`](https://docs.kirimdev.com/webhooks/events/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) (see the **Interactive → Reply buttons** request-body tab) --- # Send interactive lists | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-lists/#_top) Interactive Send interactive lists ====================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-lists%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-lists%2F%20and%20help%20me%20with%20the%20following%3A%20) Interactive lists open a modal with up to 10 selectable rows grouped into labeled sections. Use them for menus, time-slot pickers, or short product catalogs where users pick exactly one item. * [cURL](https://docs.kirimdev.com/sending/send-lists/#tab-panel-124) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-lists/#tab-panel-125) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "list", "body": { "text": "Pilih jadwal kunjungan:" }, "action": { "button": "Lihat jadwal", "sections": [ { "title": "Hari ini", "rows": [ { "id": "slot_10", "title": "10:00 WIB" }, { "id": "slot_14", "title": "14:00 WIB" } ] }, { "title": "Besok", "rows": [ { "id": "slot_t10", "title": "10:00 WIB", "description": "Sisa 2 slot" } ] } ] } } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'interactive', interactive: { type: 'list', body: { text: 'Pilih jadwal kunjungan:' }, action: { button: 'Lihat jadwal', sections: [ { title: 'Hari ini', rows: [ { id: 'slot_10', title: '10:00 WIB' }, { id: 'slot_14', title: '14:00 WIB' }, ], }, { title: 'Besok', rows: [ { id: 'slot_t10', title: '10:00 WIB', description: 'Sisa 2 slot' }, ], }, ], }, },}) Limits ------ [Section titled “Limits”](https://docs.kirimdev.com/sending/send-lists/#limits) | Field | Limit | | --- | --- | | `body.text` | 1–1024 chars | | `header.text` (optional, text-only) | 1–60 chars | | `footer.text` (optional) | 1–60 chars | | `action.button` | 1–20 chars | | `sections[].title` | ≤ 24 chars | | `sections[].rows[].title` | 1–24 chars | | `sections[].rows[].id` | 1–200 chars | | `sections[].rows[].description` (optional) | ≤ 72 chars | | **Total rows across all sections** | ≤ 10 | Handling replies ---------------- [Section titled “Handling replies”](https://docs.kirimdev.com/sending/send-lists/#handling-replies) When a user taps a row WhatsApp delivers an inbound webhook with `interactive.list_reply`. The `id` you set above is echoed back so your handler can route on stable identifiers: { "interactive": { "type": "list_reply", "list_reply": { "id": "slot_10", "title": "10:00 WIB" } }} See [Receive messages](https://docs.kirimdev.com/sending/receive-messages/) for the full inbound webhook payload. See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-lists/#see-also) * [Send interactive buttons](https://docs.kirimdev.com/sending/send-buttons/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) (see the **Interactive** request-body tab) * [Webhook events](https://docs.kirimdev.com/webhooks/events/) — inbound interactive replies --- # React to messages | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-reactions/#_top) Messages React to messages ================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-reactions%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-reactions%2F%20and%20help%20me%20with%20the%20following%3A%20) Send a reaction through the same Meta-style messages endpoint used for other outbound WhatsApp messages. The target must be an inbound customer message owned by the WhatsApp number in the URL. * [cURL](https://docs.kirimdev.com/sending/send-reactions/#tab-panel-126) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-reactions/#tab-panel-127) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "15551234567", "type": "reaction", "reaction": { "message_id": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA", "emoji": "👍" } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '15551234567', type: 'reaction', reaction: { message_id: 'wamid.HBgN...', emoji: '👍', },}) Remove a reaction ----------------- [Section titled “Remove a reaction”](https://docs.kirimdev.com/sending/send-reactions/#remove-a-reaction) Send the same request with an empty `emoji` string: { "messaging_product": "whatsapp", "to": "15551234567", "type": "reaction", "reaction": { "message_id": "wamid.HBgN...", "emoji": "" }} Response -------- [Section titled “Response”](https://docs.kirimdev.com/sending/send-reactions/#response) { "data": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "to": "+15551234567", "type": "reaction", "status": "pending", "reaction": { "message_id": "wamid.HBgN...", "emoji": "👍" }, "created_at": "2026-09-08T09:00:00.000Z" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} The returned `id` identifies the target inbound message. Reaction delivery is queued; Meta sends only a `sent` status for reactions and does not send the usual `delivered` or `read` statuses. Restrictions ------------ [Section titled “Restrictions”](https://docs.kirimdev.com/sending/send-reactions/#restrictions) * The target must be an inbound customer message, not an outbound message or another reaction. * Meta rejects reactions to messages older than 30 days or messages that were deleted. * Only one business reaction is retained per target message. Sending another emoji replaces it. * Send an empty emoji to remove the business reaction. See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-reactions/#see-also) * [Receive messages](https://docs.kirimdev.com/sending/receive-messages/) - obtain the target wamid and receive customer reactions * [API reference - Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Mark messages as read | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/mark-as-read/#_top) Messages Mark messages as read ===================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fmark-as-read%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fmark-as-read%2F%20and%20help%20me%20with%20the%20following%3A%20) `POST /v1/{phone_number_id}/messages` doubles as both the outbound-send endpoint and the read-receipt endpoint — exactly like Meta’s WhatsApp Cloud API. To mark an inbound message as read, send a body with `status: "read"` and the inbound `wamid` you received from your webhook. The double-tick on the sender’s phone turns blue. * [cURL](https://docs.kirimdev.com/sending/mark-as-read/#tab-panel-106) * [TypeScript SDK](https://docs.kirimdev.com/sending/mark-as-read/#tab-panel-107) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "status": "read", "message_id": "wamid.HBgNNjI4MTIzNDU2Nzg5FQIAEhggMUE5MDM1QzVDMUYxQTAyRkVCNzZDQjVDMjFFRDQzNTUA" }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.markAsRead('wamid.HBgN…') With typing indicator --------------------- [Section titled “With typing indicator”](https://docs.kirimdev.com/sending/mark-as-read/#with-typing-indicator) Add `typing_indicator: { type: "text" }` to also show a typing bubble to the sender alongside the receipt. Meta auto-dismisses it on your first outbound message or after ~25 seconds. * [cURL](https://docs.kirimdev.com/sending/mark-as-read/#tab-panel-108) * [TypeScript SDK](https://docs.kirimdev.com/sending/mark-as-read/#tab-panel-109) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "status": "read", "message_id": "wamid.HBgN…", "typing_indicator": { "type": "text" } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.markAsRead('wamid.HBgN…', { typing: true }) Response -------- [Section titled “Response”](https://docs.kirimdev.com/sending/mark-as-read/#response) { "data": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "status": "read", "message_id": "wamid.HBgN…" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} `id` is the Kirimdev external id of the inbound message row that was flipped to `read` locally. `message_id` echoes back the wamid you sent so retries can be correlated. Idempotency ----------- [Section titled “Idempotency”](https://docs.kirimdev.com/sending/mark-as-read/#idempotency) Safe to retry. A second call against a message that’s already in `read` state returns the same `200` payload without making another request to Meta — same shape regardless of whether the first call actually sent the receipt or not. Errors ------ [Section titled “Errors”](https://docs.kirimdev.com/sending/mark-as-read/#errors) | Status | Code | When | | --- | --- | --- | | 404 | `resource_not_found` | `message_id` (wamid) unknown to your org, or belongs to a different account | | 400 | `invalid_field_value` | The wamid resolves to an outbound message — only inbound messages can be marked as read | | 502 | `whatsapp_upstream_error` | Meta accepted the request but the receipt is past the 7-day window or another upstream limit | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/mark-as-read/#see-also) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) (see the **Read receipt** request-body tab) * [Receive messages](https://docs.kirimdev.com/sending/receive-messages/) — where you get the wamid to mark --- # Send templates | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-templates/#_top) Templates Send templates ============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) Templates are pre-approved message structures you use to start a conversation, send transactional notifications, or re-engage past customers — anything outside the 24-hour customer service window. This page covers the simplest case: a body-only template with text parameters. For richer variants — header media, dynamic URL buttons, Flow buttons, named parameters — see the dedicated pages below. Find your template ------------------ [Section titled “Find your template”](https://docs.kirimdev.com/sending/send-templates/#find-your-template) List templates already approved for your WhatsApp account: curl https://api.kirimdev.com/v1/$PHONE_ID/templates \ -H "Authorization: Bearer $KIRIM_KEY" Each template returns its `name`, `language`, `status` (`approved` / `pending` / `rejected`), and the parameterised body. ### Name rules [Section titled “Name rules”](https://docs.kirimdev.com/sending/send-templates/#name-rules) `template.name` is a Meta identifier, not free text. It may contain only **lowercase letters, numbers, and underscores** (`^[a-z0-9_]+$`). Surrounding whitespace is trimmed for you, so a name pasted with a stray trailing space still sends. Anything trimming cannot repair — interior spaces, uppercase letters, dashes — is rejected up front with `400 invalid_request_error` rather than being forwarded to Meta, which answers malformed names with a generic “Something went wrong” that is indistinguishable from a real upstream outage. "name": "order_shipped" // ok"name": "order_shipped " // ok - trimmed"name": "order shipped" // 400"name": "Order_Shipped" // 400"name": "order-shipped" // 400 Send a body-only template ------------------------- [Section titled “Send a body-only template”](https://docs.kirimdev.com/sending/send-templates/#send-a-body-only-template) * [cURL](https://docs.kirimdev.com/sending/send-templates/#tab-panel-142) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-templates/#tab-panel-143) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "order_shipped", "language": "id", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Andi" }, { "type": "text", "text": "INV-4521" } ] } ] } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'template', template: { name: 'order_shipped', language: 'id', components: [ { type: 'body', parameters: [ { type: 'text', text: 'Andi' }, { type: 'text', text: 'INV-4521' }, ], }, ], },}) Positional parameters fill the `{{1}}`, `{{2}}`, … placeholders in the template body in declaration order. ### Parameter checks before sending [Section titled “Parameter checks before sending”](https://docs.kirimdev.com/sending/send-templates/#parameter-checks-before-sending) When the template is approved, Kirimdev compares your `components` with it before accepting the request. A payload WhatsApp would reject for every recipient is answered with `400 invalid_request_error` (code `invalid_field_value`) instead of `202` followed by a `failed` status: * The `header` or `body` parameter count differs from the template’s variables. * A `text` parameter is missing, `null`, or blank. * A `text` parameter contains a newline, a tab, or more than 4 consecutive spaces. * A media header has no parameter. * A URL button with a variable has no parameter, or it is blank. The error message names the component, for example `Body expects 2 parameter(s), got 1.` Authentication and carousel templates are not checked here; Meta still validates them. Component shapes at a glance ---------------------------- [Section titled “Component shapes at a glance”](https://docs.kirimdev.com/sending/send-templates/#component-shapes-at-a-glance) Templates support three component `type`s. Each takes a `parameters` array whose shape mirrors Meta’s [Cloud API reference](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates) verbatim — Kirimdev does not re-shape it. | Component | Purpose | Dedicated page | | --- | --- | --- | | `header` | Media or text shown above the body | [Header media](https://docs.kirimdev.com/sending/send-template-header-media/) | | `body` | Parameterised text content | This page | | `button` (per `index`) | Dynamic URL, quick reply, copy code | [Buttons](https://docs.kirimdev.com/sending/send-template-buttons/) | | `button` (`sub_type: url`) | OTP / verification code (AUTHENTICATION) | [OTP](https://docs.kirimdev.com/sending/send-template-otp/) | | `button` (`sub_type: flow`) | Trigger a Meta Flow | [Flow buttons](https://docs.kirimdev.com/sending/send-template-flow/) | Parameters can be **positional** (default) or **named** — see [Named parameters](https://docs.kirimdev.com/sending/send-template-named-params/) . Media card carousels -------------------- [Section titled “Media card carousels”](https://docs.kirimdev.com/sending/send-templates/#media-card-carousels) To send an approved [media card carousel](https://docs.kirimdev.com/sending/create-templates/#media-card-carousels) , add a `carousel` component whose `cards` array carries one entry per card, keyed by `card_index`. Each card supplies its header asset (an uploaded media `id` or a public `link`) and a parameter for every quick-reply button (`payload`) and dynamic URL button (`text`): { "messaging_product": "whatsapp", "to": "+16505551234", "type": "template", "template": { "name": "rare_succulents_carousel", "language": { "code": "en_US" }, "components": [ { "type": "carousel", "cards": [ { "card_index": 0, "components": [ { "type": "header", "parameters": [{ "type": "image", "image": { "id": "1558081531584829" } }] }, { "type": "button", "sub_type": "quick_reply", "index": 0, "parameters": [{ "type": "payload", "payload": "more-aloes" }] } ] }, { "card_index": 1, "components": [ { "type": "header", "parameters": [{ "type": "image", "image": { "link": "https://cdn.example.com/echeveria.jpg" } }] }, { "type": "button", "sub_type": "quick_reply", "index": 0, "parameters": [{ "type": "payload", "payload": "more-echeverias" }] } ] } ] } ] }} You must send **exactly** the number of cards the template was approved with. A card header accepts either an uploaded media `id` (`POST /{phone_number_id}/media`) or a public `link`. If a card’s URL button was created dynamic (`{{1}}` suffix), add a `{ "type": "button", "sub_type": "url", "index": N, "parameters": [{ "type": "text", "text": "" }] }` for it. A static button (static URL / phone number) needs no send-time parameter. Language object form -------------------- [Section titled “Language object form”](https://docs.kirimdev.com/sending/send-templates/#language-object-form) Meta accepts `language` as either a bare string code (`"id"`, `"en_US"`) or an object `{ code, policy? }`. Kirimdev accepts both - prefer the string form since `policy` was deprecated by Meta. See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-templates/#see-also) * [Create templates](https://docs.kirimdev.com/sending/create-templates/) * [Header media](https://docs.kirimdev.com/sending/send-template-header-media/) * [24h window & templates FAQ (Bahasa Indonesia)](https://docs.kirimdev.com/guides/24h-window-and-templates/) * [Buttons (URL, quick reply, copy code)](https://docs.kirimdev.com/sending/send-template-buttons/) * [OTP (authentication templates)](https://docs.kirimdev.com/sending/send-template-otp/) * [Flow buttons](https://docs.kirimdev.com/sending/send-template-flow/) * [Named parameters](https://docs.kirimdev.com/sending/send-template-named-params/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) (see the **Template** request-body tab) * [API Reference — List templates](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/) --- # Receive messages | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/receive-messages/#_top) Messages Receive messages ================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Freceive-messages%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Freceive-messages%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev never polls for new messages — it pushes them to your webhook URL the moment Meta delivers them. Subscribe once; every inbound message and status update fans out as a signed POST. Subscribe --------- [Section titled “Subscribe”](https://docs.kirimdev.com/sending/receive-messages/#subscribe) Create a webhook subscription that listens for the inbound event families you care about: * [cURL](https://docs.kirimdev.com/sending/receive-messages/#tab-panel-110) * [TypeScript SDK](https://docs.kirimdev.com/sending/receive-messages/#tab-panel-111) curl -X POST https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/kirim", "events": ["message.received", "message.status"] }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) await kirim.webhookSubscriptions.create({ url: 'https://your-app.example.com/webhooks/kirim', events: ['message.received', 'message.status'],}) The response carries `initial_secret` **once** — store it server-side so you can verify HMAC signatures on every incoming delivery. See [Verifying signatures](https://docs.kirimdev.com/webhooks/signing/) for the verification recipe. Inbound payload shape --------------------- [Section titled “Inbound payload shape”](https://docs.kirimdev.com/sending/receive-messages/#inbound-payload-shape) `message.received` and `message.status` are **Meta passthrough** events whose top-level body uses Meta’s webhook envelope. Status callbacks preserve Meta’s documented identifiers, errors, pricing, and conversation metadata. The top-level body is: { "object": "whatsapp_business_account", "entry": [ { "id": "", "changes": [ { "field": "messages", "value": { /* Meta value object */ } } ] } ]} Branch on the `X-Kirim-Event` request header to decide what’s inside `entry[0].changes[0].value`: * `X-Kirim-Event: message.received` → `value.messages[]` carries the inbound message. `value.metadata.phone_number_id` is your connected number; `messages[0].from` is the customer’s WhatsApp id. * `X-Kirim-Event: message.status` → `value.statuses[]` carries an outbound delivery update. `statuses[0].id` is the `wamid` of the message you sent. `messages[0].type` selects the type-specific subobject. The shapes below are Meta’s, not Kirimdev’s — see [Meta’s WhatsApp Cloud API webhook reference](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components) : | Inbound `messages[0].type` | Subobject | | --- | --- | | `text` | `text.body` | | `image` / `video` / `audio` / `document` / `sticker` | `{type}.{id, mime_type, sha256, caption?, filename?}` — fetch bytes via `GET /v1/{phone_number_id}/messages/{wamid}/media` | | `location` | `location.{latitude, longitude, name?, address?}` | | `contacts` | `contacts[]` (Meta-shaped) | | `interactive` | `interactive.{type, button_reply?, list_reply?}` | | `reaction` | `reaction.{message_id, emoji}` (empty emoji = unreact) | | `button` | `button.{payload, text}` — quick-reply tap on a template | Kirimdev-native events (`conversation.assigned`, `conversation.closed`, `contact.created`, `contact.updated`) use a different envelope — `{ id, type, created_at, data }`. See [Event catalogue](https://docs.kirimdev.com/webhooks/events/) for those. See [Webhook payloads](https://docs.kirimdev.com/webhooks/payloads/) for full copy-paste fixtures per event type. Acknowledging inbound --------------------- [Section titled “Acknowledging inbound”](https://docs.kirimdev.com/sending/receive-messages/#acknowledging-inbound) Once you’ve persisted the inbound message, mark it as read so the sender’s double-tick turns blue: import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) // `wamid` is the Meta-native id from// body.entry[0].changes[0].value.messages[0].idawait phone.messages.markAsRead(wamid) See [Mark messages as read](https://docs.kirimdev.com/sending/mark-as-read/) for the full Meta-style body shape and optional typing indicator. Reliability ----------- [Section titled “Reliability”](https://docs.kirimdev.com/sending/receive-messages/#reliability) * **Retries**: Failed deliveries (non-2xx response, timeout, or network error) retry with exponential backoff up to ~24 hours. See [Retries & auto-disable](https://docs.kirimdev.com/webhooks/retry/) . * **Replays**: Inspect the dead-letter queue or re-deliver any failed event via the [Webhooks overview](https://docs.kirimdev.com/webhooks/overview/) — every subscription exposes a `/deliveries` collection plus `POST /replay` and `POST /bulk_replay` actions. * **Ordering**: Events for a single conversation arrive in causal order, but Kirimdev does not guarantee global ordering across conversations. See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/receive-messages/#see-also) * [Webhook overview](https://docs.kirimdev.com/webhooks/overview/) * [Event catalog](https://docs.kirimdev.com/webhooks/events/) * [Verifying signatures](https://docs.kirimdev.com/webhooks/signing/) * [Payload examples](https://docs.kirimdev.com/webhooks/payloads/) * [Subscribe to Webhooks guide](https://docs.kirimdev.com/guides/webhooks/) --- # Send templates with buttons | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-template-buttons/#_top) Components Send templates with buttons =========================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) WhatsApp templates can include up to 10 buttons across two categories: **call-to-action** (URL, phone) and **quick reply**. Some button types accept a runtime parameter; others are fully baked at approval time. | Button type | Runtime parameter | `sub_type` | | --- | --- | --- | | Dynamic URL (suffix) | Yes — fills `{{1}}` in the URL | `url` | | Quick reply | Yes — payload returned in webhook | `quick_reply` | | Copy code (marketing / utility) | Yes — the coupon / code text | `copy_code` | | Phone number | No (baked at approval) | — | | Static URL | No (baked at approval) | — | Each button is addressed by its zero-based `index` in the template’s button row, in the order they were approved. Dynamic URL button ------------------ [Section titled “Dynamic URL button”](https://docs.kirimdev.com/sending/send-template-buttons/#dynamic-url-button) The template URL is approved as something like `https://example.com/orders/{{1}}`. You fill `{{1}}` at send time. * [cURL](https://docs.kirimdev.com/sending/send-template-buttons/#tab-panel-130) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-template-buttons/#tab-panel-131) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "order_shipped", "language": "id", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Andi" }, { "type": "text", "text": "INV-4521" } ] }, { "type": "button", "sub_type": "url", "index": 0, "parameters": [ { "type": "text", "text": "INV-4521" } ] } ] } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'template', template: { name: 'order_shipped', language: 'id', components: [ { type: 'body', parameters: [ { type: 'text', text: 'Andi' }, { type: 'text', text: 'INV-4521' }, ], }, { type: 'button', sub_type: 'url', index: 0, parameters: [{ type: 'text', text: 'INV-4521' }], }, ], },}) Quick reply button ------------------ [Section titled “Quick reply button”](https://docs.kirimdev.com/sending/send-template-buttons/#quick-reply-button) The `payload` is what your server receives in the inbound webhook when the user taps the button. { "type": "button", "sub_type": "quick_reply", "index": 0, "parameters": [ { "type": "payload", "payload": "CONFIRM_ORDER_4521" } ]} When the customer taps it, your webhook receives a `type: "button"` message with `button.payload = "CONFIRM_ORDER_4521"`. See [Receive messages](https://docs.kirimdev.com/sending/receive-messages/) for the webhook shape. Copy-code button ---------------- [Section titled “Copy-code button”](https://docs.kirimdev.com/sending/send-template-buttons/#copy-code-button) Used for coupon codes and redemption codes on **marketing / utility** templates — the user taps once to copy the value to their clipboard. { "type": "button", "sub_type": "copy_code", "index": 1, "parameters": [ { "type": "coupon_code", "coupon_code": "DISKON30" } ]} Mixing multiple buttons ----------------------- [Section titled “Mixing multiple buttons”](https://docs.kirimdev.com/sending/send-template-buttons/#mixing-multiple-buttons) Send one `button` component per button index, in any order: "components": [ { "type": "body", "parameters": [ /* ... */ ] }, { "type": "button", "sub_type": "quick_reply", "index": 0, "parameters": [{ "type": "payload", "payload": "YES" }] }, { "type": "button", "sub_type": "quick_reply", "index": 1, "parameters": [{ "type": "payload", "payload": "NO" }] }] See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-template-buttons/#see-also) * [Send templates — overview](https://docs.kirimdev.com/sending/send-templates/) * [OTP (authentication templates)](https://docs.kirimdev.com/sending/send-template-otp/) * [Header media](https://docs.kirimdev.com/sending/send-template-header-media/) * [Flow buttons](https://docs.kirimdev.com/sending/send-template-flow/) * [Receive messages](https://docs.kirimdev.com/sending/receive-messages/) — handling quick-reply taps * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Send templates with a media header | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-template-header-media/#_top) Components Send templates with a media header ================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-header-media%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-header-media%2F%20and%20help%20me%20with%20the%20following%3A%20) If your template was approved with a `HEADER` of type `IMAGE`, `VIDEO`, `DOCUMENT`, or `LOCATION`, you must supply the runtime media under `components[].type = "header"`. Header text variables (`{{1}}` in a `TEXT` header) use the same shape with `{ type: "text" }`. Image header ------------ [Section titled “Image header”](https://docs.kirimdev.com/sending/send-template-header-media/#image-header) * [cURL](https://docs.kirimdev.com/sending/send-template-header-media/#tab-panel-134) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-template-header-media/#tab-panel-135) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "promo_weekend", "language": "id", "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://cdn.example.com/promo.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Andi" } ] } ] } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'template', template: { name: 'promo_weekend', language: 'id', components: [ { type: 'header', parameters: [ { type: 'image', image: { link: 'https://cdn.example.com/promo.jpg' }, }, ], }, { type: 'body', parameters: [{ type: 'text', text: 'Andi' }], }, ], },}) Video header ------------ [Section titled “Video header”](https://docs.kirimdev.com/sending/send-template-header-media/#video-header) { "type": "header", "parameters": [ { "type": "video", "video": { "link": "https://cdn.example.com/demo.mp4" } } ]} Document header --------------- [Section titled “Document header”](https://docs.kirimdev.com/sending/send-template-header-media/#document-header) { "type": "header", "parameters": [ { "type": "document", "document": { "link": "https://cdn.example.com/invoice-4521.pdf", "filename": "invoice-4521.pdf" } } ]} `filename` is optional but recommended — WhatsApp shows it in the chat. Location header --------------- [Section titled “Location header”](https://docs.kirimdev.com/sending/send-template-header-media/#location-header) { "type": "header", "parameters": [ { "type": "location", "location": { "latitude": -6.2088, "longitude": 106.8456, "name": "Toko Pusat", "address": "Jl. Sudirman 1, Jakarta" } } ]} Reuse uploaded media -------------------- [Section titled “Reuse uploaded media”](https://docs.kirimdev.com/sending/send-template-header-media/#reuse-uploaded-media) You can also reference a Meta media `id` instead of a public link — useful when you’ve already uploaded the asset: { "type": "image", "image": { "id": "1539128376424123" }} Use either `link` **or** `id`, not both. Requirements ------------ [Section titled “Requirements”](https://docs.kirimdev.com/sending/send-template-header-media/#requirements) | Field | Constraint | | --- | --- | | Header media type | Must match what was approved (`IMAGE`, `VIDEO`, `DOCUMENT`, `LOCATION`) | | `image.link` / `video.link` / `document.link` | Public HTTPS URL Meta can fetch once at send time | | Image format | JPG, PNG — ≤ 5 MB | | Video format | MP4, 3GPP — ≤ 16 MB | | Document format | PDF, DOC(X), XLS(X), PPT(X), TXT — ≤ 100 MB | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-template-header-media/#see-also) * [Create templates](https://docs.kirimdev.com/sending/create-templates/) * [Send templates — overview](https://docs.kirimdev.com/sending/send-templates/) * [Buttons (URL, quick reply, copy code)](https://docs.kirimdev.com/sending/send-template-buttons/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Create templates | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/create-templates/#_top) Templates Create templates ================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fcreate-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fcreate-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) Use **`POST /v1/{phone_number_id}/templates`** to author a template programmatically. On success Kirimdev persists the row with `status: "pending"` and forwards the structure to Meta for review. Poll **`GET /v1/{phone_number_id}/templates/{name}`** (or run **`POST .../templates/sync`**) until Meta sets `approved` or `rejected`. This page covers **creation**. To **send** an already-approved template (including runtime header images), see [Send templates](https://docs.kirimdev.com/sending/send-templates/) and [Header media at send time](https://docs.kirimdev.com/sending/send-template-header-media/) . Body-only template ------------------ [Section titled “Body-only template”](https://docs.kirimdev.com/sending/create-templates/#body-only-template) * [cURL](https://docs.kirimdev.com/sending/create-templates/#tab-panel-102) * [TypeScript SDK](https://docs.kirimdev.com/sending/create-templates/#tab-panel-103) curl -X POST "https://api.kirimdev.com/v1/$PHONE_ID/templates" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "order_update", "category": "UTILITY", "language": "id", "components": [ { "type": "BODY", "text": "Pesanan {{1}} sedang diproses.", "example": { "body_text": [["A123"]] } } ] }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) const template = await kirim .phoneNumbers(process.env.PHONE_ID!) .templates.create({ name: 'order_update', category: 'UTILITY', language: 'id', components: [ { type: 'BODY', text: 'Pesanan {{1}} sedang diproses.', example: { body_text: [['A123']] }, }, ], }) console.log(template.status) // "pending" A duplicate `name` + `language` for the account returns **`409 template_already_exists`** before any Meta call. Media header (IMAGE / VIDEO / DOCUMENT) --------------------------------------- [Section titled “Media header (IMAGE / VIDEO / DOCUMENT)”](https://docs.kirimdev.com/sending/create-templates/#media-header-image--video--document) Meta requires a **sample asset** at creation time. Kirimdev accepts a **public `https://` URL**, downloads the file server-side, uploads it to Meta via the Resumable Upload API, and submits the resulting asset handle to Meta on your behalf. You only need your Kirim API key — no direct Meta token required. **Preferred field:** `example.header_url` { "name": "promo_gambar", "category": "MARKETING", "language": "id", "components": [ { "type": "HEADER", "format": "IMAGE", "example": { "header_url": ["https://cdn.example.com/banners/juni.jpg"] } }, { "type": "BODY", "text": "Halo {{1}}, ada promo spesial hari ini.", "example": { "body_text": [["Budi"]] } } ]} **Backward-compatible alias:** you may place the same public URL in `example.header_handle` instead of `header_url`. Kirimdev detects `https://` values and treats them as URLs to fetch. ### Requirements for sample URLs [Section titled “Requirements for sample URLs”](https://docs.kirimdev.com/sending/create-templates/#requirements-for-sample-urls) | Constraint | Detail | | --- | --- | | Scheme | `https://` (public internet; private IPs blocked) | | Reachability | Kirimdev servers must be able to `GET` the URL once at create time | | IMAGE | JPEG or PNG, ≤ 5 MB (WebP rejected by Meta for samples) | | VIDEO | MP4 or 3GPP, ≤ 16 MB | | DOCUMENT | PDF and common office formats, ≤ 100 MB | | Content-Type | Served by the origin, or inferable from the file extension | If the URL is unreachable, the wrong type, or too large, the API returns **`400 invalid_field_value`** with `param: "components"`. ### Already have a Meta handle? [Section titled “Already have a Meta handle?”](https://docs.kirimdev.com/sending/create-templates/#already-have-a-meta-handle) If you uploaded the asset yourself via Meta’s Resumable Upload API, pass the handle verbatim: "example": { "header_handle": ["4::aW1hZ2UvanBlZw==:YOUR_HANDLE"] } Kirimdev passes it through without re-uploading. Errors ------ [Section titled “Errors”](https://docs.kirimdev.com/sending/create-templates/#errors) | Situation | HTTP | `error.code` | | --- | --- | --- | | Invalid body / Meta rejects template content | 400 | `invalid_field_value` | | Bad or unreachable header media URL | 400 | `invalid_field_value` | | Duplicate name + language (create) | 409 | `template_already_exists` | | Editing a template still under review (edit) | 409 | `template_not_editable` | | Meta unreachable / transient upstream fault | 502 | `whatsapp_upstream_error` | Meta validation failures (wrong examples, format rules) surface as **400**, not 502 — retrying the same payload will not succeed until the `components` are fixed. Edit a template --------------- [Section titled “Edit a template”](https://docs.kirimdev.com/sending/create-templates/#edit-a-template) Use **`PATCH /v1/{phone_number_id}/templates/{name}`** to change an existing template’s content and re-submit it to Meta. The request body is **components-only** — send the **full** desired `components` array. Meta replaces **all** components at once, so this is a **replacement, not a partial patch**: omitting a component removes it. `name`, `language`, and `category` **cannot** change. When a name has multiple languages, pass **`?language=`** to pick which one to edit. * [cURL](https://docs.kirimdev.com/sending/create-templates/#tab-panel-104) * [TypeScript SDK](https://docs.kirimdev.com/sending/create-templates/#tab-panel-105) curl -X PATCH "https://api.kirimdev.com/v1/$PHONE_ID/templates/order_update?language=id" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "components": [ { "type": "BODY", "text": "Pesanan {{1}} sudah dikirim.", "example": { "body_text": [["A123"]] } } ] }' const template = await kirim .phoneNumbers(process.env.PHONE_ID!) .templates.update( 'order_update', { components: [ { type: 'BODY', text: 'Pesanan {{1}} sudah dikirim.', example: { body_text: [['A123']] }, }, ], }, { language: 'id' }, ) console.log(template.status) // "pending" — an edit re-enters review A successful edit puts the template **back into Meta review**, so the returned `status` is `pending`; poll **`GET /v1/{phone_number_id}/templates/{name}`** for the eventual `approved` / `rejected` transition. Media card carousels -------------------- [Section titled “Media card carousels”](https://docs.kirimdev.com/sending/create-templates/#media-card-carousels) A **carousel** template is a MARKETING message with **2–10 swipeable product cards**. Each card has its own image or video header, an optional body text, and up to two buttons (quick reply, URL, or phone number). Add a `CAROUSEL` component next to the message `BODY`: { "name": "rare_succulents_carousel", "language": "en_US", "category": "MARKETING", "components": [ { "type": "BODY", "text": "Rare succulents for sale!" }, { "type": "CAROUSEL", "cards": [ { "components": [ { "type": "HEADER", "format": "IMAGE", "example": { "header_url": ["https://cdn.example.com/aloe.jpg"] } }, { "type": "BUTTONS", "buttons": [ { "type": "QUICK_REPLY", "text": "Send more like this" }, { "type": "URL", "text": "Shop", "url": "https://shop.example.com/aloe" } ] } ] } // ...at least one more card, same structure ] } ]} Rules Meta enforces (validated up front): * **2–10 cards**, and the approved template always sends exactly that many. * **Every card shares the same structure** — same header format and the same button types in the same order. * **All-or-nothing card body** — if one card has body text, all must. * Carousels are **MARKETING-only** and cannot carry a top-level `HEADER` / `FOOTER` / `BUTTONS` (put those on the cards). * Provide each card header as `example.header_url` (public `https://` URL); Kirimdev uploads it to Meta and keeps the URL so the template stays sendable. A dynamic card URL button (`{{1}}` suffix) needs an `example` value, just like a top-level dynamic URL button. See [Send templates](https://docs.kirimdev.com/sending/send-templates/#media-card-carousels) for how to fill each card at send time. Dashboard alternative --------------------- [Section titled “Dashboard alternative”](https://docs.kirimdev.com/sending/create-templates/#dashboard-alternative) The Kirimdev dashboard can also create templates and accepts a media library file via `headerMediaId` on the internal API. The Public API does not expose `headerMediaId`; use `example.header_url` or create from the dashboard UI instead. Authentication (OTP) templates ------------------------------ [Section titled “Authentication (OTP) templates”](https://docs.kirimdev.com/sending/create-templates/#authentication-otp-templates) Category `AUTHENTICATION` is for one-time passwords. Meta auto-approves these templates and generates the body text; you configure the security disclaimer, optional expiry footer, and OTP button. Full create + send examples live on [OTP (authentication templates)](https://docs.kirimdev.com/sending/send-template-otp/) . If Meta rejects creation, inspect the API error’s `message`. Kirimdev returns Meta’s most specific available validation detail, which may identify an invalid component, OTP button setting, example value, or another rejected parameter. The generic `Invalid parameter` text is used only when Meta does not provide a more precise explanation. See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/create-templates/#see-also) * [OTP (authentication templates)](https://docs.kirimdev.com/sending/send-template-otp/) * [Send templates](https://docs.kirimdev.com/sending/send-templates/) * [Header media at send time](https://docs.kirimdev.com/sending/send-template-header-media/) * [API Reference — Create a template](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/post/) * [Changelog — Create templates](https://docs.kirimdev.com/changelog/2026-06-14-create-template/) * [Changelog — Edit templates](https://docs.kirimdev.com/changelog/2026-08-26-edit-template/) [API reference](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/post/) --- # Send OTP (authentication templates) | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-template-otp/#_top) Components Send OTP (authentication templates) =================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-otp%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-otp%2F%20and%20help%20me%20with%20the%20following%3A%20) **Authentication** templates are the only supported way to send OTP / verification codes on WhatsApp. They use category `AUTHENTICATION`, have fixed body copy generated by Meta, and usually include a **copy-code** button that Meta stores internally as a **URL** button at approval time. Kirimdev forwards your `components` array to Meta **verbatim** — the send shape below matches what Meta’s [authentication template guide](https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/copy-code-button-authentication-templates) expects. It is **not** the same as marketing/utility `copy_code` buttons documented on [Buttons](https://docs.kirimdev.com/sending/send-template-buttons/) . Prerequisites ------------- [Section titled “Prerequisites”](https://docs.kirimdev.com/sending/send-template-otp/#prerequisites) 1. An **approved** template with category `AUTHENTICATION` on the WhatsApp account behind `$PHONE_ID`. 2. The exact `language` code Meta approved (e.g. `id`, `en_US`) — confirm with `GET /v1/{phone_number_id}/templates/{name}`. Create an authentication template --------------------------------- [Section titled “Create an authentication template”](https://docs.kirimdev.com/sending/send-template-otp/#create-an-authentication-template) Authentication templates are **auto-approved** by Meta (no 24-hour marketing review). Body text is fixed; you only configure security disclaimer, optional expiry footer, and the OTP button type. * [cURL](https://docs.kirimdev.com/sending/send-template-otp/#tab-panel-138) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-template-otp/#tab-panel-139) curl -X POST "https://api.kirimdev.com/v1/$PHONE_ID/templates" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "otp_verification", "category": "AUTHENTICATION", "language": "id", "messageSendTtlSeconds": 600, "components": [ { "type": "BODY", "add_security_recommendation": true }, { "type": "FOOTER", "code_expiration_minutes": 5 }, { "type": "BUTTONS", "buttons": [{ "type": "OTP", "otp_type": "COPY_CODE" }] } ] }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) const template = await kirim .phoneNumbers(process.env.PHONE_ID!) .templates.create({ name: 'otp_verification', category: 'AUTHENTICATION', language: 'id', messageSendTtlSeconds: 600, components: [ { type: 'BODY', add_security_recommendation: true }, { type: 'FOOTER', code_expiration_minutes: 5 }, { type: 'BUTTONS', buttons: [{ type: 'OTP', otp_type: 'COPY_CODE' }], }, ], }) console.log(template.status) // usually "approved" quickly After creation (or `POST .../templates/sync`), inspect `GET .../templates/otp_verification`. The `BUTTONS` component typically shows `type: "URL"` with a WhatsApp OTP URL containing `otp{{1}}` — that is normal. Send the OTP code ----------------- [Section titled “Send the OTP code”](https://docs.kirimdev.com/sending/send-template-otp/#send-the-otp-code) Pass the **same** one-time code in **two** places: 1. `body` → `parameters[0].text` 2. `button` → `sub_type: "url"`, `index: 0`, `parameters[0].text` The code must be **≤ 15 characters** (Meta limit for authentication parameters). No URLs, media, or emoji in the value. * [cURL](https://docs.kirimdev.com/sending/send-template-otp/#tab-panel-140) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-template-otp/#tab-panel-141) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "otp_verification", "language": "id", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "847291" } ] }, { "type": "button", "sub_type": "url", "index": 0, "parameters": [ { "type": "text", "text": "847291" } ] } ] } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) const code = '847291' await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'template', template: { name: 'otp_verification', language: 'id', components: [ { type: 'body', parameters: [{ type: 'text', text: code }], }, { type: 'button', sub_type: 'url', index: 0, parameters: [{ type: 'text', text: code }], }, ], },}) The API returns `status: "pending"` immediately; poll `GET /v1/{phone_number_id}/messages/{id}` or subscribe to a [`message.status` webhook](https://docs.kirimdev.com/webhooks/events/) for `sent` / `failed`. Body only (no copy button) -------------------------- [Section titled “Body only (no copy button)”](https://docs.kirimdev.com/sending/send-template-otp/#body-only-no-copy-button) If your approved template has **no** dynamic button (uncommon for OTP), send only the `body` component and omit the `button` block entirely. Troubleshooting `(#100) Invalid parameter` ------------------------------------------ [Section titled “Troubleshooting (#100) Invalid parameter”](https://docs.kirimdev.com/sending/send-template-otp/#troubleshooting-100-invalid-parameter) | Mistake | Fix | | --- | --- | | `sub_type: "copy_code"` + `coupon_code` on an **AUTHENTICATION** template | Use `sub_type: "url"` and `parameters[].type: "text"` (see above) | | `copy_code` works for **MARKETING/UTILITY** coupon buttons only | See [Buttons](https://docs.kirimdev.com/sending/send-template-buttons/)
— different category | | OTP in body ≠ OTP in button | Both values must match | | Wrong `language` (`id` vs `id_ID`) | Copy from `GET .../templates/{name}` | | Button `index` not `0` | Match the button order in the approved template | | Extra `button` block when template has no `{{` in button URL | Drop the button component | See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-template-otp/#see-also) * [Create templates](https://docs.kirimdev.com/sending/create-templates/) * [Send templates — overview](https://docs.kirimdev.com/sending/send-templates/) * [Buttons (marketing / utility)](https://docs.kirimdev.com/sending/send-template-buttons/) * [24h window & templates FAQ](https://docs.kirimdev.com/guides/24h-window-and-templates/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) * [Meta — Copy code authentication templates](https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates/copy-code-button-authentication-templates) --- # Send templates with named parameters | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-template-named-params/#_top) Components Send templates with named parameters ==================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-named-params%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-named-params%2F%20and%20help%20me%20with%20the%20following%3A%20) By default, template parameters are **positional** — the first `{ type: "text" }` fills `{{1}}`, the second fills `{{2}}`, and so on. Templates approved on Meta v18+ can use **named parameters** instead, which are more robust to template edits and easier to audit. A template body approved with named parameters looks like: Halo {{customer_name}}, pesanan {{order_id}} sudah dikirim. You then send it with `parameter_name` fields: * [cURL](https://docs.kirimdev.com/sending/send-template-named-params/#tab-panel-136) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-template-named-params/#tab-panel-137) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "order_shipped_v2", "language": "id", "components": [ { "type": "body", "parameters": [ { "type": "text", "parameter_name": "customer_name", "text": "Andi" }, { "type": "text", "parameter_name": "order_id", "text": "INV-4521" } ] } ] } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'template', template: { name: 'order_shipped_v2', language: 'id', components: [ { type: 'body', parameters: [ { type: 'text', parameter_name: 'customer_name', text: 'Andi' }, { type: 'text', parameter_name: 'order_id', text: 'INV-4521' }, ], }, ], },}) When to use named over positional --------------------------------- [Section titled “When to use named over positional”](https://docs.kirimdev.com/sending/send-template-named-params/#when-to-use-named-over-positional) | Reason | Detail | | --- | --- | | Resilient to re-ordering | If you swap `{{1}}` and `{{2}}` during template re-approval, named params still resolve correctly | | Self-documenting code | Reading the request body, you see _what_ each value means without referring back to the template body | | Required by Meta v18+ for utility templates | Some newer template categories only accept named parameters | Mixing positional and named --------------------------- [Section titled “Mixing positional and named”](https://docs.kirimdev.com/sending/send-template-named-params/#mixing-positional-and-named) You cannot mix the two styles within the same template — Meta picks the style at approval time. Inspect a template via `GET /v1/{phone_number_id}/templates/{name}` to see whether its parameters are positional or named. See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-template-named-params/#see-also) * [Send templates — overview](https://docs.kirimdev.com/sending/send-templates/) * [Header media](https://docs.kirimdev.com/sending/send-template-header-media/) * [Buttons (URL, quick reply, copy code)](https://docs.kirimdev.com/sending/send-template-buttons/) * [API Reference — List templates](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Send templates with a Flow button | Kirimdev [Skip to content](https://docs.kirimdev.com/sending/send-template-flow/#_top) Components Send templates with a Flow button ================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-flow%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsending%2Fsend-template-flow%2F%20and%20help%20me%20with%20the%20following%3A%20) A **Flow button** opens an interactive multi-screen experience built with [WhatsApp Flows](https://developers.facebook.com/docs/whatsapp/flows) . When the template was approved with a `FLOW` button, you launch it at send time with `sub_type: "flow"`. Send a template with a Flow button ---------------------------------- [Section titled “Send a template with a Flow button”](https://docs.kirimdev.com/sending/send-template-flow/#send-a-template-with-a-flow-button) * [cURL](https://docs.kirimdev.com/sending/send-template-flow/#tab-panel-132) * [TypeScript SDK](https://docs.kirimdev.com/sending/send-template-flow/#tab-panel-133) curl -X POST \ https://api.kirimdev.com/v1/$PHONE_ID/messages \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "appointment_booking", "language": "id", "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "Andi" } ] }, { "type": "button", "sub_type": "flow", "index": 0, "parameters": [ { "type": "action", "action": { "flow_token": "tok_abc123", "flow_action_data": { "customer_name": "Andi", "preferred_slot": "2026-06-01T10:00:00+07:00" } } } ] } ] } }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'template', template: { name: 'appointment_booking', language: 'id', components: [ { type: 'body', parameters: [{ type: 'text', text: 'Andi' }], }, { type: 'button', sub_type: 'flow', index: 0, parameters: [ { type: 'action', action: { flow_token: 'tok_abc123', flow_action_data: { customer_name: 'Andi', preferred_slot: '2026-06-01T10:00:00+07:00', }, }, }, ], }, ], },}) Parameter shape --------------- [Section titled “Parameter shape”](https://docs.kirimdev.com/sending/send-template-flow/#parameter-shape) | Field | Required | Purpose | | --- | --- | --- | | `flow_token` | Yes | Opaque string you generate to correlate the Flow response with this send. Echoed back in the webhook. | | `flow_action_data` | No | JSON object pre-populating the first screen of the Flow. Schema is defined by your Flow JSON. | Receiving the response ---------------------- [Section titled “Receiving the response”](https://docs.kirimdev.com/sending/send-template-flow/#receiving-the-response) When the customer completes the Flow, your webhook receives an `interactive` message with `interactive.type = "nfm_reply"` containing the submitted form data plus your original `flow_token`. Use the token to look up which send the response belongs to. { "type": "interactive", "interactive": { "type": "nfm_reply", "nfm_reply": { "name": "flow", "response_json": "{\"customer_name\":\"Andi\",\"slot\":\"...\"}", "body": "Form submitted" } }} See [Receive messages](https://docs.kirimdev.com/sending/receive-messages/) for the full webhook envelope. See also -------- [Section titled “See also”](https://docs.kirimdev.com/sending/send-template-flow/#see-also) * [Send templates — overview](https://docs.kirimdev.com/sending/send-templates/) * [Buttons (URL, quick reply, copy code)](https://docs.kirimdev.com/sending/send-template-buttons/) * [Receive messages](https://docs.kirimdev.com/sending/receive-messages/) — handling `nfm_reply` * [Meta — WhatsApp Flows](https://developers.facebook.com/docs/whatsapp/flows) * [API Reference — Send a WhatsApp message](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Event Catalogue | Kirimdev [Skip to content](https://docs.kirimdev.com/webhooks/events/#_top) Webhooks Event Catalogue =============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fevents%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fevents%2F%20and%20help%20me%20with%20the%20following%3A%20) Webhook subscriptions are **organisation-scoped**. One subscription receives the events you select, across every WhatsApp account in your organisation. Choose the events you want when you create the subscription, and update the list at any time. Event types ----------- [Section titled “Event types”](https://docs.kirimdev.com/webhooks/events/#event-types) | Event | `X-Kirim-Source` | When it fires | | --- | --- | --- | | [`message.received`](https://docs.kirimdev.com/webhooks/events/#messagereceived) | `meta` | A customer sent a WhatsApp message to any of your connected numbers. | | [`message.status`](https://docs.kirimdev.com/webhooks/events/#messagestatus) | `meta` | Meta emitted an outbound delivery callback: `sent`, `delivered`, `read`, `failed`, or `played` (voice notes). | | [`message.sent`](https://docs.kirimdev.com/webhooks/events/#messagesent) | `kirim` | Kirimdev accepted an outbound send (API, dashboard, broadcast, or phone-app echo) and Meta returned a `wamid`. Full message body included. | | [`message.revoked`](https://docs.kirimdev.com/webhooks/events/#messagerevoked) | `kirim` | A customer deleted (“delete for everyone”) a previously sent message on their phone. **Coexistence-only.** | | [`message.edited`](https://docs.kirimdev.com/webhooks/events/#messageedited) | `kirim` | A customer edited a previous message AND Meta forwarded the new body. **Coexistence-only. Currently dormant** — see Meta advisory below. | | [`conversation.assigned`](https://docs.kirimdev.com/webhooks/events/#conversationassigned) | `kirim` | A conversation’s `assigned_to` user changed. | | [`conversation.closed`](https://docs.kirimdev.com/webhooks/events/#conversationclosed) | `kirim` | A conversation’s status flipped to `resolved`. | | [`contact.created`](https://docs.kirimdev.com/webhooks/events/#contactcreated) | `kirim` | A new contact row was inserted (inbound auto-create or `POST /v1/{phone_number_id}/contacts`). | | [`contact.updated`](https://docs.kirimdev.com/webhooks/events/#contactupdated) | `kirim` | An existing contact’s name, email, labels, or metadata changed. | | [`contact.identity_updated`](https://docs.kirimdev.com/webhooks/events/#contactidentity_updated) | `kirim` | Meta rotated a contact’s Business-Scoped User ID (BSUID) — typically after the user changed their phone number. | | [`customer.created`](https://docs.kirimdev.com/webhooks/events/#customercreated) | `kirim` | A new end-customer (multi-tenant platform mode) row was inserted. | | [`customer.updated`](https://docs.kirimdev.com/webhooks/events/#customerupdated) | `kirim` | An end-customer’s name, email, metadata, or `status` changed. | | [`customer.archived`](https://docs.kirimdev.com/webhooks/events/#customerarchived) | `kirim` | An end-customer was soft-archived. | | [`customer.onboarded`](https://docs.kirimdev.com/webhooks/events/#customeronboarded) | `kirim` | An end-customer connected their first WhatsApp number via a setup link. | | [`customer.setup_link.created`](https://docs.kirimdev.com/webhooks/events/#customersetup_linkcreated) | `kirim` | An operator generated a setup link for an end-customer. | | [`customer.setup_link.consumed`](https://docs.kirimdev.com/webhooks/events/#customersetup_linkconsumed) | `kirim` | An end-customer completed onboarding through a setup link (paired with `customer.onboarded`). | Meta-sourced events ------------------- [Section titled “Meta-sourced events”](https://docs.kirimdev.com/webhooks/events/#meta-sourced-events) For `message.received` and `message.status`, Kirimdev uses Meta’s WhatsApp webhook envelope. Refer to Meta’s [WhatsApp Cloud API webhook reference](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components) for the base schema. `message.status` preserves the documented identifiers, structured errors, pricing, and legacy conversation metadata when present. The `X-Kirim-Event-Id` header carries Meta’s `wamid`, suitable for dedupe. Kichat invitation URLs in incoming WhatsApp content have their fragment token replaced with `[redacted]` before processing. The same protection applies to phone-app echoes and history imports. Downstream message content may therefore contain a redacted link rather than the original private credential; do not use that link as a sign-in URL. The top-level body is Meta’s envelope: { "object": "whatsapp_business_account", "entry": [ { "id": "", "changes": [ { "field": "messages", "value": { /* Meta value object */ } } ] } ]} Branch on the `X-Kirim-Event` request header (`message.received` vs `message.status`) to decide how to parse `entry[0].changes[0].value`. See [Payload examples](https://docs.kirimdev.com/webhooks/payloads/) for fully realised fixtures. ### `message.received` [Section titled “message.received”](https://docs.kirimdev.com/webhooks/events/#messagereceived) Inbound message from a customer. Body type is whatever the customer sent: `text`, `image`, `document`, `video`, `audio`, `location`, `contacts`, `interactive` (button/list reply), `reaction`, or `button` (template reply). Reaction events are delivered after Kirimdev has persisted the reaction audit row and updated the target message’s reaction badge. Their Meta-native body contains `reaction.message_id` (the target wamid) and `reaction.emoji`; an empty emoji means the customer removed the reaction. The relevant `phone_number_id` to use for follow-up sends or media fetches is at `entry[0].changes[0].value.metadata.phone_number_id`. **`kirim` enrichment (optional).** Since June 2026, `message.received` bodies may include a top-level `kirim` object with Kirimdev resource ids, conversation labels, assignee, and — for media messages — a hosted `media_url` on `media.kirimdev.com`. Parsers that only walk `entry[]` can ignore `kirim`. Text messages fire immediately; inbound media waits until the file is stored (~1–3 s) so `kirim.media_url` is ready on the first delivery. ### `message.status` [Section titled “message.status”](https://docs.kirimdev.com/webhooks/events/#messagestatus) Outbound delivery status. The status field cycles `sent` → `delivered` → `read`. Failed sends emit a single `failed` status with an `errors[]` array. Outbound **voice notes** may also emit `played` when the recipient first plays the audio — independent of read receipts. Kirimdev persists the first `played` moment as `played_at` on the message (Public API) using Meta’s webhook timestamp. Statuses may arrive out of order; treat them as a state machine, not a sequence. **Pre-delivery (pre-Meta) failures now emit `failed` too.** Some sends fail _before_ Meta ever admits the message — a transient Meta outage (error `131000`), a quota/entitlement refusal, an account cooldown, or a compliance block. Meta issues no `wamid` and sends no status webhook for these, so historically you only learned about them by polling `GET /v1/messages/{id}`. Kirimdev now synthesizes a `message.status` `failed` event for them so you get the same push signal as a Meta-emitted failure. Two differences to code for: * **`statuses[0].id` is the Kirimdev `msg_…` id**, not a `wamid.…` — no wamid exists. It matches the `id` returned by your original send call, so correlation is direct. * **`errors[0].code`** carries Meta’s integer code when the failure came back from Meta (e.g. `131000`); for a Kirimdev-side refusal (quota, compliance, cooldown, suspended customer) it is the sentinel `-1`. Map either to a stable Kirimdev code via the [error catalogue](https://docs.kirimdev.com/concepts/errors/) . Transient Meta failures (`131000` and similar) are now retried on a longer schedule (roughly 1 min → 2 min → 4 min → 8 min, about a 15-minute window) before the terminal `failed` event fires, so a brief Meta-side blip resolves itself instead of surfacing as a permanent failure. ### `message.sent` [Section titled “message.sent”](https://docs.kirimdev.com/webhooks/events/#messagesent) Fires when Kirimdev successfully sends an outbound message and Meta returns a `wamid`. Covers sends from the Public API, dashboard composer, broadcast campaigns, and coexistence phone-app echoes (`source: app`). **Headers:** `X-Kirim-Source: kirim`, `X-Kirim-Event: message.sent` **Body** — Kirimdev-native envelope with a normalized outbound payload in `data`. Use `data.session` (alias for `meta.phone_number_id`) to route multi-number CRM integrations on one webhook URL. { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX:sent", "type": "message.sent", "created_at": "2026-06-16T10:00:00.000Z", "data": { "session": "106540352242922", "direction": "outbound", "from_me": true, "timestamp": "2026-06-16T10:00:00.000Z", "message": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "provider_id": "wamid.HBgN…", "type": "text", "body": "Baik kak, ini nomor rekeningnya ya.", "from": "+6288770000000", "to": "+6282297983399", "status": "sent", "source": "api", "reply_to_provider_id": null }, "conversation": { "id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWX", "status": "open" }, "contact": { "id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "phone_number": "+6282297983399", "name": "Customer Name" }, "meta": { "phone_number_id": "106540352242922", "display_phone_number": "6288770000000", "provider": "kirimdev" } }} Dedupe on `X-Kirim-Event-Id` — stable per message as `{msg_external_id}:sent`. Broadcast recipients use `broadcast_msg:{internal_id}:sent` and set `message.source` to `broadcast` (no `msg_*` row exists for those sends). Pair with `message.status` for delivery/read receipts — `message.sent` carries the body; `message.status` carries Meta’s status transitions. **Media (image, video, audio, document, sticker):** the `message` block includes `media_url` (permanent `https://media.kirimdev.com/...` URL), `media_status` (`ready` when the URL is available), and a Meta-style nested block (`image`, `video`, `document`, etc.) with `link` + `caption` so parsers that expect the inbound wire shape work without remapping. For API and dashboard sends the URL is present when the webhook fires. Phone-app echoes (`source: app`) with media defer the `message.sent` webhook until Kirimdev finishes storing the asset — same discipline as inbound `message.received`. Text echoes still fire immediately. "message": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "provider_id": "wamid.HBgN…", "type": "image", "body": "Bukti transfer", "media_url": "https://media.kirimdev.com/whatsapp///bukti-transfer.jpg", "media_status": "ready", "image": { "link": "https://media.kirimdev.com/whatsapp///bukti-transfer.jpg", "caption": "Bukti transfer" }, "from": "+6288770000000", "to": "+6282297983399", "status": "sent", "source": "api", "reply_to_provider_id": null} Kirimdev-native events ---------------------- [Section titled “Kirimdev-native events”](https://docs.kirimdev.com/webhooks/events/#kirimdev-native-events) Kirimdev-native events (`message.sent`, `conversation.*`, `contact.*`, and `customer.*`) use a standard envelope: { "id": "evt_01HXYZABCDEFGHJKMNPQRSTVWX", "type": "contact.created", "created_at": "2026-05-23T10:00:00Z", "data": { "...": "..." }} The envelope has exactly four fields: `id`, `type`, `created_at`, `data`. There is no `livemode` field — Kirimdev does not split test/live environments today. ### `message.revoked` [Section titled “message.revoked”](https://docs.kirimdev.com/webhooks/events/#messagerevoked) A WhatsApp contact deleted (“delete for everyone”) a previously sent message on their phone. Meta only emits revoke webhooks for **Coexistence** numbers (users onboarded via the WhatsApp Business app with Cloud API coexistence) — pure Cloud API numbers never receive revoke events regardless of your subscription. { "id": "evt_01HXYZABCDEFGHJKMNPQRSTVWX", "type": "message.revoked", "created_at": "2026-07-11T15:34:10.000Z", "data": { "message_id": "msg_01HXYZABCDEFGHJKMNPQRSTVXY", "provider_id": "wamid.HBgLMTY1MDM4Nzk0MzkV...", "conversation_id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWZ", "contact_id": "ctc_01HXYZABCDEFGHJKMNPQRSTVW0", "contact_phone_number": "+6285887130408", "phone_number_id": "890836697444150", "display_phone_number": "6281295648580", "revoked_at": "2026-07-11T15:34:10.000Z" }} The message row is NOT deleted from Kirimdev — it is flagged `is_revoked: true` so the audit trail is preserved. Subsequent `GET /v1/{phone_number_id}/messages/{id}` calls still return the row with the original body; add your own read-side filter if you want to hide revoked messages from a downstream UI. ### `message.edited` [Section titled “message.edited”](https://docs.kirimdev.com/webhooks/events/#messageedited) A customer edited a previous message AND Meta forwarded the new body. Coexistence-only. { "id": "evt_...", "type": "message.edited", "created_at": "2026-07-11T15:33:22.000Z", "data": { "message_id": "msg_01HXYZABCDEFGHJKMNPQRSTVXY", "provider_id": "wamid.HBgLMTY1MDM4Nzk0MzkV...", "conversation_id": "cnv_...", "contact_id": "ctc_...", "contact_phone_number": "+6285887130408", "phone_number_id": "890836697444150", "display_phone_number": "6281295648580", "new_content": "Halooee", "original_content": "Halo", "edited_at": "2026-07-11T15:33:22.000Z", "edit_history": [ { "content": "Halo", "edited_at": "2026-07-11T15:33:15.000Z" } ] }} `original_content` is the FIRST version of the message and never overwrites through subsequent edits. `edit_history` is the chronological revision log (Meta only allows edits within 15 minutes of the original send). ### `unsupported.type` hint on `message.received` [Section titled “unsupported.type hint on message.received”](https://docs.kirimdev.com/webhooks/events/#unsupportedtype-hint-on-messagereceived) For every inbound message where `type === "unsupported"`, the Meta passthrough body now carries an `unsupported.type` field with Meta’s own sub-kind hint. This helps you differentiate common cases: * `"edit"` — the contact edited a previous message. Meta refused to forward the new body (see the advisory above). * `"unknown"` — a message type Meta itself cannot classify (typically a new WhatsApp product not yet in the Cloud API contract). Kirimdev does not restrict this to a fixed set — Meta may introduce further sub-kinds (`view_once`, `poll`, …) at any time. "messages": [{ "from": "6285887130408", "id": "wamid...", "timestamp": "1783760270", "type": "unsupported", "unsupported": { "type": "edit" }}] The same hint is surfaced on the REST read endpoints — `GET /v1/{phone_number_id}/messages` and `GET /v1/{phone_number_id}/messages/{id}` now emit an `unsupported: { type }` object on unsupported rows: { "id": "msg_...", "object": "message", "type": "unsupported", "content": null, "unsupported": { "type": "edit" }, "status": "delivered", "...": "..."} The `unsupported` field is only present when populated; non-unsupported rows and older rows ingested before this feature omit it. ### `conversation.assigned` [Section titled “conversation.assigned”](https://docs.kirimdev.com/webhooks/events/#conversationassigned) { "id": "evt_…", "type": "conversation.assigned", "created_at": "2026-05-23T10:00:00Z", "data": { "conversation": { "id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "conversation", "status": "open" }, "assignee": { "user_id": "U7d2k9mq", "team_id": "tem_01HXYZ…", "previous_user_id": null } }} `user_id` / `previous_user_id` are raw internal user identifiers (nanoid strings), not kirim-prefixed resource ids. `previous_user_id` is the user the conversation was assigned to before the change (null on first assignment). ### `conversation.closed` [Section titled “conversation.closed”](https://docs.kirimdev.com/webhooks/events/#conversationclosed) { "id": "evt_…", "type": "conversation.closed", "created_at": "2026-05-23T10:00:00Z", "data": { "conversation": { "id": "cnv_…", "object": "conversation", "status": "resolved", "closed_by_user_id": "U7d2k9mq" } }} ### `contact.created` [Section titled “contact.created”](https://docs.kirimdev.com/webhooks/events/#contactcreated) { "id": "evt_…", "type": "contact.created", "created_at": "2026-05-23T10:00:00Z", "data": { "contact": { "id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "contact", "phone_number": "+628111111111", "name": "John Doe", "email": null, "metadata": null, "phone_number_id": "106540352242922", "created_at": "2026-05-23T10:00:00Z", "updated_at": "2026-05-23T10:00:00Z" } }} ### `contact.updated` [Section titled “contact.updated”](https://docs.kirimdev.com/webhooks/events/#contactupdated) { "id": "evt_…", "type": "contact.updated", "created_at": "2026-05-23T10:00:00Z", "data": { "contact": { "id": "ctc_…", "object": "contact", "phone_number": "+628111111111", "name": "John Doe (updated)", "email": "john@example.com", "...": "..." }, "changed_fields": ["name", "email"] }} `changed_fields` lists only field names that actually differ from the prior version — useful for routing minimal handlers. The event is suppressed when no fields actually changed. ### `contact.identity_updated` [Section titled “contact.identity\_updated”](https://docs.kirimdev.com/webhooks/events/#contactidentity_updated) Fires when Meta rotates a contact’s **Business-Scoped User ID (BSUID)**. Meta regenerates BSUIDs when a WhatsApp user changes their phone number — existing conversations still work (the BSUID is stable across username changes), but every downstream cache keyed on BSUID must be refreshed. This event fires regardless of how Meta reports the rotation to us — whether via the dedicated identity-update signal or, when a user changes their phone number, as a system message on the underlying WhatsApp webhook. Either way you receive the same payload below, and Kirimdev’s own contact row is migrated to the new BSUID before the event is sent. { "id": "evt_…", "type": "contact.identity_updated", "created_at": "2026-07-01T02:00:00Z", "data": { "contact_id": "ctc_…", "old_bsuid": "US.13491208655302741918", "new_bsuid": "US.20393104582938104571", "old_parent_bsuid": null, "new_parent_bsuid": null, "phone_number": "628123456789" }} * `old_bsuid` / `new_bsuid` — always present. The mapping is transparent to the underlying `contact_id`; existing `contacts.retrieve()` calls keep working. * `old_parent_bsuid` / `new_parent_bsuid` — populated only for managed businesses that enrolled in the parent BSUID program. * `phone_number` — the phone Meta gave us alongside the rotation, if any (may be null). Consumers that cache BSUID → user mappings should invalidate `old_bsuid` and refetch by `contact_id`. Kirimdev’s own contact row is auto-migrated to the new BSUID before this event fires. Platform-mode events -------------------- [Section titled “Platform-mode events”](https://docs.kirimdev.com/webhooks/events/#platform-mode-events) Six `customer.*` events fire across an end-customer’s onboarding lifecycle. They share the standard Kirimdev-native envelope but only matter if you’re running [multi-tenant platform mode](https://docs.kirimdev.com/platform/) . | Event | Triggered by | | --- | --- | | `customer.created` | `POST /v1/customers` | | `customer.updated` | `PATCH /v1/customers/{id}` | | `customer.archived` | `DELETE /v1/customers/{id}` | | `customer.onboarded` | End-customer completes Embedded Signup via a setup link. | | `customer.setup_link.created` | `POST /v1/customers/{id}/setup_links` | | `customer.setup_link.consumed` | A setup link is consumed (paired with `customer.onboarded`). | Full payload reference and field tables live on the platform docs: **[Platform → Webhooks](https://docs.kirimdev.com/platform/webhooks/) **. Subscribing ----------- [Section titled “Subscribing”](https://docs.kirimdev.com/webhooks/events/#subscribing) Subscribe via the dashboard (**Developers → Webhooks → Create**) or the API. Subscriptions are **organisation-scoped** and live at the root of `/v1` — not under a phone number: * [cURL](https://docs.kirimdev.com/webhooks/events/#tab-panel-166) * [TypeScript](https://docs.kirimdev.com/webhooks/events/#tab-panel-167) * [Python](https://docs.kirimdev.com/webhooks/events/#tab-panel-168) curl -X POST https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/kirim", "events": [ "message.received", "message.status", "contact.identity_updated", "conversation.assigned", "conversation.closed", "contact.created", "contact.updated" ], "description": "production listener" }' Response: { "data": { "id": "wbs_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_subscription", "url": "https://your-app.example.com/webhooks/kirim", "events": ["message.received", "..."], "status": "active", "description": "production listener", "disabled_reason": null, "consecutive_failures": 0, "secrets": [ { "id": "sec_01HXYZ…", "created_at": "2026-05-23T10:00:00Z" } ], "initial_secret": "whsec_…", "created_at": "2026-05-23T10:00:00Z", "updated_at": "2026-05-23T10:00:00Z" }} `initial_secret` is returned **once**. Store it now — you can mint additional secrets later via `/secrets`, but you can’t re-read the original. import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) const subscription = await kirim.webhookSubscriptions.create({ url: 'https://your-app.example.com/webhooks/kirim', events: [ 'message.received', 'message.status', 'conversation.assigned', 'conversation.closed', 'contact.created', 'contact.updated', ], description: 'production listener',}) console.log(subscription.id) // wbs_01HXYZ…console.log(subscription.initial_secret) // whsec_… — persist now import osimport httpx resp = httpx.post( "https://api.kirimdev.com/v1/webhook_subscriptions", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}, json={ "url": "https://your-app.example.com/webhooks/kirim", "events": [ "message.received", "message.status", "contact.identity_updated", "conversation.assigned", "conversation.closed", "contact.created", "contact.updated", ], "description": "production listener", },)resp.raise_for_status()sub = resp.json()["data"]print(sub["id"], sub["initial_secret"]) # store the secret You may subscribe to a subset — passing `["message.received"]` only fans out that event type. Edit the subscribed list at any time: await kirim.webhookSubscriptions.update('wbs_…', { events: ['message.received', 'message.status'],}) What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/webhooks/events/#whats-next) Verifying signatures Verify the HMAC on every delivery before trusting the payload. [Read →](https://docs.kirimdev.com/webhooks/signing/) Retries & auto-disable What happens when your endpoint returns a non-2xx, and how to re-enable. [Read →](https://docs.kirimdev.com/webhooks/retry/) Payload examples Full body fixtures for every event in this catalogue. [Read →](https://docs.kirimdev.com/webhooks/payloads/) Subscribe to webhooks (guide) Hands-on walk-through from subscription create to first verified delivery. [Read →](https://docs.kirimdev.com/guides/webhooks/) --- # Webhooks Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/webhooks/overview/#_top) Webhooks Webhooks Overview ================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Foverview%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Foverview%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev pushes events to your server via signed HTTP POSTs. You subscribe a URL once at the organisation level, pick which events you care about, and Kirimdev takes care of retries, dead-letter queueing, and signing-secret rotation. Why webhooks (vs polling) ------------------------- [Section titled “Why webhooks (vs polling)”](https://docs.kirimdev.com/webhooks/overview/#why-webhooks-vs-polling) Polling `GET /v1/{phone_number_id}/messages` on a timer is the wrong answer for almost every integration: * **Latency.** Polling at 1 Hz adds an average 500 ms before you notice an inbound message — long enough for your bot to feel sluggish. Webhooks land in under 200 ms from the customer hitting send. * **Cost.** A 1 Hz poll burns 86,400 requests per day per number against your rate limit, almost all of them empty. * **Race conditions.** Status transitions (`sent` → `delivered` → `read`) happen faster than you can poll; you’ll miss intermediate states. Webhooks invert the relationship: Kirimdev tells _you_ when something happened, you stay idle until it does. Two payload sources ------------------- [Section titled “Two payload sources”](https://docs.kirimdev.com/webhooks/overview/#two-payload-sources) Every webhook POST carries an `X-Kirim-Source` header. Its value tells you whether the body is **Meta passthrough** or a **Kirimdev-native envelope**: X-Kirim-Source: meta Events that originated inside Meta — a customer messaged you (`message.received`), or Meta confirmed a delivery status (`message.status`). The body uses Meta’s WhatsApp webhook envelope, so existing WhatsApp Cloud API parsers can handle it. Kirimdev preserves the documented status identifiers, errors, pricing, and conversation metadata when Meta supplies them. X-Kirim-Source: kirim Events that originated inside Kirimdev — a contact was created or updated, a conversation got assigned or closed. These use the Kirimdev envelope: `{ id, type, created_at, data }`. The two shapes coexist on the same subscription. Your handler branches on `X-Kirim-Source` (or just on `type` after parsing) and routes accordingly. Subscription model ------------------ [Section titled “Subscription model”](https://docs.kirimdev.com/webhooks/overview/#subscription-model) A **webhook subscription** is the binding between a URL and a list of event types you care about. Subscriptions are **organisation-scoped** — by default, one subscription receives events from every WhatsApp account in your org, so you don’t need one subscription per phone number. curl -X POST https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/kirim", "events": ["message.received", "message.status", "contact.created"], "description": "production listener" }' The response includes an `initial_secret` shown **once**. Store it — it’s the signing key for every future delivery to this subscription. ### Scoping a subscription to specific phone numbers [Section titled “Scoping a subscription to specific phone numbers”](https://docs.kirimdev.com/webhooks/overview/#scoping-a-subscription-to-specific-phone-numbers) If you run multiple WhatsApp numbers on the same organisation (e.g. a “Sales” number and a “Support” number) and want to route their events to different endpoints, add a `phone_number_ids` whitelist: curl -X POST https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/sales", "events": ["message.received", "message.status"], "phone_number_ids": ["106540352242922"] }' * Discover the ids via `GET /v1/accounts` — `phone_number_id` on each row is the Meta `business_phone_number_id` you pass here. * Up to 50 ids per subscription; each must belong to your organisation. * On PATCH, send `phone_number_ids: null` to clear the filter and go back to “all accounts”, or send an array to replace the whitelist. * Only events tied to a phone number are filtered: `message.*`, `conversation.*`, and `contact.*`. Organisation-level events (`customer.*`) always fire regardless of the filter. * The filter follows the phone number. If you remove a number from Kirimdev and connect the same number again, events for it keep reaching the subscription. This applies to filters created or updated since October 9, 2026; an older filter keeps the previous behaviour until you send its `phone_number_ids` again with PATCH. Response objects always carry `phone_number_ids` — `null` means the subscription is unrestricted, an array is the active whitelist. Headers on every delivery ------------------------- [Section titled “Headers on every delivery”](https://docs.kirimdev.com/webhooks/overview/#headers-on-every-delivery) Content-Type: application/jsonUser-Agent: Kirim-Webhook/1.0X-Kirim-Source: meta # "meta" or "kirim"X-Kirim-Event: message.receivedX-Kirim-Event-Id: wamid.HBgN… # Meta wamid when source=meta, evt_ when source=kirimX-Kirim-Delivery-Id: wbd_… # Unique per delivery attemptX-Kirim-Attempt: 1 # 1-based attempt counter (1-8)X-Kirim-Signature: t=1716480000,v1=[,v1=...] Delivery contract ----------------- [Section titled “Delivery contract”](https://docs.kirimdev.com/webhooks/overview/#delivery-contract) * **At-least-once.** Every event reaches a healthy subscription at least once. Dedupe on your side using `X-Kirim-Event-Id`. * **2xx response = success.** Any 2xx (200, 201, 204, …) marks the delivery `succeeded`. 3xx is treated as failure — Kirimdev does not follow redirects. * **10-second per-attempt timeout.** Your endpoint must respond in under 10 seconds or the attempt is recorded as a timeout failure. * **8 retries with exponential backoff** before dead-letter. Total window is roughly 24 hours. See [Retries & Auto-Disable](https://docs.kirimdev.com/webhooks/retry/) for the full schedule. * **Order is not guaranteed.** Events may arrive in a different order than the messages were created — this applies across events of the same type (e.g. two `message.sent` in one conversation) as well as between types (you can see a status before its `message.sent`). Do not rely on arrival order or on the event `id`. To reconstruct message order, sort by the message `timestamp` in the payload. Treat `message.status` as a **state machine, not a sequence** — correlate each status to its message by `provider_id` (wamid). Ordering messages ----------------- [Section titled “Ordering messages”](https://docs.kirimdev.com/webhooks/overview/#ordering-messages) Webhook arrival order does not reflect the order messages were created. Sort events by the message `timestamp` field in the payload to reconstruct the sequence — never by arrival time or by the event `id`. Two limitations to design around: * **Timestamps are second-precision.** Message timestamps follow WhatsApp, which reports time to the second. Two messages in the **same second** cannot be distinguished by timestamp — there is no finer-grained ordering marker available. Display same-second messages as a group, or accept an approximate order within that second. * **The event `id` is not time-ordered.** It is a random identifier; never sort by it. If you buffer and reorder on your side, sorting by `timestamp` is enough for arrival-order scrambling — you only need extra tolerance for messages that share the same second. Dedupe by `X-Kirim-Event-Id` ---------------------------- [Section titled “Dedupe by X-Kirim-Event-Id”](https://docs.kirimdev.com/webhooks/overview/#dedupe-by-x-kirim-event-id) Because delivery is at-least-once, your endpoint will occasionally receive the same event twice — typically when a retry fires after your server processed the original but its 200 didn’t reach Kirimdev before the 10 s timeout. The dedupe key is `X-Kirim-Event-Id`. Same id = same logical event, regardless of attempt number or whether the delivery is a manual replay. * [TypeScript](https://docs.kirimdev.com/webhooks/overview/#tab-panel-169) * [Python](https://docs.kirimdev.com/webhooks/overview/#tab-panel-170) import { redis } from './lib/redis.js' app.post('/webhooks/kirim', async (req, res) => { const eventId = req.headers['x-kirim-event-id'] as string // Atomic claim — SET NX with a 7-day TTL covers every retry window. const fresh = await redis.set(`kirim:evt:${eventId}`, '1', { EX: 60 * 60 * 24 * 7, NX: true, }) if (!fresh) { return res.status(200).send('duplicate-ack') } await handleEvent(req.body) res.status(200).send('ok')}) from fastapi import FastAPI, Request, Responseimport redis.asyncio as redis app = FastAPI()r = redis.from_url("redis://localhost:6379") @app.post("/webhooks/kirim")async def kirim_webhook(request: Request): event_id = request.headers["x-kirim-event-id"] # SET NX with a 7-day TTL — covers every retry window. fresh = await r.set(f"kirim:evt:{event_id}", "1", ex=604800, nx=True) if not fresh: return Response("duplicate-ack", status_code=200) await handle_event(await request.json()) return Response("ok", status_code=200) Publisher-side dedupe (Meta retries) ------------------------------------ [Section titled “Publisher-side dedupe (Meta retries)”](https://docs.kirimdev.com/webhooks/overview/#publisher-side-dedupe-meta-retries) Meta itself retries inbound webhooks. To avoid fanning the same Meta retry out to your subscription several times, Kirimdev dedupes `source=meta` events at the publisher layer using a 24-hour claim on the wamid. By the time an event reaches your endpoint, Meta-driven duplicates are already filtered out. The only dedupe scenario you need to worry about is the **retry-vs-original race** described above, not Meta’s own at-least-once retry pattern. Architecture at a glance ------------------------ [Section titled “Architecture at a glance”](https://docs.kirimdev.com/webhooks/overview/#architecture-at-a-glance) Customer → Meta → Kirimdev → signed POST → your endpoint │ │ ▼ ▼ publisher 2xx ─► succeeded dedupe + sign non-2xx / timeout ─► retry (8 attempts, ~24 h) │ ▼ dead-letter (replayable) What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/webhooks/overview/#whats-next) Verifying signatures Constant-time HMAC verification recipes for Node, Python, Ruby, Go — plus secret rotation. [Read →](https://docs.kirimdev.com/webhooks/signing/) Event catalogue Every event Kirimdev publishes, the source, and what triggers it. [Read →](https://docs.kirimdev.com/webhooks/events/) Retries & auto-disable Backoff schedule, dead-letter queue, replay API, the 24-failure auto-disable policy. [Read →](https://docs.kirimdev.com/webhooks/retry/) Payload examples Copy-paste fixtures for every event, both Meta passthrough and Kirimdev-native. [Read →](https://docs.kirimdev.com/webhooks/payloads/) Subscribe to webhooks (guide) End-to-end recipe — create a subscription, verify the first delivery, ship to production. [Read →](https://docs.kirimdev.com/guides/webhooks/) --- # Verifying Signatures | Kirimdev [Skip to content](https://docs.kirimdev.com/webhooks/signing/#_top) Webhooks Verifying Signatures ==================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fsigning%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fsigning%2F%20and%20help%20me%20with%20the%20following%3A%20) Every outbound webhook from Kirimdev carries an HMAC signature in the `X-Kirim-Signature` header. **You MUST verify it.** Without verification, anyone who learns your endpoint URL can fire fake events at you. Header format ------------- [Section titled “Header format”](https://docs.kirimdev.com/webhooks/signing/#header-format) X-Kirim-Signature: t=1716480000,v1=[,v1=...] | Component | Meaning | | --- | --- | | `t=…` | Unix epoch seconds (UTC) when Kirimdev signed the payload. | | `v1=…` | Hex-encoded HMAC-SHA256 of `"{t}.{raw_body}"` keyed by one of your subscription’s active signing secrets. | Multiple `v1=` segments are comma-separated and appear during **secret rotation** — Kirimdev signs each delivery with _every_ currently active secret so you can verify against either while you roll your stored secret over. What gets signed ---------------- [Section titled “What gets signed”](https://docs.kirimdev.com/webhooks/signing/#what-gets-signed) The signing payload is `"{t}.{raw_body}"` — literally the unix timestamp, a single dot, then the raw bytes of the request body as Kirimdev sent them (no pretty-printing, no key reordering). Verification recipe ------------------- [Section titled “Verification recipe”](https://docs.kirimdev.com/webhooks/signing/#verification-recipe) * [SDK (TypeScript)](https://docs.kirimdev.com/webhooks/signing/#tab-panel-185) * [Node.js (raw)](https://docs.kirimdev.com/webhooks/signing/#tab-panel-186) * [Python](https://docs.kirimdev.com/webhooks/signing/#tab-panel-187) * [Ruby](https://docs.kirimdev.com/webhooks/signing/#tab-panel-188) * [Go](https://docs.kirimdev.com/webhooks/signing/#tab-panel-189) The official SDK ships a verifier that runs on Node, Bun, Deno, and any Web-Crypto-capable edge runtime. import { verify } from '@kirimdev/sdk/webhooks' app.post('/webhooks/kirim', async (req, res) => { const rawBody = req.body.toString('utf8') // express.raw() — bytes preserved const ok = await verify({ rawBody, signatureHeader: req.headers['x-kirim-signature'], secrets: [ process.env.KIRIM_SECRET_PRIMARY!, process.env.KIRIM_SECRET_ROTATING ?? null, ].filter(Boolean) as string[], toleranceSeconds: 300, // optional; defaults to 5 min }) if (!ok) return res.status(401).send('invalid signature') const event = JSON.parse(rawBody) // ... process event res.status(200).send('ok')}) `verify` accepts an array of secrets so you don’t have to write rotation logic yourself — pass every active secret, it returns `true` if **any** of them produces a matching signature. import { createHmac, timingSafeEqual } from 'node:crypto' export function verifyKirimSignature( rawBody: string, header: string | undefined, secrets: string[], toleranceSeconds = 300,): boolean { if (!header) return false const parts = header.split(',').map((p) => p.trim()) const tPart = parts.find((p) => p.startsWith('t='))?.slice(2) const v1s = parts.filter((p) => p.startsWith('v1=')).map((p) => p.slice(3)) const t = Number(tPart) if (!t || v1s.length === 0) return false // Replay protection — reject signatures older than 5 minutes. if (Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false const signed = `${t}.${rawBody}` // Verify against EVERY active secret. Pass if ANY match — secret // rotation requires accepting both old and new during the overlap. return secrets.some((secret) => { const expected = createHmac('sha256', secret).update(signed).digest('hex') return v1s.some((received) => { const a = Buffer.from(expected, 'hex') const b = Buffer.from(received, 'hex') return a.length === b.length && timingSafeEqual(a, b) }) })} import hmacimport hashlibimport time def verify_kirim_signature( raw_body: bytes, header: str | None, secrets: list[str], tolerance_seconds: int = 300,) -> bool: if not header: return False parts: dict[str, list[str]] = {} for p in header.split(","): k, _, v = p.strip().partition("=") parts.setdefault(k, []).append(v) try: t = int(parts["t"][0]) except (KeyError, IndexError, ValueError): return False v1s = parts.get("v1", []) if not v1s: return False if abs(time.time() - t) > tolerance_seconds: return False # replay window exceeded signed = f"{t}.".encode() + raw_body for secret in secrets: expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest() for received in v1s: if hmac.compare_digest(expected, received): return True return False require "openssl" def verify_kirim_signature(raw_body, header, secrets, tolerance_seconds: 300) return false if header.nil? parts = { t: nil, v1: [] } header.split(",").each do |p| k, v = p.strip.split("=", 2) case k when "t" then parts[:t] = v.to_i when "v1" then parts[:v1] << v end end return false unless parts[:t] && !parts[:v1].empty? return false if (Time.now.to_i - parts[:t]).abs > tolerance_seconds signed = "#{parts[:t]}.#{raw_body}" secrets.any? do |secret| expected = OpenSSL::HMAC.hexdigest("SHA256", secret, signed) parts[:v1].any? { |received| OpenSSL.fixed_length_secure_compare(expected, received) } endend package kirimwebhook import ( "crypto/hmac" "crypto/sha256" "crypto/subtle" "encoding/hex" "math" "strconv" "strings" "time") func Verify( rawBody []byte, header string, secrets []string, toleranceSeconds float64,) bool { if header == "" { return false } var t int64 var v1s []string for _, part := range strings.Split(header, ",") { kv := strings.SplitN(strings.TrimSpace(part), "=", 2) if len(kv) != 2 { continue } switch kv[0] { case "t": t, _ = strconv.ParseInt(kv[1], 10, 64) case "v1": v1s = append(v1s, kv[1]) } } if t == 0 || len(v1s) == 0 { return false } if math.Abs(float64(time.Now().Unix()-t)) > toleranceSeconds { return false } signed := []byte(strconv.FormatInt(t, 10) + ".") signed = append(signed, rawBody...) for _, secret := range secrets { mac := hmac.New(sha256.New, []byte(secret)) mac.Write(signed) expected := []byte(hex.EncodeToString(mac.Sum(nil))) for _, received := range v1s { if subtle.ConstantTimeCompare(expected, []byte(received)) == 1 { return true } } } return false} Replay protection ----------------- [Section titled “Replay protection”](https://docs.kirimdev.com/webhooks/signing/#replay-protection) The recipes above reject signatures with a `t=` more than 5 minutes away from `now`. This guards against an attacker who captures a signed delivery (e.g. from a proxy log) and replays it weeks later — the timestamp won’t validate. If your endpoint runs geographically far from Kirimdev’s region, increase `toleranceSeconds` to absorb clock drift, but keep it under 10 minutes. Rotating signing secrets ------------------------ [Section titled “Rotating signing secrets”](https://docs.kirimdev.com/webhooks/signing/#rotating-signing-secrets) Subscriptions support multiple active signing secrets simultaneously. Rotate at any time: 1. **Mint a new secret.** Kirimdev returns the plaintext **once** — store it immediately. curl -X POST \ https://api.kirimdev.com/v1/webhook_subscriptions/wbs_…/secrets \ -H "Authorization: Bearer $KIRIM_KEY" const next = await kirim.webhookSubscriptions.addSecret('wbs_…')// next.secret is plaintext — persist it now. 2. **Deploy your verifier with both secrets** in the `secrets` array. For the duration of the overlap, Kirimdev signs every delivery with **both** secrets (two `v1=` segments per header). Either one must verify. secrets: [OLD_SECRET, NEW_SECRET].filter(Boolean) 3. **Confirm in production** that deliveries verify under the new secret — the dashboard’s _Recent deliveries_ view shows which secret matched each request. 4. **Revoke the old secret.** curl -X DELETE \ https://api.kirimdev.com/v1/webhook_subscriptions/wbs_…/secrets/sec_OLD \ -H "Authorization: Bearer $KIRIM_KEY" Future deliveries are signed only with the new secret. Remove the old one from your environment. Common pitfalls --------------- [Section titled “Common pitfalls”](https://docs.kirimdev.com/webhooks/signing/#common-pitfalls) What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/webhooks/signing/#whats-next) * [Event catalogue](https://docs.kirimdev.com/webhooks/events/) — every event type and what triggers it. * [Retries & auto-disable](https://docs.kirimdev.com/webhooks/retry/) — what happens when your endpoint returns non-2xx. * [Payload examples](https://docs.kirimdev.com/webhooks/payloads/) — copy-paste fixtures for each event type. --- # Payload Examples | Kirimdev [Skip to content](https://docs.kirimdev.com/webhooks/payloads/#_top) Webhooks Payload Examples ================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fpayloads%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fpayloads%2F%20and%20help%20me%20with%20the%20following%3A%20) These are real payload shapes produced by the production publisher. Use them as fixtures in your handler tests — a regression in your parser will fail CI instead of silently swallowing live events. The Kirimdev envelope --------------------- [Section titled “The Kirimdev envelope”](https://docs.kirimdev.com/webhooks/payloads/#the-kirimdev-envelope) Every webhook POST body conforms to one of two shapes, distinguished by the `X-Kirim-Source` header: // X-Kirim-Source: kirim — Kirimdev-native events{ "id": "evt_01HXYZABCDEFGHJKMNPQRSTVWX", // ULID, also in X-Kirim-Event-Id "type": "contact.created", // see Event Catalogue "created_at": "2026-05-23T10:00:00Z", "data": { /* event-specific payload */ }} // X-Kirim-Source: meta — Meta passthrough (+ optional kirim enrichment on message.received){ "object": "whatsapp_business_account", "entry": [ /* Meta Cloud API shape */ ], "kirim": { /* optional — conversation ids, labels, media_url */ }} `message.received` (text) — Meta passthrough -------------------------------------------- [Section titled “message.received (text) — Meta passthrough”](https://docs.kirimdev.com/webhooks/payloads/#messagereceived-text--meta-passthrough) **Headers** X-Kirim-Source: metaX-Kirim-Event: message.receivedX-Kirim-Event-Id: wamid.HBgN…X-Kirim-Delivery-Id: wbd_01HXYZ…X-Kirim-Attempt: 1X-Kirim-Signature: t=1716480000,v1= **Body** (raw Meta payload, passthrough) { "object": "whatsapp_business_account", "entry": [ { "id": "", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "62851176008029", "phone_number_id": "106540352242922" }, "contacts": [ { "profile": { "name": "John Doe" }, "wa_id": "628111111111" } ], "messages": [ { "from": "628111111111", "id": "wamid.HBgN…", "timestamp": "1716480000", "type": "text", "text": { "body": "Halo, mau tanya soal pesanan" } } ] }, "field": "messages" } ] } ], "kirim": { "conversation_id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWX", "contact_id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "message_id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "phone_number_id": "106540352242922", "labels": [ { "id": "lbl_01ABC…", "name": "VIP", "color": "#6366f1" } ], "conversation": { "status": "open", "assigned_to": null }, "contact": { "name": "John Doe", "phone_number": "+628111111111" }, "media_url": null, "media_status": null }} `from` here is the **customer’s WhatsApp number** that messaged you. The `phone_number_id` at `entry[].changes[].value.metadata.phone_number_id` (here `106540352242922`) is the connected number that received the message — use this in any follow-up `POST /v1/{phone_number_id}/messages` call. `message.received` (image with caption) — Meta passthrough ---------------------------------------------------------- [Section titled “message.received (image with caption) — Meta passthrough”](https://docs.kirimdev.com/webhooks/payloads/#messagereceived-image-with-caption--meta-passthrough) Same envelope, different `messages[0]`: { "from": "628111111111", "id": "wamid.HBgN…", "timestamp": "1716480000", "type": "image", "image": { "caption": "Bukti transfer", "mime_type": "image/jpeg", "sha256": "", "id": "" }} The `image.id` is a **Meta media id** scoped to this phone number. For inbound images the webhook arrives **~1–3 seconds after** the text path because Kirimdev waits for storage upload. The optional `kirim` block then includes a permanent hosted URL: "kirim": { "message_id": "msg_01HXYZ…", "media_url": "https://media.kirimdev.com/whatsapp///bukti-transfer.jpg", "media_status": "ready"} You can fetch bytes directly from `kirim.media_url`, or via the Public API — Kirimdev redirects (302) to the same asset so you don’t need Meta credentials: * [cURL](https://docs.kirimdev.com/webhooks/payloads/#tab-panel-171) * [TypeScript](https://docs.kirimdev.com/webhooks/payloads/#tab-panel-172) # The API returns 302 → signed CDN URL. Use -L to follow.curl -L \ https://api.kirimdev.com/v1/106540352242922/messages/wamid.HBgN…/media \ -H "Authorization: Bearer $KIRIM_KEY" \ -o transfer-proof.jpg import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers('106540352242922') // SDK returns the redirect target without following it,// so you decide whether to stream or download.const media = await phone.messages.media('wamid.HBgN…') const res = await fetch(media.url)const buf = Buffer.from(await res.arrayBuffer())await Bun.write('transfer-proof.jpg', buf) `message.status` — Meta passthrough ----------------------------------- [Section titled “message.status — Meta passthrough”](https://docs.kirimdev.com/webhooks/payloads/#messagestatus--meta-passthrough) **Headers:** `X-Kirim-Event: message.status` **Body** { "object": "whatsapp_business_account", "entry": [ { "id": "", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "62851176008029", "phone_number_id": "106540352242922" }, "statuses": [ { "id": "wamid.HBgN…", "status": "delivered", "timestamp": "1716480010", "recipient_id": "628111111111", "conversation": { "id": "", "origin": { "type": "user_initiated" } }, "pricing": { "billable": true, "pricing_model": "CBP", "category": "user_initiated" } } ] }, "field": "messages" } ] } ]} `status` cycles through `sent` → `delivered` → `read`. Failed sends emit a single `failed` status with an `errors[]` array containing Meta’s error code — mappable to a stable Kirimdev code via the [error catalogue](https://docs.kirimdev.com/concepts/errors/) . Kirimdev preserves Meta’s structured status fields in the forwarded body. For failures, inspect `statuses[0].errors[0].code` (for example `131049`), along with `title`, `message`, `error_data.details`, `fbtrace_id`, and `error_subcode` or `href` when Meta provides them. Status events that carry charging metadata also preserve `pricing.billable`, `pricing.type`, `pricing.category`, and `pricing.pricing_model`. Legacy conversation-based callbacks preserve `conversation.id`, `conversation.origin.type`, and `conversation.expiration_timestamp`. **Pre-Meta failures** (transient outage `131000`, quota refusal, account cooldown, compliance block) are synthesized by Kirimdev because Meta emits no webhook for a message it never admitted. Their shape is identical to the above except: * `statuses[0].id` is the Kirimdev `msg_…` id (no `wamid` exists) — it equals the `id` from your send response. * `errors[0].code` is Meta’s integer when available (e.g. `131000`), or the sentinel `-1` for a Kirimdev-side refusal. { "object": "whatsapp_business_account", "entry": [ { "id": "", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "62851176008029", "phone_number_id": "106540352242922" }, "statuses": [ { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "status": "failed", "timestamp": "1716480010", "recipient_id": "628111111111", "errors": [ { "code": 131000, "title": "Something went wrong", "message": "Something went wrong", "error_data": { "details": "Something went wrong" }, "href": "/docs/whatsapp/cloud-api/support/error-codes/" } ] } ] }, "field": "messages" } ] } ]} `conversation.assigned` — Kirimdev native ----------------------------------------- [Section titled “conversation.assigned — Kirimdev native”](https://docs.kirimdev.com/webhooks/payloads/#conversationassigned--kirimdev-native) **Headers:** `X-Kirim-Source: kirim`, `X-Kirim-Event: conversation.assigned` **Body** { "id": "evt_01HXYZABCDEFGHJKMNPQRSTVWX", "type": "conversation.assigned", "created_at": "2026-05-23T10:00:00Z", "data": { "conversation": { "id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "conversation", "status": "open", "phone_number_id": "106540352242922" }, "assignee": { "user_id": "U7d2k9mq", "team_id": "tem_01HXYZ…", "previous_user_id": null } }} `user_id` / `previous_user_id` are raw internal user identifiers (nanoid strings), not kirim-prefixed resource ids. `conversation.closed` — Kirimdev native --------------------------------------- [Section titled “conversation.closed — Kirimdev native”](https://docs.kirimdev.com/webhooks/payloads/#conversationclosed--kirimdev-native) { "id": "evt_…", "type": "conversation.closed", "created_at": "2026-05-23T10:00:00Z", "data": { "conversation": { "id": "cnv_…", "object": "conversation", "status": "resolved", "closed_by_user_id": "U7d2k9mq", "phone_number_id": "106540352242922" } }} `contact.created` — Kirimdev native ----------------------------------- [Section titled “contact.created — Kirimdev native”](https://docs.kirimdev.com/webhooks/payloads/#contactcreated--kirimdev-native) { "id": "evt_01HXYZABCDEFGHJKMNPQRSTVWX", "type": "contact.created", "created_at": "2026-05-23T10:00:00Z", "data": { "contact": { "id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "contact", "phone_number": "+628111111111", "name": "John Doe", "email": null, "metadata": null, "phone_number_id": "106540352242922", "created_at": "2026-05-23T10:00:00Z", "updated_at": "2026-05-23T10:00:00Z" } }} `contact.updated` — Kirimdev native ----------------------------------- [Section titled “contact.updated — Kirimdev native”](https://docs.kirimdev.com/webhooks/payloads/#contactupdated--kirimdev-native) { "id": "evt_…", "type": "contact.updated", "created_at": "2026-05-23T10:00:00Z", "data": { "contact": { "id": "ctc_…", "object": "contact", "phone_number": "+628111111111", "name": "John Doe (updated)", "email": "john@example.com", "phone_number_id": "106540352242922", "...": "..." }, "changed_fields": ["name", "email"] }} `changed_fields` lists only the field names that actually differ from the prior version. An empty array would be elided rather than sent — no event fires when nothing changed. --- # SDK Quickstart | Kirimdev [Skip to content](https://docs.kirimdev.com/sdks/typescript/quickstart/#_top) TypeScript SDK SDK Quickstart ============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Fquickstart%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Fquickstart%2F%20and%20help%20me%20with%20the%20following%3A%20) This guide takes you from `bun install` to a delivered WhatsApp message using `@kirimdev/sdk`. By the end you’ll know how to scope the client to a phone number, send the three common message types, and check delivery status. Prerequisites: a Kirimdev API key (`kdv_live_...`) and at least one connected WhatsApp Business number. If you don’t have either, work through the [Platform Quickstart](https://docs.kirimdev.com/quickstart/) first. 1. **Install the SDK.** * [bun](https://docs.kirimdev.com/sdks/typescript/quickstart/#tab-panel-91) * [npm](https://docs.kirimdev.com/sdks/typescript/quickstart/#tab-panel-92) * [pnpm](https://docs.kirimdev.com/sdks/typescript/quickstart/#tab-panel-93) * [yarn](https://docs.kirimdev.com/sdks/typescript/quickstart/#tab-panel-94) * [deno](https://docs.kirimdev.com/sdks/typescript/quickstart/#tab-panel-95) bun add @kirimdev/sdk npm install @kirimdev/sdk pnpm add @kirimdev/sdk yarn add @kirimdev/sdk import { Kirim } from 'npm:@kirimdev/sdk' Types ship with the package — no `@types/...` install needed. Make sure your `package.json` has `"type": "module"`; the SDK is ESM only. 2. **Create the client.** import { Kirim } from '@kirimdev/sdk' export const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY!,}) 3. **Find your `phone_number_id`.** Every send is scoped to one WhatsApp number. List your accounts and grab the `id` you want to send from: import { kirim } from './kirim' const accounts = await kirim.accounts.list()for (const a of accounts) { console.log(a.phone_number_id, a.phone_number, a.name, a.status)}// -> 106540352242922 +628111222333 Acme Indonesia connected Cache that id at module top-level so you don’t fetch it on every request: export const phone = kirim.phoneNumbers('106540352242922') 4. **Send a text message.** import { phone } from './kirim' const msg = await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'text', text: { body: 'Halo dari @kirimdev/sdk!' },}) console.log(msg.id, msg.status) // -> wamid.xxx pending * [bun](https://docs.kirimdev.com/sdks/typescript/quickstart/#tab-panel-96) * [node](https://docs.kirimdev.com/sdks/typescript/quickstart/#tab-panel-97) bun src/send-text.ts node --import tsx src/send-text.ts Idempotency is automatic: the SDK injects a UUID `Idempotency-Key` on every POST and reuses it across retries — re-running this script after a transient failure will never send twice. 5. **Send a template message.** Templates are the only way to start a conversation outside the 24-hour window. Look up an approved template first, then send: import { phone } from './kirim' // Confirm the template is approvedconst tpl = await phone.templates.retrieve('order_confirmation', { language: 'id_ID',})if (tpl.status !== 'approved') { throw new Error(`Template not approved: ${tpl.status}`)} const msg = await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'template', template: { name: 'order_confirmation', language: { code: 'id_ID' }, components: [ { type: 'body', parameters: [ { type: 'text', text: 'Budi' }, { type: 'text', text: 'ORD-1042' }, ], }, ], },}) console.log(msg.id) 6. **Send a media message (image).** Pass a public URL — Kirimdev re-uploads to Meta and tracks the media id for you. import { phone } from './kirim' const msg = await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'image', image: { link: 'https://cdn.example.com/invoice/ORD-1042.png', caption: 'Invoice for order ORD-1042', },}) console.log(msg.id) Document, audio, and video work the same way — swap `type` and the matching payload key. See the per-type pages under [Sending & receiving](https://docs.kirimdev.com/sending/send-text/) for every variant. 7. **Verify delivery.** `messages.send` returns immediately with `status: 'pending'`. The real status is delivered by webhook callbacks from Meta. For a quick check, poll: import { phone } from './kirim' const fresh = await phone.messages.retrieve(msg.id)console.log(fresh.status) // -> sent / delivered / read / failed For production, subscribe to webhooks instead of polling — see [SDK Webhooks](https://docs.kirimdev.com/sdks/typescript/webhooks/) for the verifier and typed event handlers. Configuration knobs ------------------- [Section titled “Configuration knobs”](https://docs.kirimdev.com/sdks/typescript/quickstart/#configuration-knobs) Tune the client for your environment: const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY!, // Override for staging / on-prem deployments baseUrl: 'https://api-staging.kirimdev.com/v1', // Tighten the request budget — useful in edge functions timeout: 10_000, // 0 disables auto-retry entirely (you'll see 429 / 5xx directly) maxRetries: 4, // Identify your app in our logs (helps with support tickets) userAgentSuffix: 'acme-billing/2.4.0', // Inject a custom transport (e.g. undici, Node fetch with HTTPS agent) fetch: customFetch,}) | Option | Default | When to change | | --- | --- | --- | | `apiKey` | — | Required. Live keys are `kdv_live_*` (only key format issued today). | | `baseUrl` | `https://api.kirimdev.com/v1` | Pointing to staging, on-prem, or a local mock. | | `timeout` | `30_000` ms | Cap latency in edge runtimes; raise for media-heavy uploads. | | `maxRetries` | `2` | `0` for strict one-shot calls; higher for unreliable upstreams. | | `userAgentSuffix` | none | Always set it — makes support triage faster. | | `fetch` | `globalThis.fetch` | Custom transport, mocking, or to add proxy / cert pinning. | What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/sdks/typescript/quickstart/#whats-next) * **[Errors](https://docs.kirimdev.com/sdks/typescript/errors/) ** — the `KirimError` hierarchy and recipes for handling each subclass. * **[Pagination](https://docs.kirimdev.com/sdks/typescript/pagination/) ** — `for await` over every page, or step manually with `.page()`. * **[Webhooks](https://docs.kirimdev.com/sdks/typescript/webhooks/) ** — verify deliveries from Hono, Express, Next.js, or Bun.serve. * **[Sending & receiving](https://docs.kirimdev.com/sending/send-text/) ** — every message type with payload examples (text, interactive, media, template). * **[Concepts → Idempotency](https://docs.kirimdev.com/concepts/idempotency/) ** — what the SDK does for you under the hood. --- # TypeScript SDK | Kirimdev [Skip to content](https://docs.kirimdev.com/sdks/typescript/#_top) TypeScript SDK TypeScript SDK ============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2F%20and%20help%20me%20with%20the%20following%3A%20) `@kirimdev/sdk` is the official TypeScript client for the Kirimdev Public API. Its builder shape mirrors the URL structure: organization resources hang off the root client, per-phone-number resources hang off `kirim.phoneNumbers(id)`. Types are generated from the live OpenAPI spec, retries and pagination are handled for you, and the runtime uses only web-standard `fetch` so the same code runs in Node, Bun, Deno, and edge. Builder, not flat `kirim.phoneNumbers('id').messages.send(...)` reads like the URL it hits. No hand-built paths, no juggling phone IDs in every call. Type-safe Request and response types come from the live OpenAPI 3.1 spec at build time. Autocomplete and compile-time checks on every field. Safe to retry Auto-retries 429 / 5xx / network errors with exponential backoff and honors `Retry-After`. POSTs carry an `Idempotency-Key` so the same key is reused across retries. Async pagination Every `list()` is async-iterable. `for await` exhausts pages transparently, or call `.page()` for manual cursor control. Typed errors `KirimError` hierarchy — branch with `instanceof`, drill into `code` / `param` / `requestId` / `retryAfter`. Runs anywhere Web-standard `fetch` only. Node 18+, Bun, Deno, Cloudflare Workers, Vercel Edge — no Node-specific dependencies. Install ------- [Section titled “Install”](https://docs.kirimdev.com/sdks/typescript/#install) * [bun](https://docs.kirimdev.com/sdks/typescript/#tab-panel-86) * [npm](https://docs.kirimdev.com/sdks/typescript/#tab-panel-87) * [pnpm](https://docs.kirimdev.com/sdks/typescript/#tab-panel-88) * [yarn](https://docs.kirimdev.com/sdks/typescript/#tab-panel-89) * [deno](https://docs.kirimdev.com/sdks/typescript/#tab-panel-90) bun add @kirimdev/sdk npm install @kirimdev/sdk pnpm add @kirimdev/sdk yarn add @kirimdev/sdk import { Kirim } from 'npm:@kirimdev/sdk' Requirements: Node 18+, Bun 1.2+, or Deno 1.40+. ESM only. Types ship with the package — no `@types/...` needed. Hello, world ------------ [Section titled “Hello, world”](https://docs.kirimdev.com/sdks/typescript/#hello-world) import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) // Pick the phone number you want to send from.const phone = kirim.phoneNumbers('106540352242922') const msg = await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'text', text: { body: 'Halo dari @kirimdev/sdk!' },}) console.log(msg.id, msg.status) That’s the entire contract: construct once, scope to a phone number when needed, call resource methods. Every method returns a `Promise` where `T` is the unwrapped resource — the SDK strips the `{ data, request_id }` envelope for you. Architecture: builder pattern ----------------------------- [Section titled “Architecture: builder pattern”](https://docs.kirimdev.com/sdks/typescript/#architecture-builder-pattern) The SDK has two tiers, matching the API’s URL structure: kirim ← root client (org / team scope)├── kirim.accounts ← all WhatsApp numbers in the org├── kirim.labels ← labels (org-wide)├── kirim.webhookSubscriptions ← webhook endpoints├── kirim.webhookDeliveries ← delivery history & replays├── kirim.me() ← who am I│└── kirim.phoneNumbers('id') ← scoped to one WhatsApp number ├── .messages ← send / retrieve / list / media ├── .contacts ← CRUD + labels ├── .conversations ← list / update / labels └── .templates ← list / retrieve ### Root-scoped examples [Section titled “Root-scoped examples”](https://docs.kirimdev.com/sdks/typescript/#root-scoped-examples) await kirim.accounts.list() // every connected numberawait kirim.labels.create({ name: 'VIP', color: 'green' })await kirim.labels.list()await kirim.webhookSubscriptions.create({ url, events })await kirim.webhookDeliveries.list({ status: 'failed' })await kirim.me() // current API key context ### Phone-scoped examples [Section titled “Phone-scoped examples”](https://docs.kirimdev.com/sdks/typescript/#phone-scoped-examples) const phone = kirim.phoneNumbers('106540352242922') await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'text', text: { body: 'Hi' },})await phone.messages.retrieve(messageId)await phone.messages.media(messageId) // signed redirect URL info await phone.contacts.create({ phone_number: '+628111222333' })await phone.contacts.addLabel(contactId, { label_id })await phone.contacts.bulkLabel({ contact_ids, label_id, operation: 'add' }) await phone.conversations.update(id, { status: 'resolved' })await phone.templates.list({ status: 'approved' }) Configuration ------------- [Section titled “Configuration”](https://docs.kirimdev.com/sdks/typescript/#configuration) new Kirim({ apiKey: 'kdv_live_...', // required baseUrl: 'https://api.kirimdev.com/v1', // optional, default production timeout: 30_000, // optional, ms (default 30s) maxRetries: 2, // optional, default 2 userAgentSuffix: 'myapp/1.2.3', // optional, appended to UA fetch: customFetch, // optional, default globalThis.fetch}) Where to next ------------- [Section titled “Where to next”](https://docs.kirimdev.com/sdks/typescript/#where-to-next) * **[Quickstart](https://docs.kirimdev.com/sdks/typescript/quickstart/) ** — install, find your phone-number id, send your first message, paginate, verify a webhook. * **[Errors](https://docs.kirimdev.com/sdks/typescript/errors/) ** — the `KirimError` hierarchy and recipes for every subclass. * **[Pagination](https://docs.kirimdev.com/sdks/typescript/pagination/) ** — `for await` vs. manual `.page()`, cursor stability rules, common pitfalls. * **[Webhooks](https://docs.kirimdev.com/sdks/typescript/webhooks/) ** — `verify()` from `@kirimdev/sdk/webhooks`, framework adapters, secret rotation. * **[API Reference](https://docs.kirimdev.com/api/) ** — every endpoint generated live from the OpenAPI spec. --- # SDK Errors | Kirimdev [Skip to content](https://docs.kirimdev.com/sdks/typescript/errors/#_top) TypeScript SDK SDK Errors ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Ferrors%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Ferrors%2F%20and%20help%20me%20with%20the%20following%3A%20) Every failed call from `@kirimdev/sdk` throws a typed subclass of `KirimError`. Branch with `instanceof` for coarse categorization, inspect `code` for the specific stable identifier, and quote `requestId` when opening a support ticket. Network failures (DNS, TCP, timeout, abort) throw `ConnectionError` — same base class. Class hierarchy --------------- [Section titled “Class hierarchy”](https://docs.kirimdev.com/sdks/typescript/errors/#class-hierarchy) KirimError (base — every thrown error extends this)├─ InvalidRequestError 400, 422 validation / malformed payload├─ AuthenticationError 401 missing / invalid / revoked key├─ PermissionError 403 plan limit / scope / suspended org├─ NotFoundError 404 resource id does not exist├─ ConflictError 409 idempotency conflict / state clash├─ RateLimitError 429 carries `retryAfter` in seconds├─ ApiServerError 5xx upstream or Kirimdev internal└─ ConnectionError — no response (DNS / TCP / timeout / abort) Common properties ----------------- [Section titled “Common properties”](https://docs.kirimdev.com/sdks/typescript/errors/#common-properties) Every `KirimError` instance carries: | Property | Type | Meaning | | --- | --- | --- | | `code` | `string` | Stable identifier from the [error catalogue](https://docs.kirimdev.com/concepts/errors/)
. Branch on this. | | `type` | `KirimErrorType` | Broad category — matches the subclass. | | `status` | `number` | HTTP status (`0` for `ConnectionError`). | | `message` | `string` | Human-readable. May evolve; do not branch on text. | | `requestId` | `string \| null` | The `X-Request-Id` from the response. Quote in support tickets. | | `param` | `string \| undefined` | Field hint when validation failed (e.g. `'to'`, `'template.name'`). | | `raw` | `unknown` | Decoded body for debugging. | `RateLimitError` additionally exposes `retryAfter: number | null` (seconds the server asked you to wait). Recipe — branch by class ------------------------ [Section titled “Recipe — branch by class”](https://docs.kirimdev.com/sdks/typescript/errors/#recipe--branch-by-class) import { Kirim, KirimError, InvalidRequestError, AuthenticationError, PermissionError, NotFoundError, ConflictError, RateLimitError, ApiServerError, ConnectionError,} from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers('106540352242922') try { await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'text', text: { body: 'Halo' }, })} catch (err) { if (err instanceof InvalidRequestError) { // Bad payload. err.param points at the offending field. logger.warn({ code: err.code, param: err.param }, err.message) return showFormError(err.param ?? 'unknown', err.message) } if (err instanceof AuthenticationError) { // Key is missing / invalid / revoked / expired. return rotateApiKey() } if (err instanceof PermissionError) { // Plan does not include API access, or org is suspended. return promptUpgrade() } if (err instanceof NotFoundError) { // The resource id does not exist (or you can't see it). return null } if (err instanceof ConflictError) { // e.g. idempotency_in_progress — retry the same key later. await sleep(1_000) return retry() } if (err instanceof RateLimitError) { // The SDK already auto-retried; you saw this only after retries // were exhausted. Honor retryAfter or back off further. await sleep((err.retryAfter ?? 5) * 1_000) return retry() } if (err instanceof ApiServerError) { // 5xx. Already auto-retried. Alert ops. alerts.fire('kirim_api_error', { requestId: err.requestId, code: err.code }) throw err } if (err instanceof ConnectionError) { // Network failure with no response. Already auto-retried. metrics.increment('kirim.connection_error') throw err } // Defensive fallback — future subclasses still extend KirimError. if (err instanceof KirimError) { logger.error({ err }, 'unhandled KirimError subclass') } throw err} Recipe — branch by stable code ------------------------------ [Section titled “Recipe — branch by stable code”](https://docs.kirimdev.com/sdks/typescript/errors/#recipe--branch-by-stable-code) For finer-grained handling (e.g. distinguish `invalid_phone_number` from `invalid_template_name`), branch on `err.code`: try { await phone.messages.send(payload)} catch (err) { if (!(err instanceof KirimError)) throw err switch (err.code) { case 'invalid_phone_number': return showValidation('to', 'Phone must be E.164 (e.g. +628…).') case 'invalid_template_name': return showValidation('template', 'Template not found in your org.') case 'whatsapp_number_not_verified': return promptConnectWhatsApp() case 'whatsapp_upstream_error': // Meta hiccup — already retried by the SDK; alert if persistent. return scheduleRetry(err.requestId) case 'rate_limit_exceeded': // The SDK exhausted its retries. Back off further. return sleep(((err as RateLimitError).retryAfter ?? 5) * 1_000) default: logger.error({ err }, 'unhandled kirim error') throw err }} The full catalogue lives in the [Errors concept page](https://docs.kirimdev.com/concepts/errors/) — codes are stable forever; message text may evolve. What the SDK retries for you ---------------------------- [Section titled “What the SDK retries for you”](https://docs.kirimdev.com/sdks/typescript/errors/#what-the-sdk-retries-for-you) You won’t normally see `RateLimitError` / `ApiServerError` / `ConnectionError` on the first failure — the SDK transparently retries each up to `maxRetries` times (default 2) with exponential backoff plus full jitter, capped at 8 seconds per attempt. `Retry-After` (seconds or HTTP-date) is honored for 429. These errors only surface after the retry budget is exhausted. | Error class | Auto-retried? | Notes | | --- | --- | --- | | `InvalidRequestError` | No | Deterministic — your payload is wrong. | | `AuthenticationError` | No | Fix the key, don’t burn the budget. | | `PermissionError` | No | Won’t change on retry. | | `NotFoundError` | No | Won’t change on retry. | | `ConflictError` | No | You control the conflict (e.g. idempotency key). | | `RateLimitError` | **Yes** | Honors `Retry-After`. | | `ApiServerError` | **Yes** | Exponential backoff with jitter. | | `ConnectionError` | **Yes** | Exponential backoff with jitter. | Need stricter control? // Disable retries entirely on the clientconst kirim = new Kirim({ apiKey: process.env.KIRIM_KEY!, maxRetries: 0 }) // Or per-call:await phone.messages.send(payload, { maxRetries: 0 }) HTTP error ≠ delivery failure ----------------------------- [Section titled “HTTP error ≠ delivery failure”](https://docs.kirimdev.com/sdks/typescript/errors/#http-error--delivery-failure) A successful `messages.send` call only means Kirimdev accepted the request and queued it for Meta. The message can still fail to deliver later — that surfaces as a `message.status` webhook with `status: 'failed'`, **not** an exception in your `try`/`catch`. // HTTP-level errors: caught heretry { const msg = await phone.messages.send(payload) // msg.status === 'pending' — Meta hasn't seen it yet} catch (err) { // ... 4xx / 5xx / network} // Delivery-level failures: arrive via webhook// See /guides/failed-sends/ and /sdks/typescript/webhooks/ Read [Handling Failed Sends](https://docs.kirimdev.com/guides/failed-sends/) for the full story on async delivery failures. Logging for support ------------------- [Section titled “Logging for support”](https://docs.kirimdev.com/sdks/typescript/errors/#logging-for-support) For support tickets, log `requestId` and `code`: catch (err) { if (err instanceof KirimError) { logger.error( { code: err.code, type: err.type, status: err.status, requestId: err.requestId, param: err.param, }, err.message, ) } throw err} `requestId` matches the `X-Request-Id` response header and is the fastest way for Kirimdev support to locate your call in our logs. --- # SDK Pagination | Kirimdev [Skip to content](https://docs.kirimdev.com/sdks/typescript/pagination/#_top) TypeScript SDK SDK Pagination ============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Fpagination%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Fpagination%2F%20and%20help%20me%20with%20the%20following%3A%20) Every `list()` method on the SDK returns a `Paginator`. It is both: * an **async iterable** — `for await (const item of paginator) { ... }` * a **manual paginator** — `await paginator.page(cursor)` returns one page at a time The same instance works either way; pick whichever fits your control flow. Default page size is **25**, max **100**. Auto-iterate every page ----------------------- [Section titled “Auto-iterate every page”](https://docs.kirimdev.com/sdks/typescript/pagination/#auto-iterate-every-page) The most ergonomic shape — exhaust every page transparently: import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers('106540352242922') for await (const msg of phone.messages.list({ direction: 'outbound' })) { console.log(msg.id, msg.status, msg.created_at)} The iterator fetches the first page lazily, yields each item, then auto-fetches the next page until `next_cursor` is `null`. Break early to stop pagination — no extra HTTP calls happen after `break`. const first100: Message[] = []for await (const msg of phone.messages.list({ limit: 50 })) { first100.push(msg) if (first100.length >= 100) break // stops after 2 pages, cleanly} Step page-by-page ----------------- [Section titled “Step page-by-page”](https://docs.kirimdev.com/sdks/typescript/pagination/#step-page-by-page) When you need to persist cursors (resumable sync jobs, UI-driven “Load more” buttons), step manually: const paginator = phone.messages.list({ limit: 50 })const page1 = await paginator.page()// page1.data → Message[]// page1.hasMore → boolean// page1.nextCursor → string | null// page1.requestId → string console.log(page1.data.length, page1.hasMore) if (page1.hasMore) { const page2 = await paginator.page(page1.nextCursor) // ...} Real-world example: find all failed messages -------------------------------------------- [Section titled “Real-world example: find all failed messages”](https://docs.kirimdev.com/sdks/typescript/pagination/#real-world-example-find-all-failed-messages) Filter on the API side, iterate everything that matches: const failedIds: string[] = [] for await (const msg of phone.messages.list({ status: 'failed', created_after: '2026-05-01T00:00:00Z', limit: 100,})) { failedIds.push(msg.id)} console.log(`${failedIds.length} failed messages in May`) Resumable sync pattern ---------------------- [Section titled “Resumable sync pattern”](https://docs.kirimdev.com/sdks/typescript/pagination/#resumable-sync-pattern) Persist the cursor between job runs so you only fetch what’s new: async function syncMessages() { const lastCursor = await db.getKey('kirim:messages:cursor') const paginator = phone.messages.list({ limit: 100 }) let page = await paginator.page(lastCursor) while (true) { for (const msg of page.data) { await upsertMessage(msg) } if (!page.hasMore) break page = await paginator.page(page.nextCursor) } // Save the final cursor for the next run await db.setKey('kirim:messages:cursor', page.nextCursor)} Cursor stability rules ---------------------- [Section titled “Cursor stability rules”](https://docs.kirimdev.com/sdks/typescript/pagination/#cursor-stability-rules) * **Stable across pages.** A cursor returned by page N always points at the start of page N+1, even hours later. * **Stable across deploys.** Cursors do not embed schema versions. * **Forward-only.** There is no `previousCursor`. To go back, restart from the beginning with the same filters. * **Filter-bound.** A cursor encodes the filters from the original call. Don’t reuse a cursor with different filters — paginate from scratch instead. Gotcha: don’t `await` the paginator itself ------------------------------------------ [Section titled “Gotcha: don’t await the paginator itself”](https://docs.kirimdev.com/sdks/typescript/pagination/#gotcha-dont-await-the-paginator-itself) `Paginator` is **not** a `Promise`. It’s an async iterable. Awaiting it directly does nothing useful — you’ll get back the same paginator object wrapped in a resolved promise. // WRONG — `paginator` is a Paginator, not a Promiseconst paginator = await phone.messages.list({ limit: 50 }) // RIGHT — iterate itfor await (const msg of phone.messages.list({ limit: 50 })) { ... } // RIGHT — call .page() to get a pageconst page = await phone.messages.list({ limit: 50 }).page() If you want a plain array of everything (small result sets only — think small lookup tables), use `Array.fromAsync`: const all = await Array.fromAsync(phone.contacts.list({ limit: 100 })) Forwarding request options -------------------------- [Section titled “Forwarding request options”](https://docs.kirimdev.com/sdks/typescript/pagination/#forwarding-request-options) Per-call options (timeout / retry / abort signal) flow through to every page request: const ac = new AbortController()setTimeout(() => ac.abort(), 5_000) try { for await (const c of phone.contacts.list({}, { signal: ac.signal })) { process(c) }} catch (err) { // err is a ConnectionError if the signal fired} What you cannot do ------------------ [Section titled “What you cannot do”](https://docs.kirimdev.com/sdks/typescript/pagination/#what-you-cannot-do) * **Rewind.** There is no `previousCursor`. Restart from the beginning if you need to go back. * **Get a total count.** The API does not return a total. Count by iterating, or query a pre-aggregated dashboard. * **Mutate while iterating.** Like any cursor-paginated API, mutations between page fetches can cause items to be repeated or skipped. Snapshot before mutating, or use stricter filters. Related ------- [Section titled “Related”](https://docs.kirimdev.com/sdks/typescript/pagination/#related) * [Concepts → Pagination](https://docs.kirimdev.com/concepts/pagination/) — the underlying cursor protocol. * [SDK Errors](https://docs.kirimdev.com/sdks/typescript/errors/) — how the SDK surfaces failures mid-iteration. --- # MCP Server | Kirimdev [Skip to content](https://docs.kirimdev.com/tools/mcp/#_top) MCP server MCP Server ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev exposes a remote **Model Context Protocol** (MCP) server at `https://api.kirimdev.com/mcp` so AI assistants can send WhatsApp messages, search contacts, and browse conversations on your behalf — signing in with OAuth, or using the same API key you already use for the REST API. OAuth or API key Paste the URL and sign in from the browser, or bring your existing `kdv_live_...` API key exactly like REST. Focused, well-described tools Send messages, browse conversations, manage contacts, create and list templates, discover phone numbers — plus multi-tenant customer tools on Business plans. The 90% of WhatsApp automation in a small, well-described surface the model can use confidently. Works with major clients Claude Desktop, ChatGPT, Cursor, VSCode, MCP Inspector — anything that speaks the MCP Streamable HTTP transport (spec 2025-03-26+). Same rate limits & isolation Per-organization token bucket, same as `/v1`. Tools resolve `phone_number_id` through the same multi-tenant fence — keys from other orgs cannot see or send from your numbers. What it does ------------ [Section titled “What it does”](https://docs.kirimdev.com/tools/mcp/#what-it-does) Kirimdev’s MCP server is a thin protocol adapter on top of the existing [Public API](https://docs.kirimdev.com/api/) . Each MCP tool maps to a `/v1` endpoint and reuses the same validation, multi-tenant scoping, error catalogue, and realtime side effects (BullMQ jobs, WebSocket publish, audit logs). The result is that an AI assistant connected to your Kirimdev account can: * **Send WhatsApp messages** — text, image, document, video, audio, template, or interactive (CTA / list / carousel). * **Browse conversations** — list recent chats, drill into a single conversation with its message history. * **Look up contacts** — search by phone (E.164) or by name / email. * **Discover what’s available** — list connected phone numbers and approved Meta templates. Endpoint -------- [Section titled “Endpoint”](https://docs.kirimdev.com/tools/mcp/#endpoint) POST https://api.kirimdev.com/mcpAuthorization: Bearer kdv_live_...Content-Type: application/jsonAccept: application/json, text/event-stream The transport is **MCP Streamable HTTP** in stateless mode: every request is self-contained, no `Mcp-Session-Id` is issued, and the server uses single-shot JSON responses (no SSE upgrade) because every tool invocation returns one JSON-RPC result. Long-running bulk-label work returns a job id and is polled with `get_bulk_label_job`; it does not keep the HTTP request open. The endpoint serves both the 2025-era protocol revisions and revision **`2026-07-28`** from the same URL — your client negotiates the revision it prefers and the server answers in kind, so no configuration is needed either way. The tools --------- [Section titled “The tools”](https://docs.kirimdev.com/tools/mcp/#the-tools) The server exposes **27 tools** — 22 messaging-essentials tools always available, plus 5 multi-tenant customer tools that require the Business plan (they appear in `tools/list` on every plan but return `402` when invoked without the entitlement). | Tool | Purpose | | --- | --- | | `list_phone_numbers` | Discover connected WhatsApp numbers + their `phone_number_id`. **Call this first.** | | `send_message` | Send a WhatsApp message (text / image / document / video / audio / template / interactive). | | `mark_as_read` | Send a read receipt (+ optional typing indicator) for an inbound message. | | `get_message` | Fetch a single message by `msg_` id; poll delivery status / inspect failures. | | `list_messages` | Browse messages newest-first, with direction / status / time filters. | | `list_conversations` | List conversations with attached labels, newest-first, with filters. | | `get_conversation` | Single conversation with labels + last N messages, for thread drill-down. | | `search_contacts` | Find contacts and their labels by identity or name/email substring. | | `create_contact` | Create a contact on a connected account. | | `update_contact` | Patch a contact’s name / email / metadata. | | `list_labels` | List team labels (`lbl_...` ids) across the org. | | `create_label` | Create a new label (name + preset color). | | `update_label` | Patch a label’s name or color. | | `delete_label` | Delete a label (removes from all contacts / conversations). | | `add_contact_label` | Attach a label to a contact (syncs to conversations). | | `remove_contact_label` | Detach a label from a contact (syncs to conversations). | | `preview_bulk_label_by_message` | Preview up to 10,000 contacts matching an inbound-message keyword and date range. | | `start_bulk_label_by_message` | Start the exact confirmed preview as an asynchronous bulk-label job. | | `get_bulk_label_job` | Poll progress and final counts for a bulk-label job. | | `list_templates` | List Meta templates available on a phone number. | | `create_template` | Create a template and submit it to Meta for review. | | `sync_templates` | Pull the latest template inventory from Meta and upsert it. | Plus the customer tools (Business plan): `list_customers`, `get_customer`, `create_customer`, `update_customer`, `create_customer_setup_link`. See **[Available Tools](https://docs.kirimdev.com/tools/mcp/tools/) ** for the full schema of every tool, including input arguments and example responses. Quick example ------------- [Section titled “Quick example”](https://docs.kirimdev.com/tools/mcp/#quick-example) Once connected (see [Setup](https://docs.kirimdev.com/tools/mcp/setup/) ), you can ask the assistant in plain language: > _“Send a WhatsApp to +628123456789 saying the package arrives tomorrow.”_ The model will (typically): 1. Call `list_phone_numbers` to find the sending account. 2. Call `send_message` with `to`, `type: "text"`, and the body you asked for. 3. Report back with the new `msg_...` id and its status. You never write a tool call directly — the model picks the right tool from the natural-language request. See **[Prompting the AI](https://docs.kirimdev.com/tools/mcp/prompting/) ** for a cookbook of phrases that work well in Indonesian and English. Authentication -------------- [Section titled “Authentication”](https://docs.kirimdev.com/tools/mcp/#authentication) MCP accepts two kinds of credentials: * **OAuth sign-in** — OAuth-capable clients open a browser, an owner or admin signs in, picks one organization and approves `mcp:read`, `mcp:write` and/or `mcp:send`. See [Sign in with OAuth](https://docs.kirimdev.com/tools/mcp/setup/#sign-in-with-oauth) . * **API keys** — the **same Bearer API keys** as the REST `/v1` API. Generate a key from the dashboard (Settings → API Keys), then configure your MCP client to send it as `Authorization: Bearer kdv_live_...`. What’s _not_ exposed -------------------- [Section titled “What’s not exposed”](https://docs.kirimdev.com/tools/mcp/#whats-not-exposed) The MCP surface is deliberately narrower than `/v1`. The following are not (yet) MCP tools, and you should keep using the REST API or dashboard for them: * **Webhooks** — subscriptions, deliveries, replay. Managed via dashboard or [`/v1/webhook_subscriptions`](https://docs.kirimdev.com/api/) . * **Bulk operations** — broadcasts, bulk label, contact import. * **Account onboarding** — embedded signup, phone-number connect. * **Admin / billing** — out of scope for assistant-driven flows. If you have a strong use case for one of these, [open an issue](mailto:support@Kirimdev) — we ship MCP tools demand-first to keep the surface small enough for the model to use accurately. Limits ------ [Section titled “Limits”](https://docs.kirimdev.com/tools/mcp/#limits) The MCP endpoint shares the same per-organization token bucket as `/v1`. Default Starter plan limits: * **Write** (e.g. `send_message`): 60 / minute * **Read** (`tools/list`, discovery, and read-only tools): 600 / minute `X-RateLimit-*` headers ride on every MCP response, same shape as the REST endpoints. See [Rate Limits](https://docs.kirimdev.com/concepts/rate-limits/) for the full tier table. MCP classifies the JSON-RPC method and tool name rather than the outer HTTP method (all Streamable HTTP calls are `POST`). Read-only access therefore remains available when a subscription is inactive, while mutating tools return `subscription_inactive` until billing is restored. Safe retries ------------ [Section titled “Safe retries”](https://docs.kirimdev.com/tools/mcp/#safe-retries) Every mutating tool accepts an optional `idempotency_key`. Generate a unique key for one logical operation and reuse it only when retrying that same operation. Kirimdev replays the first successful result for 24 hours; reusing a key with different arguments returns `idempotency_key_reuse`. JSON-RPC request IDs correlate requests and responses but do **not** deduplicate retries. Where to next ------------- [Section titled “Where to next”](https://docs.kirimdev.com/tools/mcp/#where-to-next) * **[Setup](https://docs.kirimdev.com/tools/mcp/setup/) ** — wire the server into Claude Desktop, OpenCode, or Cursor in 5 minutes. * **[Prompting the AI](https://docs.kirimdev.com/tools/mcp/prompting/) ** — natural-language prompts that work, grouped by send / browse / search. * **[Available Tools](https://docs.kirimdev.com/tools/mcp/tools/) ** — full schema and examples for every MCP tool. * **[API Reference](https://docs.kirimdev.com/api/) ** — the REST endpoints these tools wrap. * **MCP spec** — [modelcontextprotocol.io](https://modelcontextprotocol.io/) for protocol-level details. --- # Setup | Kirimdev [Skip to content](https://docs.kirimdev.com/tools/mcp/setup/#_top) MCP server Setup ===== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2Fsetup%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2Fsetup%2F%20and%20help%20me%20with%20the%20following%3A%20) The Kirimdev MCP server is a **standard remote MCP server** at `https://api.kirimdev.com/mcp`, speaking the [Streamable HTTP transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports) defined by the MCP spec. That means **any MCP-compatible client** can connect to it — Claude, OpenCode, Cursor, VSCode, Cline, Zed, Continue, MCP Inspector, etc. There are two ways to authenticate: * **OAuth sign-in** — paste the URL, sign in to Kirimdev in your browser, pick an organization and approve the permissions. No key to copy. See [Sign in with OAuth](https://docs.kirimdev.com/tools/mcp/setup/#sign-in-with-oauth) . * **API key** — send the same Bearer API key you use for the REST API in an `Authorization` header. Works with every client, including scripts and clients without OAuth support. The client tabs below use this. Prerequisites ------------- [Section titled “Prerequisites”](https://docs.kirimdev.com/tools/mcp/setup/#prerequisites) * An owner or admin role in the organization (OAuth), **or** a Kirimdev API key (`kdv_live_...`) from **Settings → API Keys**. * At least one connected WhatsApp Business number. * The client of your choice installed (links in each tab below). Sign in with OAuth ------------------ [Section titled “Sign in with OAuth”](https://docs.kirimdev.com/tools/mcp/setup/#sign-in-with-oauth) Kirimdev implements the MCP authorization spec (revision 2026-07-28): the server publishes [protected resource metadata](https://api.kirimdev.com/.well-known/oauth-protected-resource/mcp) , clients identify themselves with an **OAuth Client ID Metadata Document**, and access tokens are bound to `https://api.kirimdev.com/mcp`. 1. **Add `https://api.kirimdev.com/mcp` to your client without any `Authorization` header.** The client receives a `401` pointing at the metadata above and opens your browser. 2. **Sign in to Kirimdev** (email or Google). Already signed in to the dashboard? This step is skipped. 3. **Pick an organization** if you own or administer more than one. Each connection reaches exactly one organization; connect again to use another. 4. **Choose the permissions.** Each one is a checkbox on the consent page: | Scope | Lets the client | Default | | --- | --- | --- | | `mcp:read` | Read conversations, messages, contacts, labels and templates | Always on | | `mcp:write` | Create and update contacts, labels, templates and customers; mark messages as read | On, can be unticked | | `mcp:send` | Send WhatsApp messages (`send_message`) | Off, tick to allow | A tool outside the approved scopes returns `403 insufficient_scope`; clients that support step-up authorization ask you again for the missing scope. Configure your client --------------------- [Section titled “Configure your client”](https://docs.kirimdev.com/tools/mcp/setup/#configure-your-client) * [Claude Desktop](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-159) * [OpenCode](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-160) * [Cursor](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-161) 1. **Open the Claude Desktop config file.** * [macOS](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-154) * [Windows](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-155) * [Linux](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-156) open ~/Library/Application\ Support/Claude/claude_desktop_config.json If the file doesn’t exist, create it with `{}` as its content. notepad $env:APPDATA\Claude\claude_desktop_config.json If the file doesn’t exist, create it with `{}` as its content. ${EDITOR:-nano} ~/.config/Claude/claude_desktop_config.json 2. **Add the Kirimdev MCP server entry.** Paste the following into the JSON (merge with any existing `mcpServers` block): { "mcpServers": { "kirimdev": { "command": "npx", "args": [ "-y", "mcp-remote", "https://api.kirimdev.com/mcp", "--header", "Authorization:Bearer ${KIRIM_API_KEY}" ], "env": { "KIRIM_API_KEY": "kdv_live_REPLACE_ME" } } }} Replace `kdv_live_REPLACE_ME` with your actual API key. 3. **Restart Claude Desktop.** Fully quit Claude (not just close the window) and reopen it. The config is read only at startup. 4. **Verify the connection.** In the Claude chat input, look for the **🔌 MCP icon** at the bottom-left. Click it — you should see **kirimdev** listed with 11 tools available. OpenCode supports remote MCP servers natively — no bridge needed. 1. **Open your OpenCode config.** Edit either the global config (`~/.config/opencode/opencode.json`) or a project-local one (`opencode.json` at the repo root). The project config wins when both exist. 2. **Add the Kirimdev MCP server entry.** { "$schema": "https://opencode.ai/config.json", "mcp": { "kirimdev": { "type": "remote", "url": "https://api.kirimdev.com/mcp", "enabled": true, "oauth": false, "headers": { "Authorization": "Bearer ${env:KIRIM_API_KEY}" } } }} Then export the API key in the shell that launches OpenCode: * [macOS / Linux](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-157) * [Windows](https://docs.kirimdev.com/tools/mcp/setup/#tab-panel-158) export KIRIM_API_KEY="kdv_live_REPLACE_ME" Add it to `~/.zshrc` / `~/.bashrc` to make it persistent. [Environment]::SetEnvironmentVariable("KIRIM_API_KEY", "kdv_live_REPLACE_ME", "User") Restart your terminal after running this. 3. **Restart OpenCode** so it picks up the new config. 4. **Verify the connection.** Run `opencode mcp list` — you should see `kirimdev` listed as connected with 11 tools. Or just open the TUI and type a prompt that uses the tools (see [Try it](https://docs.kirimdev.com/tools/mcp/setup/#try-it) below). Cursor supports remote MCP servers via `mcp.json` — no bridge needed. 1. **Create or open the Cursor MCP config.** * **Global** (every project): `~/.cursor/mcp.json` * **Project** (this repo only): `.cursor/mcp.json` at the project root If the file doesn’t exist, create it with `{}` as its content. 2. **Add the Kirimdev MCP server entry.** { "mcpServers": { "kirimdev": { "url": "https://api.kirimdev.com/mcp", "headers": { "Authorization": "Bearer ${env:KIRIM_API_KEY}" } } }} Then set the `KIRIM_API_KEY` environment variable in your shell profile (`~/.zshrc`, `~/.bashrc`, or Windows User env vars). Cursor interpolates `${env:KIRIM_API_KEY}` from the environment of the process that launched it — make sure Cursor is opened from a terminal where the variable is set, or set it system-wide. 3. **Reload Cursor.** Open the Command Palette (`Cmd+Shift+P` / `Ctrl+Shift+P`) → **Developer: Reload Window**, or restart the app. 4. **Verify the connection.** Open **Settings → Tools & MCP** (or **Features → Model Context Protocol** on older builds). The `kirimdev` server should appear as connected, with 11 tools listed. Toggle them on if any default to off. Try it ------ [Section titled “Try it”](https://docs.kirimdev.com/tools/mcp/setup/#try-it) In any of the clients above, send a chat message like: > _“List the WhatsApp phone numbers connected to my Kirimdev account.”_ The model will call `list_phone_numbers` and read back the numbers and their `phone_number_id`s. From there you can ask it to send messages, browse conversations, look up contacts, and so on — all in natural language. Head over to **[Prompting the AI](https://docs.kirimdev.com/tools/mcp/prompting/) ** for a cookbook of phrases that work well (in Indonesian and English) for each kind of task. Security tips ------------- [Section titled “Security tips”](https://docs.kirimdev.com/tools/mcp/setup/#security-tips) Troubleshooting --------------- [Section titled “Troubleshooting”](https://docs.kirimdev.com/tools/mcp/setup/#troubleshooting) ### The client doesn’t show the kirimdev server [Section titled “The client doesn’t show the kirimdev server”](https://docs.kirimdev.com/tools/mcp/setup/#the-client-doesnt-show-the-kirimdev-server) * Confirm the JSON file parses — paste it into [jsonlint.com](https://jsonlint.com/) . A misplaced comma silently disables every server. * For **Claude Desktop**: check `npx` is on PATH (`npx -y mcp-remote --help`). Install Node.js from [nodejs.org](https://nodejs.org/) if missing. * For **OpenCode / Cursor**: confirm `KIRIM_API_KEY` is actually set in the shell that launched the client — `echo $KIRIM_API_KEY` (or `$env:KIRIM_API_KEY` on PowerShell) should print the key. * Fully quit the client (not just close the window) before reopening — menu-bar / tray processes hold the old config. ### ”Invalid API key” or 401 errors [Section titled “”Invalid API key” or 401 errors”](https://docs.kirimdev.com/tools/mcp/setup/#invalid-api-key-or-401-errors) * Verify the key in the dashboard is `Active` (not revoked or expired). * Check there are no quotes or whitespace inside `kdv_live_...`. The format is `Bearer kdv_live_<26-base32-chars>`. * For **Claude Desktop**: the `--header` value must be exactly `Authorization:Bearer ${KIRIM_API_KEY}` with **no space** after `Authorization:`. `mcp-remote` parses on the first colon. * For **OpenCode** with an API key: make sure `"oauth": false` is set. Without it, OpenCode sees the 401 and starts the OAuth flow instead of trusting your bearer header. ### OAuth sign-in fails [Section titled “OAuth sign-in fails”](https://docs.kirimdev.com/tools/mcp/setup/#oauth-sign-in-fails) * **“No organization you can connect”** — your role is agent in every organization. Ask an owner to connect the client or to make you an admin. * **The client reports a registration error** — it only supports Dynamic Client Registration. Use an API key for that client. * **The connection stopped working** — your role changed, you were removed from the organization, or the connection was revoked. Connect again. * **`send_message` returns `403 insufficient_scope`** — `mcp:send` was not ticked on the consent page. Reconnect and tick **Send WhatsApp messages**. ### Tools call but every one returns an error [Section titled “Tools call but every one returns an error”](https://docs.kirimdev.com/tools/mcp/setup/#tools-call-but-every-one-returns-an-error) The MCP tool error response carries the same `code` / `message` / `request_id` envelope as the [REST API](https://docs.kirimdev.com/concepts/errors/) . Common ones: * `whatsapp_number_not_verified` — the `phone_number_id` you passed exists but isn’t `connected`. Reconnect from the dashboard. * `resource_not_found` — wrong `phone_number_id`, or the `conversation_id` / `contact_id` belongs to a different organization. * `rate_limit_exceeded` — you’re past the per-minute budget. The response includes a `Retry-After`\-equivalent timestamp. Claude.ai (web) and other OAuth-only clients -------------------------------------------- [Section titled “Claude.ai (web) and other OAuth-only clients”](https://docs.kirimdev.com/tools/mcp/setup/#claudeai-web-and-other-oauth-only-clients) Web clients such as the Claude.ai **Custom connector** dialog accept only OAuth. Add `https://api.kirimdev.com/mcp` as the connector URL and follow [Sign in with OAuth](https://docs.kirimdev.com/tools/mcp/setup/#sign-in-with-oauth) . If the dialog reports a client registration error, that client relies on Dynamic Client Registration, which Kirimdev does not offer — use **Claude Desktop** with an API key instead. Both share the same model and tool semantics. Other MCP clients ----------------- [Section titled “Other MCP clients”](https://docs.kirimdev.com/tools/mcp/setup/#other-mcp-clients) The Kirimdev MCP endpoint is a standard Streamable HTTP server — any client that speaks the spec works. Quick pointers for clients we haven’t tested end-to-end but that follow the same pattern: * **VSCode** (with the GitHub Copilot MCP extension) — workspace `.vscode/mcp.json`, same `mcpServers` shape as Cursor, but the `url` field is `"http"` typed; consult the [official VSCode MCP docs](https://code.visualstudio.com/docs/copilot/customization/mcp-servers) . * **Cline / Continue / Zed** — each ships its own settings file with a `mcpServers` (or equivalent) object accepting `url` + `headers`. * **MCP Inspector** (for debugging) — run `npx @modelcontextprotocol/inspector` and configure a custom server pointing at `https://api.kirimdev.com/mcp` with the bearer header. This is the fastest way to confirm the server is healthy if a client misbehaves. For ChatGPT, the “Custom GPT” Actions feature consumes our [OpenAPI spec](https://docs.kirimdev.com/api/) directly — MCP isn’t required for that flow. Where to next ------------- [Section titled “Where to next”](https://docs.kirimdev.com/tools/mcp/setup/#where-to-next) * **[Prompting the AI](https://docs.kirimdev.com/tools/mcp/prompting/) ** — what to actually say to the assistant once it’s connected. Cookbook of phrases for sending, browsing, searching, and multi-step workflows. * **[Available Tools](https://docs.kirimdev.com/tools/mcp/tools/) ** — full schema for each of the 6 tools. * **[MCP Overview](https://docs.kirimdev.com/tools/mcp/) ** — what the server does, what it doesn’t expose. * **[Errors](https://docs.kirimdev.com/concepts/errors/) ** — error codes shared with the REST API. --- # SDK Webhooks | Kirimdev [Skip to content](https://docs.kirimdev.com/sdks/typescript/webhooks/#_top) TypeScript SDK SDK Webhooks ============ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Fwebhooks%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fsdks%2Ftypescript%2Fwebhooks%2F%20and%20help%20me%20with%20the%20following%3A%20) The SDK exposes a dedicated webhooks entry point — `@kirimdev/sdk/webhooks` — separate from the REST client. You can import it without ever constructing a `Kirim` instance, which keeps your webhook handler lightweight and avoids accidentally bundling an `apiKey` into a public worker. `verifyWebhookSignature()` -------------------------- [Section titled “verifyWebhookSignature()”](https://docs.kirimdev.com/sdks/typescript/webhooks/#verifywebhooksignature) import { verifyWebhookSignature, InvalidSignatureError, SignatureExpiredError, MalformedPayloadError,} from '@kirimdev/sdk/webhooks' const event = await verifyWebhookSignature({ rawBody, // string — the EXACT bytes you received signatureHeader, // value of the X-Kirim-Signature header secrets: ['whsec_...'], // active signing secrets (array — supports rotation) toleranceSeconds: 300, // optional, default 300s (replay-protection window)}) **Returns** the parsed JSON payload on success. The shape depends on the event source — Kirimdev-native envelope for `conversation.*` and `contact.*`, Meta’s `{ object, entry }` body for `message.received` and `message.status`. Branch on the `X-Kirim-Event` request header to decide which shape to expect. **Throws** if verification fails — `InvalidSignatureError`, `SignatureExpiredError`, or `MalformedPayloadError` (all subclasses of `KirimWebhookError`). Use a single `try`/`catch` and return `401`. | Argument | Type | Required | Notes | | --- | --- | --- | --- | | `rawBody` | `string` | yes | Must be the unparsed body bytes as a UTF-8 string. | | `signatureHeader` | `string \| null \| undefined` | yes | The `X-Kirim-Signature` header value (e.g. `t=1700000000,v1=abc...`). | | `secrets` | `string[]` | yes | All currently active signing secrets — verifier tries each, succeeds on first match. | | `toleranceSeconds` | `number` | no | Reject deliveries whose timestamp is older than this (default 300). | Raw body is mandatory --------------------- [Section titled “Raw body is mandatory”](https://docs.kirimdev.com/sdks/typescript/webhooks/#raw-body-is-mandatory) The signature is computed over the **exact bytes** Kirimdev sent. If your framework parses JSON before you see it, the re-serialized payload will have different whitespace and the signature will not match. Read the raw body first, verify, _then_ parse. * [Hono](https://docs.kirimdev.com/sdks/typescript/webhooks/#tab-panel-98) * [Express](https://docs.kirimdev.com/sdks/typescript/webhooks/#tab-panel-99) * [Next.js (App Router)](https://docs.kirimdev.com/sdks/typescript/webhooks/#tab-panel-100) * [Bun.serve](https://docs.kirimdev.com/sdks/typescript/webhooks/#tab-panel-101) app.post('/webhooks/kirim', async (c) => { const rawBody = await c.req.text() // ✓ raw bytes as string // ...verify, then JSON.parse}) // Mount express.raw() ONLY on the webhook routeapp.post( '/webhooks/kirim', express.raw({ type: 'application/json' }), (req, res) => { const rawBody = (req.body as Buffer).toString('utf8') // ✓ // ... },) export async function POST(req: Request) { const rawBody = await req.text() // ✓ // ...} Bun.serve({ async fetch(req) { const rawBody = await req.text() // ✓ // ... },}) Worked example: Hono -------------------- [Section titled “Worked example: Hono”](https://docs.kirimdev.com/sdks/typescript/webhooks/#worked-example-hono) import { Hono } from 'hono'import { verifyWebhookSignature, InvalidSignatureError, SignatureExpiredError, MalformedPayloadError,} from '@kirimdev/sdk/webhooks' const app = new Hono() const SECRETS = [ process.env.KIRIM_WEBHOOK_SECRET_CURRENT!, process.env.KIRIM_WEBHOOK_SECRET_PREVIOUS,].filter(Boolean) as string[] app.post('/webhooks/kirim', async (c) => { const rawBody = await c.req.text() const signatureHeader = c.req.header('x-kirim-signature') ?? null const eventName = c.req.header('x-kirim-event') ?? '' try { const body = await verifyWebhookSignature({ rawBody, signatureHeader, secrets: SECRETS, }) // Acknowledge fast (<5s). Push heavy work to a queue. await handle(eventName, body) return c.text('ok') } catch (err) { if (err instanceof SignatureExpiredError) return c.text('stale', 400) if (err instanceof InvalidSignatureError) return c.text('bad sig', 401) if (err instanceof MalformedPayloadError) return c.text('bad body', 400) throw err }}) async function handle(eventName: string, body: unknown) { // Meta passthrough events arrive as { object, entry: [...] }. if (eventName === 'message.received' || eventName === 'message.status') { const meta = body as { entry: Array<{ changes: Array<{ value: unknown }> }> } const value = meta.entry[0]?.changes[0]?.value // walk Meta's shape here return } // Kirimdev-native envelope: { id, type, created_at, data }. const event = body as { id: string; type: string; data: unknown } switch (event.type) { case 'conversation.assigned': case 'conversation.closed': return refreshConversation(event.data) case 'contact.created': case 'contact.updated': return upsertContact(event.data) default: console.warn('unknown event type', event.type) }} export default app Worked example: Express ----------------------- [Section titled “Worked example: Express”](https://docs.kirimdev.com/sdks/typescript/webhooks/#worked-example-express) import express from 'express'import { verifyWebhookSignature, InvalidSignatureError, SignatureExpiredError, MalformedPayloadError,} from '@kirimdev/sdk/webhooks' const app = express()const SECRETS = [process.env.KIRIM_WEBHOOK_SECRET!] // Mount express.raw() on this route only — leave express.json()// configured for the rest of your routes if you need it.app.post( '/webhooks/kirim', express.raw({ type: 'application/json' }), async (req, res) => { const rawBody = (req.body as Buffer).toString('utf8') const signatureHeader = req.header('x-kirim-signature') ?? null try { const body = await verifyWebhookSignature({ rawBody, signatureHeader, secrets: SECRETS, }) await handle(req.header('x-kirim-event') ?? '', body) res.status(200).send('ok') } catch (err) { if (err instanceof SignatureExpiredError) return res.status(400).send('stale') if (err instanceof InvalidSignatureError) return res.status(401).send('bad sig') if (err instanceof MalformedPayloadError) return res.status(400).send('bad body') throw err } },) Typed events ------------ [Section titled “Typed events”](https://docs.kirimdev.com/sdks/typescript/webhooks/#typed-events) The SDK exports a typed union covering both shapes: import type { KirimWebhookEvent, // full union: native events + Meta passthrough KirimNativeWebhookEvent, // just the four native event types MetaPassthroughBody, // Meta's { object, entry } body ConversationAssignedEvent, ConversationClosedEvent, ContactCreatedEvent, ContactUpdatedEvent,} from '@kirimdev/sdk/webhooks' Branch on the `X-Kirim-Event` request header (not on a discriminator field) to decide whether the body is a Kirimdev-native envelope or a Meta passthrough — Meta bodies do not carry a `type` field at the top level: function route(eventName: string, body: KirimWebhookEvent) { if (eventName === 'message.received' || eventName === 'message.status') { const meta = body as MetaPassthroughBody const value = meta.entry[0]?.changes[0]?.value return handleMeta(eventName, value) } const native = body as KirimNativeWebhookEvent switch (native.type) { case 'conversation.assigned': case 'conversation.closed': return refreshConversation(native.data) case 'contact.created': case 'contact.updated': return upsertContact(native.data) }} See the [Event Catalogue](https://docs.kirimdev.com/webhooks/events/) for the full list and payload schema for each event. Secret rotation --------------- [Section titled “Secret rotation”](https://docs.kirimdev.com/sdks/typescript/webhooks/#secret-rotation) `verifyWebhookSignature()` accepts an array of secrets and succeeds on the first that matches. Rotation is therefore a three-step process with zero downtime: // 1. Mint a new secret in the dashboard or via the API.const next = await kirim.webhookSubscriptions.addSecret(subscriptionId)// next.secret is plaintext — store it now, you won't see it again. // 2. Deploy code that accepts BOTH the old and new secret:await verifyWebhookSignature({ rawBody, signatureHeader, secrets: [process.env.NEW_SECRET!, process.env.OLD_SECRET!],}) // 3. Once every running instance has the new secret, revoke the old.await kirim.webhookSubscriptions.revokeSecret(subscriptionId, oldSecretId) Replay protection ----------------- [Section titled “Replay protection”](https://docs.kirimdev.com/sdks/typescript/webhooks/#replay-protection) The verifier rejects deliveries whose signed timestamp is older than `toleranceSeconds` (default 300). This blocks attackers from re-sending a captured payload hours later. // Stricter — reject anything older than 60sawait verifyWebhookSignature({ rawBody, signatureHeader, secrets, toleranceSeconds: 60 }) If your handler is slow or behind a queue, raise the tolerance rather than disabling it. Managing subscriptions ---------------------- [Section titled “Managing subscriptions”](https://docs.kirimdev.com/sdks/typescript/webhooks/#managing-subscriptions) Create / list / update / delete subscriptions through the REST client: import { Kirim } from '@kirimdev/sdk'const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) // Createconst sub = await kirim.webhookSubscriptions.create({ url: 'https://your-app.example/webhooks/kirim', events: ['message.received', 'message.status'],})// sub.initial_secret is shown ONCE — persist it now. // List (async iterable)for await (const s of kirim.webhookSubscriptions.list()) { console.log(s.id, s.url, s.status)} // Pause / resumeawait kirim.webhookSubscriptions.update(sub.id, { status: 'paused' })await kirim.webhookSubscriptions.update(sub.id, { status: 'active' }) // Deleteawait kirim.webhookSubscriptions.del(sub.id) Replaying failed deliveries --------------------------- [Section titled “Replaying failed deliveries”](https://docs.kirimdev.com/sdks/typescript/webhooks/#replaying-failed-deliveries) // Browse the dead-letter queuefor await (const d of kirim.webhookDeliveries.list({ status: 'failed', limit: 50 })) { console.log(d.id, d.last_response_status, d.attempt_count)} // Replay oneawait kirim.webhookDeliveries.replay(deliveryId) See [Webhooks → Retries & Auto-Disable](https://docs.kirimdev.com/webhooks/retry/) for how Kirimdev auto-disables endpoints that stay broken too long. Related ------- [Section titled “Related”](https://docs.kirimdev.com/sdks/typescript/webhooks/#related) * [Webhooks → Overview](https://docs.kirimdev.com/webhooks/overview/) — events, delivery model, retries. * [Webhooks → Signing](https://docs.kirimdev.com/webhooks/signing/) — the underlying signature format the verifier checks. * [SDK Errors](https://docs.kirimdev.com/sdks/typescript/errors/) — error classes thrown by the REST client (separate from `KirimWebhookError`). --- # Prompting the AI | Kirimdev [Skip to content](https://docs.kirimdev.com/tools/mcp/prompting/#_top) MCP server Prompting the AI ================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2Fprompting%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2Fprompting%2F%20and%20help%20me%20with%20the%20following%3A%20) Once the Kirimdev MCP server is connected (see [Setup](https://docs.kirimdev.com/tools/mcp/setup/) ), you talk to it the same way you’d talk to a coworker. The model picks the right tool from your sentence — you don’t write the JSON payload, you don’t pass the `phone_number_id`, you just say what you want. This page is a cookbook of prompts that work well, grouped by what you’re trying to do. Mix the Indonesian and English phrasings — the model handles both. Sending messages ---------------- [Section titled “Sending messages”](https://docs.kirimdev.com/tools/mcp/prompting/#sending-messages) ### Plain text [Section titled “Plain text”](https://docs.kirimdev.com/tools/mcp/prompting/#plain-text) > _“Kirim WhatsApp ke +628123456789, bilang pesanannya sudah dikirim ya.”_ > _“Send a WhatsApp to +628123456789 saying the package arrives tomorrow.”_ > _“WA Andi di +628111222333: ‘Halo, jadwal meeting kita jam 3 sore besok.’”_ ### Send with a template [Section titled “Send with a template”](https://docs.kirimdev.com/tools/mcp/prompting/#send-with-a-template) Templates are required to start conversations outside the 24-hour customer-service window. Ask the model to look at what’s available first: > _“Templates apa saja yang sudah approved di akun WhatsApp saya?”_ > _“List my approved WhatsApp templates.”_ Then send with one: > _“Pakai template `order_shipped` ke +628123456789, isi nama ‘Andi’ dan resi ‘JNE12345’.”_ > _“Send the `welcome_message` template to +628111222333 in Indonesian.”_ ### Send media [Section titled “Send media”](https://docs.kirimdev.com/tools/mcp/prompting/#send-media) > _“Kirim gambar ini ke +628123456789: [https://example.com/promo.jpg](https://example.com/promo.jpg) > , captionnya ‘Promo akhir bulan!’”_ > _“Send a document to +628111222333 — link: [https://example.com/invoice.pdf](https://example.com/invoice.pdf) > , filename invoice-may.pdf.”_ ### Send interactive buttons [Section titled “Send interactive buttons”](https://docs.kirimdev.com/tools/mcp/prompting/#send-interactive-buttons) > _“Send +628123456789 a CTA button: title ‘Lihat pesanan’, URL [https://example.com/orders/123](https://example.com/orders/123) > .”_ > _“Kirim ke +628111222333 sebuah list dengan 3 pilihan: ‘Lacak pesanan’, ‘Hubungi CS’, ‘Lihat promo’.”_ Browsing conversations ---------------------- [Section titled “Browsing conversations”](https://docs.kirimdev.com/tools/mcp/prompting/#browsing-conversations) ### Recent activity [Section titled “Recent activity”](https://docs.kirimdev.com/tools/mcp/prompting/#recent-activity) > _“Tampilkan 5 percakapan terbaru di Kirimdev saya.”_ > _“Show me my open conversations from today.”_ > _“Conversations mana yang masih `pending` lebih dari 24 jam?”_ ### Drill into a chat [Section titled “Drill into a chat”](https://docs.kirimdev.com/tools/mcp/prompting/#drill-into-a-chat) > _“Buka percakapan dengan Andi, tampilkan 20 pesan terakhir.”_ > _“Show me the full message history for conversation cnv\_WEDKY18Y8F7W26E49VMB3VX8ZF.”_ > _“Apa pesan terakhir yang saya kirim ke +628123456789?”_ ### Summarize a thread [Section titled “Summarize a thread”](https://docs.kirimdev.com/tools/mcp/prompting/#summarize-a-thread) > _“Ringkas percakapan dengan Andi dalam 3 kalimat — apa keluhannya dan apa yang sudah saya janjikan?”_ > _“Summarize the last 50 messages in my conversation with Budi. What’s the customer’s main concern?”_ > _“Translate the last 5 messages from this conversation into English.”_ Searching contacts ------------------ [Section titled “Searching contacts”](https://docs.kirimdev.com/tools/mcp/prompting/#searching-contacts) ### By phone [Section titled “By phone”](https://docs.kirimdev.com/tools/mcp/prompting/#by-phone) > _“Cari kontak dengan nomor +628123456789, kasih tahu namanya kalau ada.”_ > _“Do I have a contact saved for +628111222333?”_ ### By name or email [Section titled “By name or email”](https://docs.kirimdev.com/tools/mcp/prompting/#by-name-or-email) > _“Cari kontak yang namanya mengandung ‘Andi’.”_ > _“Find all contacts whose email is on @example.com.”_ > _“Berapa kontak yang punya nama ‘Budi’ di akun saya?”_ Multi-step workflows -------------------- [Section titled “Multi-step workflows”](https://docs.kirimdev.com/tools/mcp/prompting/#multi-step-workflows) The model can chain tools to handle requests that span more than one step. A few real examples: ### Send follow-up to recent conversations [Section titled “Send follow-up to recent conversations”](https://docs.kirimdev.com/tools/mcp/prompting/#send-follow-up-to-recent-conversations) > _“Untuk setiap percakapan yang `resolved` dalam 24 jam terakhir, kirim pesan ‘Terima kasih sudah menghubungi kami, mohon nilai layanan kami: [https://example.com/rating](https://example.com/rating) > ’.”_ The model will: 1. `list_conversations` with `status=resolved` filter 2. Loop through each result 3. `send_message` to each contact’s phone number ### Find a contact then send [Section titled “Find a contact then send”](https://docs.kirimdev.com/tools/mcp/prompting/#find-a-contact-then-send) > _“Cari kontak namanya ‘Andi Wijaya’, kirim dia template `appointment_reminder` untuk besok jam 10 pagi.”_ The model will: 1. `search_contacts` with `search="Andi Wijaya"` 2. Confirm which Andi you mean (if multiple match) 3. `list_templates` to find `appointment_reminder` and inspect its variables 4. `send_message` with the template populated ### Audit recent sends [Section titled “Audit recent sends”](https://docs.kirimdev.com/tools/mcp/prompting/#audit-recent-sends) > _“Berapa pesan yang saya kirim hari ini? Apakah ada yang `failed`?”_ > _“Show me all `failed` messages from the last 24 hours and explain why each one failed.”_ Prompting tips -------------- [Section titled “Prompting tips”](https://docs.kirimdev.com/tools/mcp/prompting/#prompting-tips) ### Be specific about the sender [Section titled “Be specific about the sender”](https://docs.kirimdev.com/tools/mcp/prompting/#be-specific-about-the-sender) If you have multiple WhatsApp numbers connected, name the one you want: > _“Pakai akun ‘Kirim Chat’ untuk kirim ke +628123456789…”_ Otherwise the model picks the first `connected` account it finds. ### Phone-number format is flexible [Section titled “Phone-number format is flexible”](https://docs.kirimdev.com/tools/mcp/prompting/#phone-number-format-is-flexible) The model normalizes phone numbers before calling tools. All of these work: * `+628123456789` * `628123456789` * `+62 812-3456-789` * `0812-3456-789` (if context makes the country obvious) ### Ask “what can you do here?” [Section titled “Ask “what can you do here?””](https://docs.kirimdev.com/tools/mcp/prompting/#ask-what-can-you-do-here) > _“Apa saja yang bisa kamu lakukan dengan Kirimdev?”_ The model will list the 6 tools and what each one is for — useful for new users learning the surface. ### Give the model context [Section titled “Give the model context”](https://docs.kirimdev.com/tools/mcp/prompting/#give-the-model-context) The more context you give, the better it picks tools. Compare: * _“Send WA”_ → model has to ask follow-up questions * _“Kirim WhatsApp ke nomor saya +628123456789, isinya ‘tes’”_ → one tool call, done ### Confirm before risky actions [Section titled “Confirm before risky actions”](https://docs.kirimdev.com/tools/mcp/prompting/#confirm-before-risky-actions) For bulk sends, deletes, or anything you can’t undo, the model usually asks for confirmation. If it doesn’t, **ask it to show you the plan first**: > _“Sebelum kirim, tunjukkan ke siapa saja dan isi pesannya.”_ What the model can’t do (yet) ----------------------------- [Section titled “What the model can’t do (yet)”](https://docs.kirimdev.com/tools/mcp/prompting/#what-the-model-cant-do-yet) These are out of scope for the current MCP tools. Use the dashboard or REST API instead: * Manage labels (create, attach, detach) * Manage webhook subscriptions * Bulk import contacts * Send broadcast campaigns * Connect new WhatsApp phone numbers * Manage billing / subscription If your AI assistant needs one of these, [tell us](mailto:support@Kirimdev) which one and your use case — we ship MCP tools demand-first. Where to next ------------- [Section titled “Where to next”](https://docs.kirimdev.com/tools/mcp/prompting/#where-to-next) * **[Setup](https://docs.kirimdev.com/tools/mcp/setup/) ** — connect the MCP server in 5 minutes if you haven’t already. * **[Available Tools](https://docs.kirimdev.com/tools/mcp/tools/) ** — the schema behind each natural-language request. * **[MCP Overview](https://docs.kirimdev.com/tools/mcp/) ** — what the server is, what it isn’t. --- # Hermes Agent Integration | Kirimdev [Skip to content](https://docs.kirimdev.com/tools/hermes/#_top) Hermes Agent Hermes Agent Integration ======================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fhermes%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fhermes%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev’s **Hermes Agent integration** lets owners chat with an AI on WhatsApp: message your business number from a personal phone, the agent replies and runs commands through the [Public API](https://docs.kirimdev.com/api/) — same surface as REST and [MCP](https://docs.kirimdev.com/tools/mcp/) . The official **[kirimdev-hermes](https://github.com/kirimdev/kirimdev-hermes) ** plugin receives webhooks from Kirimdev; you host the Hermes gateway and LLM on your VPS. Webhook in, API out Kirimdev holds Meta credentials, message storage, and delivery. You run the Hermes gateway on your VPS — the plugin bridges webhook in and Public API out. Same API key Reuse `kdv_live_…` keys and webhook secrets from the dashboard. No second signup — Hermes is infra you operate. Owner access control `KIRIMDEV_OWNER_USERS` and optional `KIRIMDEV_ALLOWED_USERS` for internal numbers. Everyone else stays on the normal inbox path. 24/7 gateway A small VPS runs `hermes gateway run` behind nginx. Chat works even when your laptop is closed. How it fits together -------------------- [Section titled “How it fits together”](https://docs.kirimdev.com/tools/hermes/#how-it-fits-together) Owner (personal WhatsApp) │ messages business line (on Kirimdev) ▼ Kirimdev Cloud API │ POST message.received (X-Kirim-Signature) ▼ Your HTTPS endpoint ──► Hermes gateway (:8646) │ │ │ ├── LLM (Anthropic, OpenAI, …) │ └── POST /v1/{phone_number_id}/messages ▼ Owner sees reply + typing indicator on WhatsApp Kirimdev handles Meta credentials, message storage, and delivery receipts. Hermes handles reasoning, tool use, and orchestration. The plugin verifies [`X-Kirim-Signature`](https://docs.kirimdev.com/webhooks/signing/) on every inbound delivery and forwards only payloads for phone numbers listed in `KIRIMDEV_ENABLED_NUMBERS`. MCP vs Hermes — both access Kirimdev ------------------------------------ [Section titled “MCP vs Hermes — both access Kirimdev”](https://docs.kirimdev.com/tools/hermes/#mcp-vs-hermes--both-access-kirimdev) Both are Kirimdev integrations for **operators**, not customers: | | **MCP server** | **Hermes + kirimdev-hermes** | | --- | --- | --- | | **Chat via** | AI agent / MCP client (Claude, ChatGPT, Cursor, custom agents, …) | WhatsApp — to your business number | | **Runtime** | When the MCP client is in use | Always-on gateway on your VPS | | **Inbound** | You pull via MCP tools | Kirimdev pushes `message.received` webhooks | | **Outbound** | Model calls `send_message` in your session | Agent replies in the owner’s chat thread | | **Best for** | Test API, debug, ad-hoc tasks via AI | Owner: send templates, check inbox on the go | | **Setup** | [MCP Setup](https://docs.kirimdev.com/tools/mcp/setup/)
— ~5 minutes | [Hermes Setup](https://docs.kirimdev.com/tools/hermes/setup/)
— VPS + DNS | What owners can do ------------------ [Section titled “What owners can do”](https://docs.kirimdev.com/tools/hermes/#what-owners-can-do) ### Chat-driven Kirimdev ops [Section titled “Chat-driven Kirimdev ops”](https://docs.kirimdev.com/tools/hermes/#chat-driven-kirimdev-ops) Put your mobile number in `KIRIMDEV_OWNER_USERS`. Message the business line and ask in plain language — Hermes calls `kirimdev_*` tools against your Kirimdev account: > _“List approved templates on the store number.”_ > _“Send template order\_shipped to 628123456789 with tracking JNE123.”_ > _“How many open conversations today?”_ Customers only receive messages **you ask the agent to send** — they do not chat with Hermes directly. Set `KIRIMDEV_OWNER_FULL_AGENT=false` if owners should only use Kirimdev messaging tools (no shell/web). ### Internal team numbers [Section titled “Internal team numbers”](https://docs.kirimdev.com/tools/hermes/#internal-team-numbers) Add co-founders or ops leads to `KIRIMDEV_ALLOWED_USERS` so they can use the same agent from their phones. Numbers not on either list hit the `unknown` tier and do not engage the agent — their messages flow to the normal Kirimdev inbox instead. ### Scheduled digests to the owner [Section titled “Scheduled digests to the owner”](https://docs.kirimdev.com/tools/hermes/#scheduled-digests-to-the-owner) Set `KIRIMDEV_HOME_CHANNEL` to a composite id (`{phone_number_id}:{owner_phone}`) or an owner phone with `KIRIMDEV_DEFAULT_PHONE_NUMBER_ID`. Hermes cron jobs can push daily summaries to that channel — open ticket counts, reminders, etc. Mass campaigns still belong in Kirimdev [Broadcasts](https://docs.kirimdev.com/recipes/broadcast-campaign/) . What the plugin exposes ----------------------- [Section titled “What the plugin exposes”](https://docs.kirimdev.com/tools/hermes/#what-the-plugin-exposes) | Surface | Details | | --- | --- | | **Webhook** | `POST /webhook` — subscribe via [`/v1/webhook_subscriptions`](https://docs.kirimdev.com/api/)
with event `message.received` | | **Health** | `GET /health` → `{"status":"ok","platform":"kirimdev",…}` | | **Tools** | `kirimdev_*` namespace on toolset `hermes-kirimdev` (send, templates, …) | | **CLI send** | `hermes send --to kirimdev:{phone_number_id}:{customer} "Halo"` | The plugin defaults to **`https://api.kirimdev.com/v1`** — no manual API URL configuration for normal Kirimdev accounts. Full deploy steps (nginx, SSL, systemd) live in the plugin repo’s [DEPLOY.md](https://github.com/kirimdev/kirimdev-hermes/blob/main/deploy/DEPLOY.md) . Limits & expectations --------------------- [Section titled “Limits & expectations”](https://docs.kirimdev.com/tools/hermes/#limits--expectations) * **Self-hosted** — you provision the VPS, LLM API keys, and Hermes upgrades. Kirimdev does not run Hermes for you. * **One webhook URL per gateway** — typical pattern is one dedicated subdomain (e.g. `hermes-webhooks.example.com`) per environment. * **Typing indicator** — requires plugin v1.0.0+ and Kirimdev API support for typing on read (see [Mark as read](https://docs.kirimdev.com/sending/mark-as-read/) ). * **Not a BSP** — Meta bills WhatsApp usage to your WABA; Kirimdev bills platform usage per your plan. Hermes + LLM inference are your infra cost. Where to next ------------- [Section titled “Where to next”](https://docs.kirimdev.com/tools/hermes/#where-to-next) [Setup guide](https://docs.kirimdev.com/tools/hermes/setup/) [MCP server (AI agent access)](https://docs.kirimdev.com/tools/mcp/) [Plugin source (GitHub)](https://github.com/kirimdev/kirimdev-hermes) --- # Hermes Setup | Kirimdev [Skip to content](https://docs.kirimdev.com/tools/hermes/setup/#_top) Hermes Agent Hermes Setup ============ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fhermes%2Fsetup%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fhermes%2Fsetup%2F%20and%20help%20me%20with%20the%20following%3A%20) This page gets a **Hermes + Kirimdev** gateway running. For nginx, SSL, systemd, and hardening, follow the plugin’s [production DEPLOY.md](https://github.com/kirimdev/kirimdev-hermes/blob/main/deploy/DEPLOY.md) after the steps below. Prerequisites ------------- [Section titled “Prerequisites”](https://docs.kirimdev.com/tools/hermes/setup/#prerequisites) | Item | Notes | | --- | --- | | Kirimdev account | WhatsApp Cloud API number connected | | API key | `kdv_live_…` from Dashboard → Settings → API Keys | | `phone_number_id` | Meta business phone number ID (Settings → WhatsApp number) | | Hermes Agent | v0.14.0+ with an LLM provider configured (`hermes doctor`) | | Public HTTPS URL | Dedicated subdomain pointing at your gateway (production) | Install ------- [Section titled “Install”](https://docs.kirimdev.com/tools/hermes/setup/#install) 1. **Install Hermes Agent** on your server or dev machine. Follow the official Hermes install guide, then verify: hermes --versionhermes doctor 2. **Copy the Kirimdev plugin** into Hermes’ plugin directory. git clone https://github.com/kirimdev/kirimdev-hermes.gitcp -r kirimdev-hermes/kirimdev-platform ~/.hermes/plugins/kirimdev-platformhermes plugins enable kirimdev-platform Install Python deps in the Hermes environment: pip install aiohttp httpx# or: ~/.hermes/hermes-agent/venv/bin/pip install aiohttp httpx 3. **Set required configuration.** hermes config set KIRIMDEV_API_KEY kdv_live_xxxxxxxxhermes config set KIRIMDEV_ENABLED_NUMBERS 123456789012345hermes config set KIRIMDEV_DEFAULT_PHONE_NUMBER_ID 123456789012345hermes config set KIRIMDEV_PUBLIC_URL https://hermes-webhooks.example.comhermes config set KIRIMDEV_OWNER_USERS 628123456789 | Variable | Required | Purpose | | --- | --- | --- | | `KIRIMDEV_API_KEY` | ✅ | Public API bearer token | | `KIRIMDEV_WEBHOOK_SECRETS` | ✅ | Set after Step 5 (`whsec_…`) | | `KIRIMDEV_ENABLED_NUMBERS` | ✅ | Comma-separated `phone_number_id` values Hermes may operate | | `KIRIMDEV_DEFAULT_PHONE_NUMBER_ID` | Recommended | Default sender for cron / CLI | | `KIRIMDEV_PUBLIC_URL` | Recommended | Public base URL (no `/webhook` suffix) | | `KIRIMDEV_OWNER_USERS` | Recommended | Owner phones (digits, no `+`) | | `KIRIMDEV_ALLOWED_USERS` | Optional | Whitelist for instant replies | | `KIRIMDEV_OWNER_FULL_AGENT` | Optional | Default `true` — [see overview](https://docs.kirimdev.com/tools/hermes/) | | `KIRIMDEV_API_BASE_URL` | Optional | Default `https://api.kirimdev.com/v1` — leave unset for production | 4. **Start the gateway.** hermes gateway run# production: systemd user unit — see plugin DEPLOY.md Verify locally: curl -s http://127.0.0.1:8646/health# {"status":"ok","platform":"kirimdev","channel":"whatsapp"} 5. **Create a Kirimdev webhook subscription** pointing at your gateway. * [Dashboard](https://docs.kirimdev.com/tools/hermes/setup/#tab-panel-152) * [API](https://docs.kirimdev.com/tools/hermes/setup/#tab-panel-153) Dashboard → Settings → Webhooks → create subscription: * **URL:** `https://hermes-webhooks.example.com/webhook` * **Events:** `message.received` Copy the signing secret (`whsec_…`). curl -s -X POST https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIMDEV_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://hermes-webhooks.example.com/webhook", "events": ["message.received"] }' Save `initial_secret` from the response. See [Subscribe to Webhooks](https://docs.kirimdev.com/guides/webhooks/) for signature verification details. Configure Hermes and restart: hermes config set KIRIMDEV_WEBHOOK_SECRETS whsec_xxxxxxxxsystemctl --user restart hermes-gateway # if using systemd 6. **Smoke test.** Send a WhatsApp message **from a number listed in `KIRIMDEV_OWNER_USERS`** to your business line. You should see inbound logs and an agent reply. If nothing responds, check tier config — unknown senders require owner approval. See [Authorization tiers](https://docs.kirimdev.com/tools/hermes/#use-cases) in the overview. Production checklist -------------------- [Section titled “Production checklist”](https://docs.kirimdev.com/tools/hermes/setup/#production-checklist) * **nginx** reverse-proxy `443 → 127.0.0.1:8646`; do not expose `:8646` publicly. * **TLS** via Let’s Encrypt (certbot). * **systemd** user unit with `Restart=on-failure` — template in [hermes-gateway.service](https://github.com/kirimdev/kirimdev-hermes/blob/main/deploy/hermes-gateway.service) . * **Firewall** — allow 80/443 only. * **Secret rotation** — add comma-separated secrets to `KIRIMDEV_WEBHOOK_SECRETS` during overlap; see [Verifying Signatures](https://docs.kirimdev.com/webhooks/signing/) . Troubleshooting --------------- [Section titled “Troubleshooting”](https://docs.kirimdev.com/tools/hermes/setup/#troubleshooting) | Symptom | Likely cause | Fix | | --- | --- | --- | | `401` on webhook | Wrong `whsec_` | Match `KIRIMDEV_WEBHOOK_SECRETS` to subscription | | Inbound logged, no reply | Sender is `unknown` tier | Add to `KIRIMDEV_OWNER_USERS` or approve via WA button | | `phone_number_id not enabled` | ID mismatch | Fix `KIRIMDEV_ENABLED_NUMBERS` | | No typing indicator | API or plugin version | Plugin v1.0.0+; Kirimdev API with typing-on-read support | | `502` from nginx | Gateway down | `systemctl --user status hermes-gateway` | Related ------- [Section titled “Related”](https://docs.kirimdev.com/tools/hermes/setup/#related) * **[Hermes overview](https://docs.kirimdev.com/tools/hermes/) ** — architecture, use cases, MCP comparison * **[Receive messages](https://docs.kirimdev.com/sending/receive-messages/) ** — webhook payload shape * **[Mark as read](https://docs.kirimdev.com/sending/mark-as-read/) ** — read receipts + typing indicator API * **[MCP Setup](https://docs.kirimdev.com/tools/mcp/setup/) ** — assistant-driven integration (no VPS gateway) --- # Errors | Kirimdev [Skip to content](https://docs.kirimdev.com/concepts/errors/#_top) Concepts Errors ====== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Ferrors%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Ferrors%2F%20and%20help%20me%20with%20the%20following%3A%20) Every error from `/v1/*` ships in the same envelope. One branch in your client handles them all — switch on `error.code`, log `request_id`, and you’re done. Envelope -------- [Section titled “Envelope”](https://docs.kirimdev.com/concepts/errors/#envelope) { "error": { "type": "invalid_request_error", "code": "invalid_phone_number", "message": "Phone number must be in E.164 format (e.g. +628111222333).", "param": "to", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} | Field | Stability | Meaning | | --- | --- | --- | | `type` | Stable | One of seven broad categories: `invalid_request_error`, `authentication_error`, `permission_error`, `not_found`, `conflict`, `rate_limit_error`, `api_error`. | | `code` | **Permanent** | Programmatic identifier. Branch on this. | | `message` | May evolve | Human-readable. Show to operators; never branch on text. | | `param` | When relevant | JSON-pointer-style hint to the offending field. | | `request_id` | Always present | Echoes the `X-Request-Id` response header. Quote in support tickets. | Client recipe ------------- [Section titled “Client recipe”](https://docs.kirimdev.com/concepts/errors/#client-recipe) * [TypeScript SDK](https://docs.kirimdev.com/concepts/errors/#tab-panel-37) * [curl](https://docs.kirimdev.com/concepts/errors/#tab-panel-38) * [Python](https://docs.kirimdev.com/concepts/errors/#tab-panel-39) import { Kirim, KirimError, RateLimitError, InvalidRequestError, AuthenticationError, PermissionError, NotFoundError, ConflictError, ApiServerError, ConnectionError,} from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers('106540352242922') try { await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'text', text: { body: 'Halo!' }, })} catch (err) { if (err instanceof RateLimitError) { // SDK already retried; budget exhausted. return scheduleLater(err.retryAfterMs) } if (err instanceof InvalidRequestError) { // err.code === 'invalid_phone_number' | 'missing_required_field' | ... return showFieldError(err.param, err.message) } if (err instanceof AuthenticationError) { return rotateKey() } if (err instanceof PermissionError) { return notify('Forbidden — check plan, suspension, or phone access') } if (err instanceof NotFoundError) { return notify('Resource gone or never existed') } if (err instanceof ConflictError) { return retryWithBackoff() } if (err instanceof ApiServerError) { // 5xx upstream — exponential backoff, alert if persistent. return scheduleRetry(err.requestId) } if (err instanceof ConnectionError) { // Network / DNS / TLS — never reached the API. Safe to retry. return scheduleRetry() } if (err instanceof KirimError) { logger.error({ code: err.code, requestId: err.requestId }, 'Kirimdev error') } throw err} HTTP_RESPONSE=$(curl -sS -w "\n%{http_code}" \ -X POST "https://api.kirimdev.com/v1/106540352242922/messages" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628111222333", "type": "text", "text": { "body": "Halo!" } }') STATUS=$(echo "$HTTP_RESPONSE" | tail -n1)BODY=$(echo "$HTTP_RESPONSE" | sed '$d') if [ "$STATUS" -ge 400 ]; then CODE=$(echo "$BODY" | jq -r '.error.code') REQ_ID=$(echo "$BODY" | jq -r '.error.request_id') echo "Failed: $CODE (request_id=$REQ_ID)" >&2 exit 1fi import httpx resp = httpx.post( "https://api.kirimdev.com/v1/106540352242922/messages", headers={"Authorization": f"Bearer {KIRIM_KEY}"}, json={ "messaging_product": "whatsapp", "to": "+628111222333", "type": "text", "text": {"body": "Halo!"}, },) if resp.is_error: err = resp.json()["error"] match err["code"]: case "invalid_phone_number": raise ValueError(f"Bad number on field {err['param']}") case "rate_limit_exceeded": delay = int(resp.headers.get("retry-after", "1")) time.sleep(delay) # retry… case "whatsapp_upstream_error": logger.warning("Meta hiccup, backing off (req=%s)", err["request_id"]) case _: logger.error("Kirimdev error: %s (req=%s)", err["code"], err["request_id"]) raise RuntimeError(err["code"]) 402 vs 403 — billing gate vs structural denial ---------------------------------------------- [Section titled “402 vs 403 — billing gate vs structural denial”](https://docs.kirimdev.com/concepts/errors/#402-vs-403--billing-gate-vs-structural-denial) Both statuses use `error.type: "permission_error"`, but the HTTP status tells you **why** access was denied: | Status | Meaning | Typical `code` values | What to do | | --- | --- | --- | --- | | **402** | Your org can use the Public API, but **this operation is blocked by billing or plan entitlements**. An upgrade or renewal on the **same product surface** can unblock it. | `subscription_inactive`, `quota_exceeded`, `feature_not_entitled` | Open Billing → upgrade plan, renew subscription, or wait for quota reset. | | **403** | Access is denied **structurally** — not a paywall on a single feature. | `feature_not_available` (plan tier excludes `/v1` entirely), `organization_suspended` | Change plan tier to one that includes the Public API, or contact support for suspension. | **Rule of thumb:** branch on `error.code`, not the status alone. `feature_not_entitled` (402) means “your plan is active but this feature needs a higher tier” (e.g. Customers on Business+). `feature_not_available` (403) means “this plan tier does not include the Public API at all.” Pre-send compliance rejections on `POST /messages` return **422** with codes like `marketing_opted_out` — they are policy blocks on a specific send, not org-level billing gates. See the [pre-send compliance changelog](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/) . Full catalogue -------------- [Section titled “Full catalogue”](https://docs.kirimdev.com/concepts/errors/#full-catalogue) This catalogue covers errors returned by the HTTP layer — any non-2xx response from `/v1/*`. | HTTP | `type` | `code` | When | | --- | --- | --- | --- | | 400 | `invalid_request_error` | `invalid_phone_number` | `to` is not E.164 with leading `+`. | | 400 | `invalid_request_error` | `invalid_template_name` | Template `name` does not exist on the calling phone number. | | 400 | `invalid_request_error` | `missing_required_field` | Required field absent. `param` set. | | 400 | `invalid_request_error` | `invalid_field_value` | Field present but constraint violated. `param` set. | | 400 | `invalid_request_error` | `invalid_limit` | `limit` query param outside 1–100. | | 400 | `invalid_request_error` | `invalid_cursor` | Cursor undecodable or tampered. | | 400 | `invalid_request_error` | `invalid_webhook_url` | URL is not https or fails reachability sanity check. | | 400 | `invalid_request_error` | `invalid_event_type` | Webhook event name not recognised. | | 401 | `authentication_error` | `missing_api_key` | No `Authorization` header. | | 401 | `authentication_error` | `invalid_api_key` | Malformed, unknown, or hash mismatch. | | 401 | `authentication_error` | `revoked_api_key` | Key has been revoked. | | 401 | `authentication_error` | `expired_api_key` | `expires_at` passed. | | 402 | `permission_error` | `subscription_inactive` | Trial ended or subscription inactive. Upgrade to continue. | | 402 | `permission_error` | `quota_exceeded` | Monthly or resource quota for your plan is exhausted. Upgrade or wait for the next period. | | 402 | `permission_error` | `feature_not_entitled` | Active subscription, but this feature is not on your plan tier (e.g. Customers on Business+). | | 403 | `permission_error` | `feature_not_available` | Your plan tier does not include the Public API surface at all. | | 403 | `permission_error` | `organization_suspended` | Org-level block. Contact support. | | 404 | `not_found` | `resource_not_found` | Missing OR belongs to a different organisation. Returned as 404 (not 403) to avoid leaking existence. | | 409 | `conflict` | `idempotency_in_progress` | An identical request with the same `Idempotency-Key` is still processing. | | 409 | `conflict` | `webhook_subscription_disabled` | Trying to operate on an auto-disabled subscription. Re-enable first. | | 409 | `conflict` | `setup_link_inactive` | Trying to patch or revoke a customer setup link that’s already consumed, expired, or revoked. Generate a new link instead. | | 422 | `invalid_request_error` | `idempotency_key_reuse` | Same `Idempotency-Key` was used with a different request body. | | 422 | `invalid_request_error` | `whatsapp_number_not_verified` | Phone number is not yet approved by Meta. | | 422 | `invalid_request_error` | `cannot_revoke_last_secret` | Tried to revoke the only signing secret on a subscription. Add a new secret first. | | 422 | `invalid_request_error` | `media_not_found` | Referenced media library id is missing, deleted, or belongs to another team. | | 422 | `invalid_request_error` | `marketing_opted_out` | Recipient opted out of marketing; only blocks `MARKETING` templates. | | 422 | `invalid_request_error` | `account_restricted` | Meta restricted the WhatsApp account (compliance / messaging limits). | | 422 | `invalid_request_error` | `customer_suspended` | Customer (tenant-of-tenant) is suspended or archived. | | 422 | `invalid_request_error` | `contact_blocked` | An agent blocked the recipient on this WhatsApp number from the dashboard. Unblock it there to send again. | | 422 | `invalid_request_error` | `upstream_error` | WhatsApp account is disconnected. Reconnect via the dashboard. | | 429 | `rate_limit_error` | `rate_limit_exceeded` | Per-org token bucket empty. Honour `Retry-After`. See [Rate Limits](https://docs.kirimdev.com/concepts/rate-limits/)
. | | 500 | `api_error` | `internal_error` | Unexpected exception. Logged server-side with `request_id`. Open a ticket if persistent. | | 502 | `api_error` | `whatsapp_upstream_error` | Meta returned 5xx. Retry with backoff. | | 503 | `api_error` | `service_unavailable` | Maintenance or temporary overload. Honour `Retry-After` if present. | Stability commitment -------------------- [Section titled “Stability commitment”](https://docs.kirimdev.com/concepts/errors/#stability-commitment) * **`code` strings never change.** New codes are added only for new failure modes; existing codes keep their meaning forever. * **`message` text may evolve** — wording polish, i18n, hints. Don’t substring-match. * **HTTP status, `type`, and `code` form the v1 contract.** Anything else (`param`, `request_id`, response headers) is auxiliary. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/concepts/errors/#whats-next) Rate limits Headers, tier table, and 429 handling recipes. [Read →](https://docs.kirimdev.com/concepts/rate-limits/) Idempotency Safely retry POSTs without duplicating side effects. [Read →](https://docs.kirimdev.com/concepts/idempotency/) Handle failed sends Async delivery failures and the per-error retry playbook. [Read →](https://docs.kirimdev.com/guides/failed-sends/) API reference Endpoint-by-endpoint error tables. [Browse →](https://docs.kirimdev.com/api/) --- # Available Tools | Kirimdev [Skip to content](https://docs.kirimdev.com/tools/mcp/tools/#_top) MCP server Available Tools =============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2Ftools%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Ftools%2Fmcp%2Ftools%2F%20and%20help%20me%20with%20the%20following%3A%20) The Kirimdev MCP server exposes **27 tools** — a curated subset of the `/v1` REST surface chosen so an AI assistant has just enough breadth to handle the common WhatsApp messaging tasks without drowning the model in choices. Twenty-two are messaging-essentials (always available); five are multi-tenant customer tools that require the Business plan. The tools cluster into these workflows: * **Discovery** — `list_phone_numbers`, `list_templates`, `search_contacts`, `list_labels` * **Messaging** — `send_message`, `mark_as_read`, `get_message`, `list_messages` * **Conversation & contacts** — `list_conversations`, `get_conversation`, `create_contact`, `update_contact` * **Labels (contact-scoped)** — `list_labels`, `create_label`, `update_label`, `delete_label`, `add_contact_label`, `remove_contact_label` * **Bulk labels by message** — `preview_bulk_label_by_message`, `start_bulk_label_by_message`, `get_bulk_label_job` * **Templates** — `list_templates`, `create_template`, `sync_templates` * **Customers (Business plan)** — `list_customers`, `get_customer`, `create_customer`, `update_customer`, `create_customer_setup_link` Every tool is **multi-tenant scoped** by the calling API key. A tool call that passes a `phone_number_id` belonging to another organization returns `resource_not_found` — same envelope as the REST API. Idempotency for mutations ------------------------- [Section titled “Idempotency for mutations”](https://docs.kirimdev.com/tools/mcp/tools/#idempotency-for-mutations) Every mutating tool accepts this additional optional field: | Field | Type | Required | Description | | --- | --- | --- | --- | | `idempotency_key` | `string` (1-255) | no | Unique key for one logical mutation. Reuse it when retrying identical arguments within 24 hours. | Successful results are replayed without executing the mutation again. Reusing a key with different arguments returns `idempotency_key_reuse`. Tool errors are not cached, so transient errors can be retried. JSON-RPC `id` is only a correlation identifier and is not an idempotency key. Common error shape ------------------ [Section titled “Common error shape”](https://docs.kirimdev.com/tools/mcp/tools/#common-error-shape) When a tool fails for a recoverable reason (bad input, unknown id, subscription issue, rate limit), the response is a normal tool result with `isError: true` and the documented error envelope inlined: { "isError": true, "content": [ { "type": "text", "text": "{\n \"error\": {\n \"type\": \"not_found\",\n \"code\": \"resource_not_found\",\n \"message\": \"Resource not found.\",\n \"request_id\": \"req_01HXYZ...\"\n }\n}" } ]} The model sees the error and can retry, ask the user for a correction, or pick a different tool. See [Errors](https://docs.kirimdev.com/concepts/errors/) for the full catalogue of `code` values. * * * `list_phone_numbers` -------------------- [Section titled “list\_phone\_numbers”](https://docs.kirimdev.com/tools/mcp/tools/#list_phone_numbers) List the WhatsApp accounts (phone numbers) connected to the calling organization. **Call this first** — every other tool needs a `phone_number_id` from this output. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | `"connected"` \| `"all"` | no | Default `connected`. Pass `all` to include disconnected / onboarding / error accounts too. | **Example response:** { "object": "list", "data": [ { "object": "account", "phone_number": "+62 851-1760-0829", "phone_number_id": "918771144648527", "name": "Kirim Chat", "status": "connected" } ]} * * * `send_message` -------------- [Section titled “send\_message”](https://docs.kirimdev.com/tools/mcp/tools/#send_message) Send a WhatsApp message from one of the organization’s connected phone numbers. The `body` argument mirrors the **Meta WhatsApp Cloud API** request shape 1:1 — anything that works against `POST /v1/{phone_number_id}/messages` works here. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | From `list_phone_numbers`. | | `body` | `object` | **yes** | Meta-shaped payload. Discriminated by `type`. | **`body` variants** (discriminated by `type`): * [Text](https://docs.kirimdev.com/tools/mcp/tools/#tab-panel-162) * [Template](https://docs.kirimdev.com/tools/mcp/tools/#tab-panel-163) * [Image](https://docs.kirimdev.com/tools/mcp/tools/#tab-panel-164) * [Interactive (CTA URL)](https://docs.kirimdev.com/tools/mcp/tools/#tab-panel-165) { "messaging_product": "whatsapp", "to": "+628123456789", "type": "text", "text": { "body": "Halo dari Kirimdev MCP!" }} { "messaging_product": "whatsapp", "to": "+628123456789", "type": "template", "template": { "name": "hello_world", "language": "id", "components": [ { "type": "body", "parameters": [{ "type": "text", "text": "Andi" }] } ] }} { "messaging_product": "whatsapp", "to": "+628123456789", "type": "image", "image": { "link": "https://example.com/photo.jpg", "caption": "Pesanan Anda sudah dikemas" }} { "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "cta_url", "body": { "text": "Lihat status pesanan Anda" }, "action": { "name": "cta_url", "parameters": { "display_text": "Buka pelacakan", "url": "https://example.com/track/123" } } }} Other supported `type` values: `document`, `video`, `audio`, plus interactive `list` and `carousel`. See [Sending & receiving](https://docs.kirimdev.com/sending/send-text/) for the full payload reference per type. **Example response:** { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "to": "+628123456789", "type": "text", "status": "pending", "created_at": "2026-05-26T12:33:28.050Z"} The `status` will be `pending` immediately. The worker enqueues the send to Meta within milliseconds — poll `get_conversation` or subscribe to `message.status` webhooks to observe transitions to `sent` → `delivered` → `read`. * * * `mark_as_read` -------------- [Section titled “mark\_as\_read”](https://docs.kirimdev.com/tools/mcp/tools/#mark_as_read) Send a “read” receipt back to the original sender of an inbound message — this is what turns the double-tick blue on their phone. Optionally show a typing indicator alongside it (Meta combines them in a single upstream call). The tool takes the Meta-native `wamid` (e.g. `wamid.HBgN...`) from the inbound webhook payload or from a `get_conversation` / `get_message` response — **not** a Kirim `msg_` external id. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that received the message. | | `message_id` | `string` (`wamid....`) | **yes** | Meta-native wamid of the inbound message. | | `typing_indicator` | `{type:"text"}` | no | Show typing indicator alongside. Auto-dismisses on response or after ~25s. | **Example response:** { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "status": "read", "message_id": "wamid.HBgNNjI4MTIzNDU2Nzg5..."} Repeated calls on an already-read message are idempotent (returns the same shape without a second Meta round-trip). Only **inbound** messages can be marked as read — passing an outbound message id returns `invalid_field_value`. * * * `get_message` ------------- [Section titled “get\_message”](https://docs.kirimdev.com/tools/mcp/tools/#get_message) Fetch a single message by its public id (`msg_...`). Use this to poll delivery-status transitions (`pending` → `sent` → `delivered` → `read`) after a `send_message` call, or to inspect a failed message’s error payload. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that owns the message. | | `message_id` | `string` (`msg_...`) | **yes** | Kirim message id from `send_message` or `list_messages`. | **Example response:** { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "to": "+628123456789", "type": "text", "status": "delivered", "conversation_id": "cnv_WEDKY18Y8F7W26E49VMB3VX8ZF", "created_at": "2026-05-26T12:33:28.050Z"} Failed messages additionally carry an `error: { code, message, provider_code }` field — see [Errors](https://docs.kirimdev.com/concepts/errors/) for the mapping. * * * `list_messages` --------------- [Section titled “list\_messages”](https://docs.kirimdev.com/tools/mcp/tools/#list_messages) List messages on a connected WhatsApp account, ordered **newest-first**. Useful for audits (“show all failed sends today”), syncing a window of activity, or pulling the full history of a single conversation when you already have its `cnv_` id. For the most-recent-N messages of a conversation, prefer [`get_conversation`](https://docs.kirimdev.com/tools/mcp/tools/#get_conversation) — it inlines them in a single round-trip. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account to list from. | | `conversation_id` | `string` (`cnv_...`) | no | Filter to a single conversation. | | `direction` | `"inbound"` \| `"outbound"` | no | Filter by direction. | | `status` | `"pending"` \| `"sent"` \| `"delivered"` \| `"read"` \| `"failed"` | no | Filter by delivery status. | | `created_after` | `string` (ISO 8601) | no | Returns messages strictly after this instant. | | `created_before` | `string` (ISO 8601) | no | Returns messages strictly before this instant. | | `limit` | `number` (1-100) | no | Page size. Defaults to 25. | | `cursor` | `string` | no | Opaque cursor from a previous `next_cursor`. | **Example response:** { "object": "list", "data": [ { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "conversation_id": "cnv_WEDKY18Y8F7W26E49VMB3VX8ZF", "to": "+628123456789", "direction": "outbound", "type": "text", "content": "Halo!", "media_url": null, "status": "delivered", "created_at": "2026-05-26T12:33:28.050Z" } ], "has_more": true, "next_cursor": "eyJpZCI6Imd4..."} * * * `list_conversations` -------------------- [Section titled “list\_conversations”](https://docs.kirimdev.com/tools/mcp/tools/#list_conversations) List conversations on a specific connected WhatsApp account, ordered **newest-first** by last-message time. Each conversation includes its current `labels` array (`id`, `name`, and `color`). **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account to list from. | | `status` | `"open"` \| `"resolved"` \| `"pending"` | no | Filter by conversation status. | | `contact_id` | `string` (`ctc_...`) | no | Conversations for a single contact only. | | `limit` | `number` (1-100) | no | Page size. Defaults to 25. | | `cursor` | `string` | no | Opaque cursor from a previous `next_cursor`. | **Example response:** { "object": "list", "data": [ { "id": "cnv_WEDKY18Y8F7W26E49VMB3VX8ZF", "object": "conversation", "status": "open", "contact": { "id": "ctc_497WSDFDAJ2MK1BSRMK6VW3H7D", "phone_number": "+628123456789", "name": null }, "whatsapp_account": { "phone_number": "+62 851-1760-0829" }, "assignee": null, "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "green" } ], "unread_count": 0, "last_message_at": "2026-05-26T12:33:28.050Z", "last_inbound_at": null, "created_at": "2026-05-23T16:23:31.842Z", "updated_at": "2026-05-26T12:33:28.050Z" } ], "has_more": true, "next_cursor": "eyJpZCI6Imd4..."} * * * `get_conversation` ------------------ [Section titled “get\_conversation”](https://docs.kirimdev.com/tools/mcp/tools/#get_conversation) Fetch a single conversation by its public id, with the most recent messages inlined. Use this after `list_conversations` to drill into one thread. The conversation includes the same `labels` array returned by `list_conversations`. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Owning WhatsApp account. | | `conversation_id` | `string` (`cnv_...`) | **yes** | From `list_conversations`. | | `messages_limit` | `number` (1-100) | no | How many recent messages to inline. Defaults to 20. | **Example response:** { "id": "cnv_WEDKY18Y8F7W26E49VMB3VX8ZF", "object": "conversation", "status": "open", "contact": { "id": "ctc_...", "phone_number": "+628123456789", "name": null }, "whatsapp_account": { "phone_number": "+62 851-1760-0829" }, "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "green" } ], "unread_count": 0, "last_message_at": "2026-05-26T12:33:28.050Z", "messages": [ { "id": "msg_ZYJ70DEZM0485G3KHQ65F3N5Z2", "object": "message", "direction": "outbound", "type": "text", "content": "Halo! Pesan ini dikirim via MCP server Kirimdev.", "status": "sent", "created_at": "2026-05-26T12:33:28.050Z" } ]} Messages are ordered **newest-first**. * * * `search_contacts` ----------------- [Section titled “search\_contacts”](https://docs.kirimdev.com/tools/mcp/tools/#search_contacts) Search contacts on a connected WhatsApp account by phone number, BSUID, or username (exact match), or by name/email substring. An invalid phone filter is rejected instead of silently broadening the request to all contacts. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account to search within. | | `phone` | `string` | no | Exact E.164 match (with or without leading `+`). | | `bsuid` | `string` | no | Exact Meta Business-Scoped User ID match. | | `username` | `string` (1-100) | no | Exact WhatsApp username match, case-insensitive. | | `search` | `string` (1-200) | no | Case-insensitive substring against `name` and `email`. | | `limit` | `number` (1-100) | no | Page size. Defaults to 25. | | `cursor` | `string` | no | Opaque cursor from a previous `next_cursor`. | Passing no identity/search filter lists all contacts on the account (paginated). Each result includes the contact’s current `labels` array; unlabeled contacts return `labels: []`. **Example response:** { "object": "list", "data": [ { "id": "ctc_497WSDFDAJ2MK1BSRMK6VW3H7D", "object": "contact", "phone_number": "+628123456789", "name": "Andi Wijaya", "email": null, "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "green" } ], "created_at": "2026-05-23T16:23:31.842Z" } ], "has_more": false, "next_cursor": null} * * * `create_contact` ---------------- [Section titled “create\_contact”](https://docs.kirimdev.com/tools/mcp/tools/#create_contact) Create a new contact on a connected WhatsApp account. Supply `phone_number`, `bsuid`, or both. Duplicate identity values return `invalid_field_value` — fall back to `search_contacts` to find the existing row. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that will own the contact. | | `phone_number` | `string` (E.164) | conditional | Accepts `+62…` or `62…`; normalised to canonical form. Required when `bsuid` is omitted. | | `bsuid` | `string` | conditional | Meta Business-Scoped User ID. Required when `phone_number` is omitted. | | `username` | `string` (1-100) | no | Current WhatsApp username; display information, not identity. | | `name` | `string` (1-200) | no | Display name shown in the inbox. | | `email` | `string` (email) | no | Optional email. Not validated against the customer. | | `metadata` | `object` | no | Free-form JSON for customer fields (CRM id, segment, locale, …). | **Example response:** { "id": "ctc_497WSDFDAJ2MK1BSRMK6VW3H7D", "object": "contact", "phone_number": "+628123456789", "name": "Andi Wijaya", "email": "andi@example.com", "metadata": { "crm_id": "12345", "segment": "vip" }, "labels": [], "whatsapp_account": { "phone_number": "+62 851-1760-0829" }, "created_at": "2026-05-23T16:23:31.842Z", "updated_at": "2026-05-23T16:23:31.842Z"} * * * `update_contact` ---------------- [Section titled “update\_contact”](https://docs.kirimdev.com/tools/mcp/tools/#update_contact) Patch an existing contact by its public id. At least one of `name` / `username` / `email` / `metadata` must be provided. **Phone number is intentionally NOT patchable** — it is the identity column. If a contact “changes phone”, create a new contact and migrate the relevant state. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that owns the contact. | | `contact_id` | `string` (`ctc_...`) | **yes** | Contact public id. | | `name` | `string` \| `null` | no | New display name. Pass `null` to clear. | | `username` | `string` \| `null` | no | New WhatsApp username. Pass `null` to clear. | | `email` | `string` \| `""` \| `null` | no | New email. Pass empty string or `null` to clear. | | `metadata` | `object` \| `null` | no | New metadata object. Pass `null` to wipe all custom fields. | **Example response:** identical shape to `create_contact`, with the updated fields applied and `updated_at` bumped. * * * Labels (contact-scoped) ----------------------- [Section titled “Labels (contact-scoped)”](https://docs.kirimdev.com/tools/mcp/tools/#labels-contact-scoped) Label attach/detach is exposed **only on contacts**. Kirimdev syncs contact labels to every conversation for that contact (and vice versa when labels change in the dashboard), so there are no separate conversation label tools — use `add_contact_label` / `remove_contact_label` and the sync follows automatically. ### `list_labels` [Section titled “list\_labels”](https://docs.kirimdev.com/tools/mcp/tools/#list_labels) List every label in the calling organization (flattened across teams). Each row includes `team_id` for multi-team orgs. | Field | Type | Required | Description | | --- | --- | --- | --- | | `limit` | `number` (1-100) | no | Page size. Defaults to 25. | | `cursor` | `string` | no | Opaque cursor from a previous `next_cursor`. | ### `create_label` [Section titled “create\_label”](https://docs.kirimdev.com/tools/mcp/tools/#create_label) Create a new label. Duplicate `(team, name)` pairs return `invalid_field_value`. | Field | Type | Required | Description | | --- | --- | --- | --- | | `team_id` | `string` | no | Required for multi-team orgs; auto-selected when exactly one team. | | `name` | `string` (1-50) | **yes** | Display name (unique per team). | | `color` | preset name | no | One of `gray`, `red`, `orange`, `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `sky`, `blue`, `violet`, `pink`. Default `gray`. | ### `update_label` [Section titled “update\_label”](https://docs.kirimdev.com/tools/mcp/tools/#update_label) Patch `name` and/or `color`. At least one field required. | Field | Type | Required | Description | | --- | --- | --- | --- | | `label_id` | `string` (`lbl_...`) | **yes** | From `list_labels`. | | `name` | `string` (1-50) | no | New display name. | | `color` | preset name | no | New palette color. | ### `delete_label` [Section titled “delete\_label”](https://docs.kirimdev.com/tools/mcp/tools/#delete_label) Permanently delete a label and remove it from all attached contacts and conversations. | Field | Type | Required | Description | | --- | --- | --- | --- | | `label_id` | `string` (`lbl_...`) | **yes** | From `list_labels`. | ### `add_contact_label` [Section titled “add\_contact\_label”](https://docs.kirimdev.com/tools/mcp/tools/#add_contact_label) Attach a label to a contact. Idempotent. Also syncs to that contact’s conversations. | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that owns the contact. | | `contact_id` | `string` (`ctc_...`) | **yes** | Contact public id. | | `label_id` | `string` (`lbl_...`) | **yes** | Label public id. | Returns `{ contact_id, label_id, attached: true }`. Team mismatch → `invalid_field_value` on `label_id`. ### `remove_contact_label` [Section titled “remove\_contact\_label”](https://docs.kirimdev.com/tools/mcp/tools/#remove_contact_label) Detach a label from a contact. Idempotent when not attached. Syncs removal to conversations. | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that owns the contact. | | `contact_id` | `string` (`ctc_...`) | **yes** | Contact public id. | | `label_id` | `string` (`lbl_...`) | **yes** | Label public id. | Returns `{ contact_id, label_id, attached: false }`. ### `preview_bulk_label_by_message` [Section titled “preview\_bulk\_label\_by\_message”](https://docs.kirimdev.com/tools/mcp/tools/#preview_bulk_label_by_message) Create a 15-minute snapshot of contacts whose **inbound** message contains a literal keyword within a required date range. This preview is mandatory before starting the mutation. It returns a count and at most 20 contact samples; message bodies are never returned. | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account whose inbound messages are searched. | | `label_id` | `string` (`lbl_...`) | **yes** | Label to attach or detach. Must belong to the account’s team. | | `operation` | `"attach"` \| `"detach"` | **yes** | Mutation that will be bound into the snapshot. | | `keyword` | `string` (3-200) | **yes** | Case-insensitive literal substring. `%` and `_` are not treated as wildcards. | | `date_from` | ISO 8601 datetime | **yes** | Inclusive lower bound. | | `date_to` | ISO 8601 datetime | **yes** | Inclusive upper bound. Must be after `date_from`; maximum range is 366 days. | A preview with 1-10,000 matches returns `can_start: true` and a `preview_id`. Zero matches return no preview. If more than 10,000 contacts match, `can_start` is false and the keyword or date range must be narrowed. ### `start_bulk_label_by_message` [Section titled “start\_bulk\_label\_by\_message”](https://docs.kirimdev.com/tools/mcp/tools/#start_bulk_label_by_message) Start the exact snapshot produced by the preview. The operation is processed asynchronously in bounded batches. | Field | Type | Required | Description | | --- | --- | --- | --- | | `preview_id` | `string` | **yes** | Opaque id returned by `preview_bulk_label_by_message`; expires after 15 minutes. | | `idempotency_key` | `string` (1-255) | no | Reuse for retries of the same start call. | The response contains `job_id`, the current queue `state`, `matched_contacts`, the operation, and label id. Only one bulk-label operation runs per WhatsApp account at a time. ### `get_bulk_label_job` [Section titled “get\_bulk\_label\_job”](https://docs.kirimdev.com/tools/mcp/tools/#get_bulk_label_job) Poll progress for a queued bulk-label operation. | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that owns the job. | | `job_id` | `string` | **yes** | Opaque id returned by `start_bulk_label_by_message`. | Progress reports `total`, `processed`, `changed`, `unchanged`, and `batches`. Terminal states are `completed` and `failed`. Jobs from another organization or WhatsApp account return `resource_not_found`. * * * `list_templates` ---------------- [Section titled “list\_templates”](https://docs.kirimdev.com/tools/mcp/tools/#list_templates) List Meta-approved WhatsApp message templates available on a connected account. Templates are required to start conversations outside the 24-hour customer-service window. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that owns the templates. | | `status` | `"approved"` \| `"pending"` \| `"rejected"` \| `"all"` | no | Default `approved`. | | `language` | `string` | no | Filter to a single language code (e.g. `"id"`, `"en_US"`). | | `limit` | `number` (1-100) | no | Page size. Defaults to 25. | | `cursor` | `string` | no | Opaque cursor from a previous `next_cursor`. | **Example response:** { "object": "list", "data": [ { "id": "tmpl_...", "object": "template", "name": "order_shipped", "language": "id", "status": "approved", "components": [ { "type": "body", "text": "Pesanan {{1}} sudah dikirim hari ini." } ] } ], "has_more": false, "next_cursor": null} The `components` field carries the full Meta template structure so the model can construct a valid `send_message` template payload from it. `create_template` ----------------- [Section titled “create\_template”](https://docs.kirimdev.com/tools/mcp/tools/#create_template) Create a new WhatsApp message template and submit it to Meta for review. The `body` mirrors Meta’s `message_templates` create shape (components-only). On success the template is persisted with `status: "pending"` — Meta reviews asynchronously, so re-fetch with `list_templates` for the eventual `approved` / `rejected` status. **Input:** | Field | Type | Required | Description | | --- | --- | --- | --- | | `phone_number_id` | `string` (digits) | **yes** | Account that will own the template. | | `body.name` | `string` | **yes** | Lowercase letters, numbers, underscores (e.g. `order_update`). | | `body.category` | `"MARKETING"` \| `"UTILITY"` \| `"AUTHENTICATION"` | **yes** | Meta template category. | | `body.language` | `string` | **yes** | BCP-47 code (e.g. `id`, `en_US`). | | `body.components` | `array` | **yes** | Exactly one `BODY`; optional `HEADER` / `FOOTER` / `BUTTONS`. Media headers need `example.header_url` or `example.header_handle`. | | `body.variables` | `string[]` | no | Optional hint; derived from BODY placeholders when omitted. | | `body.messageSendTtlSeconds` | `number` | no | 30–2,592,000 seconds. | **Example call:** { "name": "create_template", "arguments": { "phone_number_id": "106540352242922", "body": { "name": "order_update", "category": "UTILITY", "language": "id", "components": [ { "type": "BODY", "text": "Pesanan {{1}} sedang diproses.", "example": { "body_text": [["A123"]] } } ] } }} A `name` + `language` pair that already exists on the account is rejected with `template_already_exists` (HTTP 409, `param: "name"`) **before** any Meta call — pick a different name or language. `sync_templates` ---------------- [Section titled “sync\_templates”](https://docs.kirimdev.com/tools/mcp/tools/#sync_templates) Pull the latest template inventory from Meta and upsert it into Kirimdev for the account. Idempotent — call it after `create_template` (or after a customer edits templates in Meta Business Manager) so the next `list_templates` reflects the latest review status. Returns a `{ created, updated, synced }` summary. { "name": "sync_templates", "arguments": { "phone_number_id": "106540352242922" }} * * * Customer tools (multi-tenant platform mode) ------------------------------------------- [Section titled “Customer tools (multi-tenant platform mode)”](https://docs.kirimdev.com/tools/mcp/tools/#customer-tools-multi-tenant-platform-mode) These five tools require the **Business plan** (or higher) and let an agent operate on **end-customers** (your tenants) rather than WhatsApp chat partners. On Pro or Starter the tools are advertised by `tools/list` but return HTTP 402 with `code: "feature_not_entitled"` when invoked. See the [Customers guide](https://docs.kirimdev.com/platform/customers/) for the full concept. ### `list_customers` [Section titled “list\_customers”](https://docs.kirimdev.com/tools/mcp/tools/#list_customers) Discovery — list customers attached to the organization. { "name": "list_customers", "arguments": { "status": "active", "search": "acme", "limit": 25 }} Returns a `data` array of customer objects plus `next_cursor` for pagination. ### `get_customer` [Section titled “get\_customer”](https://docs.kirimdev.com/tools/mcp/tools/#get_customer) Pull a customer + the list of WhatsApp accounts they own. The agent can read `whatsapp_accounts[].phone_number_id` and use it directly with `send_message`, `list_conversations`, and friends. { "name": "get_customer", "arguments": { "customer_id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### `create_customer` [Section titled “create\_customer”](https://docs.kirimdev.com/tools/mcp/tools/#create_customer) Create a new end-customer in the `pending` state. Surface it in your own UI immediately — the customer transitions to `active` once the first WhatsApp account is connected. { "name": "create_customer", "arguments": { "name": "Acme Logistics — Jakarta", "email": "admin@acme.io", "metadata": { "crm_id": "C-1234" } }} ### `update_customer` [Section titled “update\_customer”](https://docs.kirimdev.com/tools/mcp/tools/#update_customer) Patch any of `name` / `email` / `metadata` / `status`. `team_id` is NOT patchable — if a tenant has to move, create a new customer and re-onboard. { "name": "update_customer", "arguments": { "customer_id": "cus_01HXYZ...", "status": "suspended" }} ### `create_customer_setup_link` [Section titled “create\_customer\_setup\_link”](https://docs.kirimdev.com/tools/mcp/tools/#create_customer_setup_link) Generate a one-time setup URL the agent (or the human reading the agent’s output) can hand to the tenant. The plaintext token and full URL are returned **exactly once**. { "name": "create_customer_setup_link", "arguments": { "customer_id": "cus_01HXYZ...", "expires_in_hours": 168 }} Sample response: { "id": "csl_01HXYZ...", "object": "customer_setup_link", "customer_id": "cus_01HXYZ...", "status": "active", "token_last4": "aBcD", "expires_at": "2026-06-11T00:00:00.000Z", "consumed_at": null, "created_at": "2026-06-04T00:00:00.000Z", "setup_url": "https://app.kirimdev.com/onboard/csl_xxxxxxxxxxxxxxxxxxxxxxxxxxxx", "token": "csl_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"} * * * Where to next ------------- [Section titled “Where to next”](https://docs.kirimdev.com/tools/mcp/tools/#where-to-next) * **[MCP Overview](https://docs.kirimdev.com/tools/mcp/) ** — what the server does and doesn’t. * **[Setup](https://docs.kirimdev.com/tools/mcp/setup/) ** — connect Claude Desktop, OpenCode, or Cursor Desktop in 5 minutes. * **[API Reference](https://docs.kirimdev.com/api/) ** — the REST endpoints these tools wrap. * **[Errors](https://docs.kirimdev.com/concepts/errors/) ** — full catalogue of error codes. --- # Idempotency | Kirimdev [Skip to content](https://docs.kirimdev.com/concepts/idempotency/#_top) Concepts Idempotency =========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fidempotency%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fidempotency%2F%20and%20help%20me%20with%20the%20following%3A%20) Network blips, container restarts, client-side timeouts — anything that leaves a `POST` in an ambiguous “did it land?” state is fixed with the `Idempotency-Key` header. When to use ----------- [Section titled “When to use”](https://docs.kirimdev.com/concepts/idempotency/#when-to-use) Use an idempotency key on every `POST` whose side effect you can’t afford to double: The API reference displays this optional header on every `POST` operation, including its 24-hour replay semantics. * `POST /v1/{phone_number_id}/messages` — duplicate sends spam your customer. * `POST /v1/webhook_subscriptions/{id}/secrets` — duplicate rotations invalidate the wrong secrets. * `POST /v1/{phone_number_id}/contacts/bulk_label` — duplicate detach + attach creates a confusing audit trail. * `POST /v1/webhook_deliveries/{id}/replay` — duplicate replays hammer your endpoint. `GET` requests are naturally idempotent. The header is ignored on `PATCH` and `DELETE`; retry behavior for those methods is operation-specific, and a retry may repeat side effects such as webhook publication. How it works ------------ [Section titled “How it works”](https://docs.kirimdev.com/concepts/idempotency/#how-it-works) Pass a client-generated key in the header: POST /v1/106540352242922/messages HTTP/1.1Authorization: Bearer kdv_live_…Idempotency-Key: 8e1a2c30-f0a4-4c70-9c2d-7b5e3aef9201Content-Type: application/json { "messaging_product": "whatsapp", "to": "+628111222333", "type": "text", "text": { "body": "Halo!" }} The key is a free-form string. **Recommended format: UUIDv4.** Keep it cryptographically random to avoid collisions across consumers within your organisation. ### Server semantics [Section titled “Server semantics”](https://docs.kirimdev.com/concepts/idempotency/#server-semantics) The key is scoped to your organisation. Kirimdev hashes the request body (`sha256(method + path + canonical_json(body))`) and stores the pair in Redis for **24 hours**: | Scenario | Behaviour | | --- | --- | | **First call** | Process normally, cache the response. No `Idempotent-Replayed` header is set. | | **Replay, same key + same body** | Return the cached status code, body, and `Content-Type`, plus `Idempotent-Replayed: true`. | | **Replay, same key + different body** | Return `422 idempotency_key_reuse`. Refusing to lie about which side effect ran. | | **In-flight (lock held by earlier call)** | Wait up to 30 s for the original to finish. On timeout, return `409 idempotency_in_progress`. Retry with the same key. | | **Server error (`5xx`)** | Do not cache the response, so a later retry can run normally. | Cached response bodies are replayed in full. For POST operations that return a plaintext webhook signing secret or setup-link token only at creation time, reusing the same `Idempotency-Key` within 24 hours returns that same sensitive response again. Protect idempotency keys as carefully as the response they can replay. ### Worked example [Section titled “Worked example”](https://docs.kirimdev.com/concepts/idempotency/#worked-example) * [TypeScript SDK](https://docs.kirimdev.com/concepts/idempotency/#tab-panel-40) * [curl](https://docs.kirimdev.com/concepts/idempotency/#tab-panel-41) * [Python](https://docs.kirimdev.com/concepts/idempotency/#tab-panel-42) import { Kirim } from '@kirimdev/sdk'import { randomUUID } from 'node:crypto' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers('106540352242922') // The SDK auto-generates an Idempotency-Key for every POST.// Network-level retries inside ONE call reuse it automatically.await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'text', text: { body: 'Halo!' },}) // For application-level retries that survive a process restart,// pin the key yourself so it persists in your job record:const job = await jobs.claim() // { id, payload, idempotencyKey }const key = job.idempotencyKey ?? randomUUID()await jobs.update(job.id, { idempotencyKey: key }) await phone.messages.send(job.payload, { idempotencyKey: key }) KEY=$(uuidgen) send() { curl -sS -w "\n%{http_code}" \ -X POST "https://api.kirimdev.com/v1/106540352242922/messages" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $KEY" \ -d '{ "messaging_product": "whatsapp", "to": "+628111222333", "type": "text", "text": { "body": "Halo!" } }'} for attempt in 1 2 3; do RESP=$(send) STATUS=$(echo "$RESP" | tail -n1) case "$STATUS" in 2*) echo "$RESP" | sed '$d'; break ;; 409) sleep $((attempt * 1)); continue ;; # in-flight 422) echo "key reuse — caller bug" >&2; exit 1 ;; # body mismatch *) echo "$RESP" | sed '$d'; exit 1 ;; esacdone import uuid, time, httpx def send_once(client: httpx.Client, payload: dict, key: str | None = None): key = key or str(uuid.uuid4()) # one key per logical send attempt for attempt in range(3): resp = client.post( "https://api.kirimdev.com/v1/106540352242922/messages", json=payload, headers={"Idempotency-Key": key}, ) if resp.is_success: return resp.json() if resp.status_code == 409: # still processing time.sleep(attempt + 1) continue if resp.status_code == 422: # body mismatch raise RuntimeError("Idempotency-Key reuse with different body") resp.raise_for_status() raise RuntimeError("Idempotency retry budget exhausted") TTL behaviour ------------- [Section titled “TTL behaviour”](https://docs.kirimdev.com/concepts/idempotency/#ttl-behaviour) Cached responses expire **24 hours** after the first call. After that, the same key + same body executes a fresh side effect (a new message gets sent). Pick keys that won’t be replayed beyond a day. For longer dedup windows, persist your own “have I sent message X yet?” record (keyed by your own request id) and consult it before calling Kirimdev. Anti-patterns ------------- [Section titled “Anti-patterns”](https://docs.kirimdev.com/concepts/idempotency/#anti-patterns) * **Don’t reuse a key across logically different sends.** A key represents a single intent. Two distinct messages → two keys. * **Don’t generate a fresh key on every retry.** The whole point of the header is to dedupe — a new key per attempt sends a new message per attempt. * **Don’t use predictable keys** (sequential integers, `user_id + timestamp`). Predictable keys risk collisions across services in the same org. * **Don’t truncate or hash the key client-side.** Pass the full string you generated. Endpoint coverage ----------------- [Section titled “Endpoint coverage”](https://docs.kirimdev.com/concepts/idempotency/#endpoint-coverage) `Idempotency-Key` is honoured on **every `POST`** in the v1 surface — path-scoped (`/v1/{phone_number_id}/messages`, `/v1/{phone_number_id}/contacts/bulk_label`, …) and root-level (`/v1/labels`, `/v1/webhook_subscriptions`, …) alike. It is **ignored** on `GET`, `PATCH`, and `DELETE`. Consult each operation’s contract before retrying a mutation: without the POST cache layer, a retry can repeat side effects even when the resource’s final field values look unchanged. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/concepts/idempotency/#whats-next) Errors `idempotency_key_reuse` and `idempotency_in_progress` envelopes. [Read →](https://docs.kirimdev.com/concepts/errors/) Rate limits Combine idempotent retries with 429 backoff. [Read →](https://docs.kirimdev.com/concepts/rate-limits/) Send a message The most common idempotency target. [API →](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) Handle failed sends When and how to retry async failures. [Read →](https://docs.kirimdev.com/guides/failed-sends/) --- # Rate Limits | Kirimdev [Skip to content](https://docs.kirimdev.com/concepts/rate-limits/#_top) Concepts Rate Limits =========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Frate-limits%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Frate-limits%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev applies **per-organisation, per-endpoint-class token-bucket rate limits** on the **Public API (`/v1/*`)**. Limits are enforced atomically by a Redis Lua script — no race conditions across replicas, no surprise bursts. Endpoint classes ---------------- [Section titled “Endpoint classes”](https://docs.kirimdev.com/concepts/rate-limits/#endpoint-classes) | Class | HTTP methods | Examples | | --- | --- | --- | | `write` | `POST`, `PUT`, `PATCH`, `DELETE` | Send a message, attach a label, replay a webhook delivery | | `read` | `GET`, `HEAD` | List conversations, fetch a message, introspect via `/v1/me` | Each class has its own bucket. Sending 60 messages does not eat into your read budget, and vice versa. Tier table ---------- [Section titled “Tier table”](https://docs.kirimdev.com/concepts/rate-limits/#tier-table) | Plan | Write / min | Read / min | | --- | --- | --- | | Starter | 60 | 600 | | Pro | 600 | 6 000 | | Business | 1 200 | 12 000 | | Enterprise | configurable | configurable | Upgrade your plan in the dashboard to lift limits. Enterprise plans get per-key overrides on request — contact support. Headers on every response ------------------------- [Section titled “Headers on every response”](https://docs.kirimdev.com/concepts/rate-limits/#headers-on-every-response) Every successful response and every 4xx error carries the same three headers so client code can self-throttle without parsing the body: X-RateLimit-Limit: 60X-RateLimit-Remaining: 47X-RateLimit-Reset: 1716480000 | Header | Meaning | | --- | --- | | `X-RateLimit-Limit` | Bucket capacity for the class you just hit, in requests per minute. | | `X-RateLimit-Remaining` | Tokens currently available (floored to integer). | | `X-RateLimit-Reset` | Unix epoch seconds when the bucket would be full at the current refill rate. | On a 429 there is one extra header: Retry-After: 12 `Retry-After` is the number of seconds until **at least one** token becomes available. Sleep at least that long before retrying. Handling 429 ------------ [Section titled “Handling 429”](https://docs.kirimdev.com/concepts/rate-limits/#handling-429) * [TypeScript SDK](https://docs.kirimdev.com/concepts/rate-limits/#tab-panel-46) * [curl](https://docs.kirimdev.com/concepts/rate-limits/#tab-panel-47) * [Python](https://docs.kirimdev.com/concepts/rate-limits/#tab-panel-48) import { Kirim, RateLimitError } from '@kirimdev/sdk' // The SDK retries 429 automatically with jittered exponential backoff// (base delay is fixed at min(2^n * 500ms, 8s)). Configure the retry// budget if your workload needs more headroom.const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY!, maxRetries: 5, // default 2}) const phone = kirim.phoneNumbers('106540352242922') try { await phone.messages.send({ messaging_product: 'whatsapp', to: '+628111222333', type: 'text', text: { body: 'Halo!' }, })} catch (err) { if (err instanceof RateLimitError) { // Budget exhausted — persist for offline processing. await queue.enqueue({ retryAfterMs: err.retryAfterMs }) } throw err} send() { curl -sS -w "\n%{http_code}" \ -X POST "https://api.kirimdev.com/v1/106540352242922/messages" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -D /tmp/headers \ -d '{ "messaging_product": "whatsapp", "to": "+628111222333", "type": "text", "text": { "body": "Halo!" } }'} for attempt in 1 2 3 4 5; do RESP=$(send) STATUS=$(echo "$RESP" | tail -n1) if [ "$STATUS" -ne 429 ]; then echo "$RESP" | sed '$d' break fi DELAY=$(awk 'tolower($1)=="retry-after:" { print $2 }' /tmp/headers | tr -d '\r') # Add 0.75x–1.25x jitter so retries don't synchronise. sleep $(awk -v d="$DELAY" 'BEGIN { srand(); print d * (0.75 + rand()*0.5) }')done import random, time, httpx def send_with_backoff(client: httpx.Client, payload: dict, max_attempts: int = 5): for attempt in range(max_attempts): resp = client.post( "https://api.kirimdev.com/v1/106540352242922/messages", json=payload, ) if resp.status_code != 429: resp.raise_for_status() return resp.json() retry_after = int(resp.headers.get("retry-after", "1")) jitter = 0.75 + random.random() * 0.5 # 0.75x–1.25x time.sleep(retry_after * jitter) raise RuntimeError("Rate-limit retry budget exhausted") Anti-patterns ------------- [Section titled “Anti-patterns”](https://docs.kirimdev.com/concepts/rate-limits/#anti-patterns) * **Don’t fire requests as fast as `Remaining` allows.** The bucket refills continuously, but bursting it to zero and immediately retrying just trades a 429 for another 429. * **Don’t ignore `Retry-After`.** It’s accurate. Retrying earlier guarantees a second 429 and consumes attempts you’ll need later. * **Don’t sleep without jitter.** A herd of retries waking up at the same instant will all trip the limiter together. Multiply `Retry-After` by `0.75–1.25` before sleeping. * **Don’t shard for capacity by minting more API keys.** Keys share the org bucket. To raise throughput, upgrade the plan or request an Enterprise override. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/concepts/rate-limits/#whats-next) Idempotency Retry without duplicating sends. [Read →](https://docs.kirimdev.com/concepts/idempotency/) Errors Full envelope and code catalogue. [Read →](https://docs.kirimdev.com/concepts/errors/) Pagination Opaque cursors and iteration recipes. [Read →](https://docs.kirimdev.com/concepts/pagination/) Polling Cache, delta sync, and conditional GET for list polls. [Read →](https://docs.kirimdev.com/concepts/polling/) API reference Per-endpoint rate-limit class annotations. [Browse →](https://docs.kirimdev.com/api/) --- # Polling list endpoints | Kirimdev [Skip to content](https://docs.kirimdev.com/concepts/polling/#_top) Concepts Polling list endpoints ====================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fpolling%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fpolling%2F%20and%20help%20me%20with%20the%20following%3A%20) Integrators that poll `GET /v1/{phone_number_id}/conversations` on a fixed interval do not need to change their request shape — Kirimdev applies three layers of efficiency on the server and in the HTTP contract. Short-lived response cache -------------------------- [Section titled “Short-lived response cache”](https://docs.kirimdev.com/concepts/polling/#short-lived-response-cache) List responses are cached in Redis for **8 seconds** per unique query (org, account, filters, cursor, limit, and `updated_since`). Repeated polls inside that window are served from cache instead of re-running the heavy inbox join. The cache is **invalidated immediately** when a conversation row on that account changes (inbound message, outbound send, assignment, status patch, and similar writes). Delta sync with `updated_since` ------------------------------- [Section titled “Delta sync with updated\_since”](https://docs.kirimdev.com/concepts/polling/#delta-sync-with-updated_since) Pass an ISO 8601 timestamp to fetch only conversations whose `updated_at` is **strictly after** that instant: GET /v1/106540352242922/conversations?updated_since=2026-06-19T10:00:00.000Z&limit=25Authorization: Bearer kdv_live_... When nothing changed, the response is a normal `200` with `data: []`. Store the newest `updated_at` from each non-empty page and send it on the next poll. **Sort order:** requests **with** `updated_since` order by `updated_at DESC` (most recently mutated first). Requests **without** it keep the inbox order `last_message_at DESC`. Cursors are only valid for the same query shape — do not reuse a cursor across modes. Works alongside cursor pagination and the usual `status` / `contact_id` filters. Conditional GET (`ETag` / `304`) -------------------------------- [Section titled “Conditional GET (ETag / 304)”](https://docs.kirimdev.com/concepts/polling/#conditional-get-etag--304) Every list response includes a weak `ETag` derived from the newest `updated_at`, max `unread_count`, row count, and whether another page exists: HTTP/1.1 200 OKETag: W/"2026-06-19T11:00:00.000Z:2:1" On the next poll, send the value back: GET /v1/106540352242922/conversationsIf-None-Match: W/"2026-06-19T11:00:00.000Z:2:1" When nothing changed, Kirimdev responds **`304 Not Modified`** with no JSON body — saving bandwidth and client parse time. Rate-limit headers are still attached. Combine `updated_since` (smaller DB result sets) with `If-None-Match` (cheap unchanged responses) for the lowest overhead polling loop. Message status polling (`GET /messages/{id}`) --------------------------------------------- [Section titled “Message status polling (GET /messages/{id})”](https://docs.kirimdev.com/concepts/polling/#message-status-polling-get-messagesid) Integrators that poll a single message by `msg_*` id to watch delivery status get the same server-side protections **without changing their code**: | Status | Cache TTL | Why | | --- | --- | --- | | `pending`, `sent` | 5 s | Status changes quickly | | `delivered` | 10 s | One step from terminal | | `read`, `failed` | 60 s | Terminal — pollers often keep checking | The cache key is per `(org, account, message id)` and is **dropped immediately** when the worker applies a status webhook or send pipeline update. Responses include a weak **`ETag`** derived from `status` and error fields. Send it as **`If-None-Match`** to receive **`304 Not Modified`** when the message has not changed. For new integrations, prefer a [`message.status` webhook](https://docs.kirimdev.com/webhooks/events/) subscription instead of polling — but existing poll loops are safe on the platform. Related ------- [Section titled “Related”](https://docs.kirimdev.com/concepts/polling/#related) * [Pagination](https://docs.kirimdev.com/concepts/pagination/) — opaque cursors and page iteration * [Rate limits](https://docs.kirimdev.com/concepts/rate-limits/) — per-org read/write budgets * [Messages list](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/) — `created_after` for message delta sync --- # Pagination | Kirimdev [Skip to content](https://docs.kirimdev.com/concepts/pagination/#_top) Concepts Pagination ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fpagination%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fpagination%2F%20and%20help%20me%20with%20the%20following%3A%20) Every list endpoint in Kirimdev uses the same **opaque cursor** contract — phone-scoped resources like `GET /v1/{phone_number_id}/messages` and root-level resources like `GET /v1/labels` behave identically. Request ------- [Section titled “Request”](https://docs.kirimdev.com/concepts/pagination/#request) GET /v1/106540352242922/messages?limit=25&cursor=eyJpZCI6Im1zZ18wMUhYWVoiLCJ0cyI6IjIwMjYtMDUtMjNUMTA6MDA6MDAuMDAwWiJ9 HTTP/1.1 | Query param | Default | Range | Notes | | --- | --- | --- | --- | | `limit` | 25 | 1–100 | Page size. Out-of-range → `400 invalid_limit`. | | `cursor` | — | opaque | Echo `next_cursor` from the previous response, verbatim. | Resource-specific filters (`status`, `conversation_id`, `direction`, `created_after`, `updated_since`, …) live alongside `cursor` — see each endpoint’s reference for the exact set. Response -------- [Section titled “Response”](https://docs.kirimdev.com/concepts/pagination/#response) { "data": [ { "id": "msg_01HXYZ…" }, { "id": "msg_01HXYY…" } ], "has_more": true, "next_cursor": "eyJpZCI6Im1zZ18wMUhYWVoiLCJ0cyI6IjIwMjYtMDUtMjNUMTA6MDA6MDAuMDAwWiJ9", "request_id": "req_01HXZ0ABCDEFGHJKMNPQRSTVWX"} | Field | Meaning | | --- | --- | | `data` | Array of resources (zero or more). | | `has_more` | `true` if at least one more page is available. | | `next_cursor` | Opaque string to pass back on the next call. `null` when `has_more` is `false`. | | `request_id` | Echoes the `X-Request-Id` header. | Iteration recipe ---------------- [Section titled “Iteration recipe”](https://docs.kirimdev.com/concepts/pagination/#iteration-recipe) * [TypeScript SDK](https://docs.kirimdev.com/concepts/pagination/#tab-panel-43) * [curl](https://docs.kirimdev.com/concepts/pagination/#tab-panel-44) * [Python](https://docs.kirimdev.com/concepts/pagination/#tab-panel-45) import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers('106540352242922') // Async iterator — pages fetched lazily.for await (const message of phone.messages.list({ conversation_id: 'cnv_01HXYZABCDEFGHJKMNPQRSTVWX', limit: 50,})) { console.log(message.id, message.status)} // Or materialise (small lists only):const labels = await Array.fromAsync(kirim.labels.list()) URL="https://api.kirimdev.com/v1/106540352242922/messages?limit=50&conversation_id=cnv_01HXYZABCDEFGHJKMNPQRSTVWX" while [ -n "$URL" ]; do RESP=$(curl -sS -H "Authorization: Bearer $KIRIM_KEY" "$URL") echo "$RESP" | jq -c '.data[]' HAS_MORE=$(echo "$RESP" | jq -r '.has_more') CURSOR=$(echo "$RESP" | jq -r '.next_cursor') if [ "$HAS_MORE" = "true" ]; then URL="https://api.kirimdev.com/v1/106540352242922/messages?limit=50&conversation_id=cnv_01HXYZABCDEFGHJKMNPQRSTVWX&cursor=$CURSOR" else URL="" fidone import httpx def paginate(client: httpx.Client, url: str, **filters): cursor = None while True: params = {"limit": 50, **filters} if cursor: params["cursor"] = cursor resp = client.get(url, params=params) resp.raise_for_status() body = resp.json() yield from body["data"] if not body["has_more"]: return cursor = body["next_cursor"] with httpx.Client(headers={"Authorization": f"Bearer {KIRIM_KEY}"}) as client: for msg in paginate( client, "https://api.kirimdev.com/v1/106540352242922/messages", conversation_id="cnv_01HXYZABCDEFGHJKMNPQRSTVWX", ): print(msg["id"], msg["status"]) Cursor semantics ---------------- [Section titled “Cursor semantics”](https://docs.kirimdev.com/concepts/pagination/#cursor-semantics) * **Opaque.** Do not parse, modify, or assume structure. The encoding may change at any time — the only promise is that the cursor you got back works on the next call. * **Tamper-evident.** A malformed or modified cursor returns `400 invalid_cursor`. * **Filter-bound.** A cursor is only valid for the **same filter set** it was generated against. Changing `status=open` to `status=resolved` between pages invalidates the cursor — start a fresh request. * **Stable under concurrent inserts.** Keyset pagination on `(created_at DESC, id DESC)` means a row inserted while you’re paginating either appears on a page you’ve already seen (and is missing from later pages — accept this) or on a page you’ll see later, always with deterministic ordering. Default ordering ---------------- [Section titled “Default ordering”](https://docs.kirimdev.com/concepts/pagination/#default-ordering) Different resources have different natural orderings — pagination itself is the same. | Endpoint | Order | | --- | --- | | `GET /v1/{phone_number_id}/messages` | `(created_at DESC, id DESC)` | | `GET /v1/{phone_number_id}/contacts` | `(created_at DESC, id DESC)` | | `GET /v1/{phone_number_id}/conversations` | `(last_message_at DESC NULLS LAST, id DESC)` | | `GET /v1/{phone_number_id}/templates` | `(created_at DESC, id DESC)` | | `GET /v1/labels` | `(created_at DESC, id DESC)` | | `GET /v1/accounts` | `(created_at DESC, id DESC)` | | `GET /v1/webhook_subscriptions` | `(created_at DESC, id DESC)` | | `GET /v1/webhook_deliveries` | `(created_at DESC, id DESC)` | There is no `?sort=` parameter — the default is the only order. A future `?sort=…` parameter can be added non-breakingly with the current default still applying when unset. Anti-patterns ------------- [Section titled “Anti-patterns”](https://docs.kirimdev.com/concepts/pagination/#anti-patterns) * **Don’t `?limit=100` then drop most of the results client-side.** Apply the resource-specific filters server-side; you save your read budget and reduce latency. * **Don’t loop forever on `next_cursor`.** A bug that forgets to pass `cursor` will paginate the first page repeatedly. Always exit when `has_more` is `false`. * **Don’t paginate to materialise full tables for export.** Use the dashboard’s CSV export feature instead — it streams server-side without burning your API quota. * **Don’t change filters mid-iteration.** Cursors are bound to the filter set. Restart with no cursor when filters change. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/concepts/pagination/#whats-next) Resource IDs The prefixed identifier scheme used in every page. [Read →](https://docs.kirimdev.com/concepts/resource-ids/) Rate limits Pagination shares your read budget. [Read →](https://docs.kirimdev.com/concepts/rate-limits/) List messages Filter set and ordering for the messages endpoint. [API →](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/) API reference All list endpoints in one place. [Browse →](https://docs.kirimdev.com/api/) --- # Resource IDs | Kirimdev [Skip to content](https://docs.kirimdev.com/concepts/resource-ids/#_top) Concepts Resource IDs ============ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fresource-ids%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fresource-ids%2F%20and%20help%20me%20with%20the%20following%3A%20) Every resource exposed through the Public API has a stable, prefixed identifier of the form `_<26 base32 chars>`. msg_01HXYZABCDEFGHJKMNPQRSTVWX The one exception is the WhatsApp **`phone_number_id`** — that’s Meta’s identifier and uses a different format. See [phone\_number\_id](https://docs.kirimdev.com/concepts/resource-ids/#phone_number_id) below. Prefix table ------------ [Section titled “Prefix table”](https://docs.kirimdev.com/concepts/resource-ids/#prefix-table) | Prefix | Resource | | --- | --- | | `org_` | Organisation | | `msg_` | Message | | `cnv_` | Conversation | | `ctc_` | Contact | | `tmpl_` | Template | | `wbs_` | Webhook subscription | | `wbd_` | Webhook delivery | | `sec_` | Webhook signing secret | | `evt_` | Event (Kirimdev-native envelope `id`) | | `cus_` | Customer (multi-tenant platform mode) | | `csl_` | Customer setup link | | `key_` | API key | | `lbl_` | Label | | `key_` | API key | | `req_` | Request id (response envelope + `X-Request-Id` header) | | `del_` | Delivery (generic) | There is no kirim-prefixed id for WhatsApp accounts or users. Accounts are addressed by Meta’s digit-only `phone_number_id`; conversation assignees carry a raw internal user nanoid (no prefix). Format ------ [Section titled “Format”](https://docs.kirimdev.com/concepts/resource-ids/#format) * **Length**: 4 (prefix) + 1 (`_`) + 26 (id body) = 31 characters total for most resources. `tmpl_*` is 32 chars (5-char prefix). * **Alphabet**: Crockford base32 (`0-9` and `A-Z` minus `I L O U`). Always uppercase in the id body. * **URL-safe**: No characters require percent-encoding. Stability commitments --------------------- [Section titled “Stability commitments”](https://docs.kirimdev.com/concepts/resource-ids/#stability-commitments) * **Permanent.** Once Kirimdev hands you an id, that id refers to that exact resource for as long as the resource exists. Hard deletes remove the row entirely, but the id is never reused for a new row. * **Opaque.** The body of the id encodes no public meaning. Do not parse, decode, or sort by it. Order resources by `created_at` (always returned alongside). * **Globally unique within Kirimdev.** No two resources share an id, even across organisations. * **Tenant-scoped retrieval.** Every endpoint that takes an id enforces that the resource belongs to the caller’s organisation. A cross-org id returns `404 resource_not_found` — never `403`, to avoid leaking existence. `phone_number_id` ----------------- [Section titled “phone\_number\_id”](https://docs.kirimdev.com/concepts/resource-ids/#phone_number_id) The `phone_number_id` is the WhatsApp Business phone number’s identifier as assigned by Meta. It’s a different beast from Kirimdev’s prefixed ids and appears in **every path-scoped endpoint**. GET /v1/106540352242922/messagesPOST /v1/106540352242922/messagesGET /v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWXGET /v1/106540352242922/conversationsGET /v1/106540352242922/templates ### Properties [Section titled “Properties”](https://docs.kirimdev.com/concepts/resource-ids/#properties) | Property | Value | | --- | --- | | Format | Digits only, typically 15–17 characters | | Issuer | Meta (WhatsApp Business Platform) | | Stability | Permanent for the lifetime of the phone number | | Position | URL path segment, never request body | | Discovery | `GET /v1/accounts` exposes it as the `phone_number_id` field on each connected account | ### Example [Section titled “Example”](https://docs.kirimdev.com/concepts/resource-ids/#example) // GET /v1/accounts → 200{ "data": [ { "object": "account", "phone_number": "+628111222333", "phone_number_id": "106540352242922", "name": "Acme Inc", "status": "connected" } ], "has_more": false, "next_cursor": null} Accounts are addressed by `phone_number_id` (Meta’s WhatsApp Business phone number id) in path segments like `/v1/{phone_number_id}/messages`. They do not carry a kirim-prefixed resource id of their own. Pluck `phone_number_id` from there and use it as the path segment for every message, conversation, contact, and template operation against that line. What about internal IDs? ------------------------ [Section titled “What about internal IDs?”](https://docs.kirimdev.com/concepts/resource-ids/#what-about-internal-ids) Internally Kirimdev uses 12-character nanoids as primary keys. The public id (`msg_…`) is stored on a separate column (`external_id`) and is the only id form ever returned through the API. If you see a shorter id-shaped string somewhere in a payload (e.g. `assigned_to` on conversations), it’s the internal user id — the only resource without a prefixed `external_id` contract today. Anti-patterns ------------- [Section titled “Anti-patterns”](https://docs.kirimdev.com/concepts/resource-ids/#anti-patterns) * **Don’t sort by id.** Crockford base32 is lexicographic but the id body is not strictly time-monotonic across all resources. Sort by `created_at` instead. * **Don’t substring-match prefixes for routing.** Use the resource type implied by the endpoint, not the id prefix on the wire. * **Don’t store IDs you didn’t get from Kirimdev.** Generated ids (yours or anyone else’s) won’t match the storage format and will fail validation with `400 invalid_field_value`. * **Don’t hardcode a `phone_number_id` in source.** Fetch it from `/v1/accounts` at startup or load it from config. Reconnecting a phone number issues a new id. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/concepts/resource-ids/#whats-next) List accounts Discover the `phone_number_id` for every connected line. [API →](https://docs.kirimdev.com/api/operations/accounts/get/) Send a message The most common path-scoped endpoint. [API →](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) Pagination How `created_at`\-ordered lists page through resources. [Read →](https://docs.kirimdev.com/concepts/pagination/) Errors `invalid_phone_number` and `resource_not_found` envelopes. [Read →](https://docs.kirimdev.com/concepts/errors/) --- # Message Retention | Kirimdev [Skip to content](https://docs.kirimdev.com/concepts/message-retention/#_top) Concepts Message Retention ================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fmessage-retention%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fconcepts%2Fmessage-retention%2F%20and%20help%20me%20with%20the%20following%3A%20) Your plan defines how long Kirimdev stores message history. Messages older than that window are **permanently deleted**, together with the media files Kirimdev downloaded on their behalf. This is not an archive tier or a visibility filter. The rows are removed. There is no endpoint to restore them and upgrading to a longer window does not bring back messages already deleted. The window ---------- [Section titled “The window”](https://docs.kirimdev.com/concepts/message-retention/#the-window) | Plan | History retained | | --- | --- | | Starter | 90 days | | Pro | 365 days | | Business | 365 days | The authoritative value for your organization is the `quota.history_retention_days` entitlement. Read it rather than hard-coding a number — plans change, and your account may be on a custom value. A value of `-1` means unlimited: nothing is ever deleted. What gets deleted ----------------- [Section titled “What gets deleted”](https://docs.kirimdev.com/concepts/message-retention/#what-gets-deleted) A message becomes eligible once its `created_at` is older than the window. When it is removed, so is: * the message record itself, and with it its content, status, timestamps and delivery metadata * **inbound media** Kirimdev downloaded from WhatsApp for that message — the file behind `media_url` stops resolving * any AI agent run recorded against that message What survives ------------- [Section titled “What survives”](https://docs.kirimdev.com/concepts/message-retention/#what-survives) Deletion is scoped to messages. It does not cascade upward or sideways: * **Contacts** — names, phone numbers, custom fields, labels, notes * **Conversations** — the thread itself remains, with its assignment, labels, status and last-activity timestamp. A conversation is one phone number and it stays; only its old messages go. * **Media Library** — files you uploaded through the dashboard or API have their own lifecycle and count against your storage quota. They are never removed by retention, even when a message that used them is. * **Broadcast campaigns** — campaign records and their per-recipient rows * Deals, pipelines, contact activity, and every other CRM record Effect on the API ----------------- [Section titled “Effect on the API”](https://docs.kirimdev.com/concepts/message-retention/#effect-on-the-api) `GET` endpoints that read message history return only what is still stored. A request for a range older than your window comes back empty or partial — this is a successful response, not an error, and it is indistinguishable from a period in which you genuinely sent nothing. If your integration reconciles against Kirimdev as a source of truth, treat the retention window as the horizon and store anything you need beyond it on your side. Webhook payloads are unaffected. They are delivered when the event happens, long before any message reaches the window. Keeping data longer ------------------- [Section titled “Keeping data longer”](https://docs.kirimdev.com/concepts/message-retention/#keeping-data-longer) Retention is not configurable per-request. If you need history beyond your plan’s window: * **Export as you go.** Subscribe to `message.received` and `message.sent` webhooks and persist what you need in your own system. This is the most reliable approach — you capture the message at the moment it happens rather than racing a deletion. * **Mirror media you care about.** `media_url` points at storage Kirimdev manages and stops resolving once the message is deleted. Download and re-host anything you need to keep. * **Move to a longer plan** before the data ages out. Upgrading extends the window from that point forward; it cannot recover what has already gone. Analytics --------- [Section titled “Analytics”](https://docs.kirimdev.com/concepts/message-retention/#analytics) Aggregate metrics — message volume, delivery funnel, per-template performance — remain available for periods whose messages have been deleted. Kirimdev captures daily counters before deletion, so charts do not go blank when history ages out. Metrics that pair two specific messages, such as response times, are the exception. They cannot be reconstructed from counters and are reported only for the period still covered by your retention window. --- # Jendela 24 jam & template (FAQ) | Kirimdev [Skip to content](https://docs.kirimdev.com/guides/24h-window-and-templates/#_top) Guides Jendela 24 jam & template (FAQ) =============================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2F24h-window-and-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2F24h-window-and-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) WhatsApp membagi pesan keluar menjadi dua mode: **free-form** (pesan biasa saat jendela percakapan masih terbuka) dan **template** (struktur yang harus disetujui Meta terlebih dahulu). Sebagian besar pertanyaan berulang di support pada akhirnya tentang perbedaan ini. Halaman ini FAQ singkat — bagikan link ini saat rekan atau pelanggan bertanya lagi. Apa itu jendela 24 jam? ----------------------- [Section titled “Apa itu jendela 24 jam?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#apa-itu-jendela-24-jam) Meta menyebutnya **customer service window** (kadang disebut “sesi 24 jam” atau “conversation window”). Ini timer **24 jam bergulir** yang **hanya** dimulai saat **pelanggan mengirim pesan masuk** ke nomor WhatsApp Anda — **bukan** saat Anda mengirim template keluar. Saat jendela **terbuka**: * Anda boleh kirim pesan **free-form**: `text`, `image`, `video`, `audio`, `document`, dan sebagian besar tipe **interaktif** (tombol, list, reply button, dll.). * Setiap **pesan masuk baru dari pelanggan** **memperpanjang** timer — jendela tetap terbuka 24 jam lagi sejak pesan itu. Saat jendela **tertutup** (tidak ada pesan pelanggan dalam 24 jam terakhir): * Meta **menolak kiriman free-form** dengan error **`131047`** (Re-engagement message required). * Kirimdev menampilkan kode stabil **`outside_24h_window`** pada pesan gagal dan di webhook. Jendela dihitung **per nomor pelanggan + nomor WhatsApp Business Anda**, bukan global untuk seluruh akun. Bagaimana tahu jendela masih terbuka? ------------------------------------- [Section titled “Bagaimana tahu jendela masih terbuka?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#bagaimana-tahu-jendela-masih-terbuka) | Tempat | Yang perlu dicek | | --- | --- | | **Dashboard Kirimdev (Inbox)** | Buka percakapan. Header chat menampilkan **countdown** saat jendela terbuka, atau badge **“24h closed”** jika sudah tertutup. Composer nonaktif untuk kiriman free-form saat tertutup. | | **Public API** | `GET /v1/{phone_number_id}/conversations/{id}` memuat `last_inbound_at`. Jika timestamp itu **kurang dari 24 jam yang lalu**, jendela terbuka. Kirimdev tidak mengekspos boolean terpisah — hitung dari `last_inbound_at` atau tunggu Meta menerima/menolak kiriman. | | **Setelah kiriman gagal** | Status pesan `failed` dengan `error.code: "outside_24h_window"` (Meta `provider_code: 131047`). Lihat [Menangani kiriman gagal](https://docs.kirimdev.com/guides/failed-sends/)
. | Apa yang boleh dikirim saat jendela terbuka vs tertutup? -------------------------------------------------------- [Section titled “Apa yang boleh dikirim saat jendela terbuka vs tertutup?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#apa-yang-boleh-dikirim-saat-jendela-terbuka-vs-tertutup) | Jendela | Tipe pesan yang diizinkan | Contoh | | --- | --- | --- | | **Terbuka** (pelanggan chat dalam 24 jam) | Free-form: teks, media, interaktif, voice note | Balasan support, update pesanan sebagai teks biasa, quick-reply button | | **Tertutup** | **Hanya template** (`type: "template"`) | “Pesanan Anda dikirim”, OTP, promo re-engagement, outreach pertama | Setelah Anda kirim template, jendela **masih tertutup** sampai pelanggan **membalas**. Jangan langsung lanjut dengan teks free-form — tunggu pesan masuk dulu (atau cek `last_inbound_at` / badge di Inbox). Mengirim teks free-form saat jendela tertutup **tidak** masuk antrean diam-diam — Meta menolak dan pesan berstatus **`failed`** dengan `outside_24h_window`. Jangan retry payload yang sama; ganti ke template. Apa itu message template? ------------------------- [Section titled “Apa itu message template?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#apa-itu-message-template) **Template** adalah **struktur pesan yang didaftarkan dan disetujui Meta** sebelum bisa dikirim di luar jendela 24 jam (atau sebagai pesan pertama ke kontak baru). Template berisi: * **Header** tetap (opsional — teks, gambar, video, dokumen) * **Body** berparameter (`{{1}}`, `{{2}}`, atau named params) * **Footer** (opsional, statis) * **Tombol** (opsional — URL, quick reply, copy code, Flow) Saat mengirim, Anda pilih **`name`** + **`language`** template lalu isi **parameter** runtime. Kirimdev meneruskan payload ke Meta apa adanya. **Template bukan fitur tambahan** — ini **satu-satunya** cara mengirim pesan saat jendela tertutup. Template **tidak** membuka jendela; hanya **balasan pelanggan** yang membukanya. Setelah 24 jam tanpa balasan, Anda kirim template lagi (cara standar untuk notifikasi transaksional seperti update pengiriman). Bagaimana cara template disetujui? ---------------------------------- [Section titled “Bagaimana cara template disetujui?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#bagaimana-cara-template-disetujui) 1. **Buat** template di **Meta WhatsApp Manager**, dashboard Kirimdev, atau lewat **`POST /v1/{phone_number_id}/templates`** (lihat [Create templates](https://docs.kirimdev.com/sending/create-templates/) atau [Changelog create template](https://docs.kirimdev.com/changelog/2026-06-14-create-template/) ). 2. Meta **mereview** (menit hingga 48 jam; kategori marketing bisa lebih lama). 3. Status menjadi **`approved`** — baru bisa dikirim. Daftar template lewat `GET /v1/{phone_number_id}/templates`. Sebelum status `approved`, kiriman gagal dengan error terkait template (`template_not_found`, yang juga mencakup Meta `132001`). Kirim template Contoh payload untuk body saja dan komponen lanjutan. → [Kirim template](https://docs.kirimdev.com/sending/send-templates/) Buat lewat API Submit programatik + header gambar via URL publik. → [Create templates](https://docs.kirimdev.com/sending/create-templates/) Broadcast skala besar Template sama, banyak penerima — tier limit berlaku. → [Resep broadcast](https://docs.kirimdev.com/recipes/broadcast-campaign/) FAQ — skenario umum ------------------- [Section titled “FAQ — skenario umum”](https://docs.kirimdev.com/guides/24h-window-and-templates/#faq--skenario-umum) ### Saya sudah kirim template. Kenapa teks free-form masih gagal? [Section titled “Saya sudah kirim template. Kenapa teks free-form masih gagal?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#saya-sudah-kirim-template-kenapa-teks-free-form-masih-gagal) **Karena pelanggan belum membalas.** Template keluar **tidak** membuka jendela 24 jam — hanya **pesan masuk dari pelanggan** yang membukanya. Setelah template terkirim, jendela tetap **tertutup** sampai mereka reply (tap quick reply, ketik balasan, dll.). Baru setelah itu Anda bisa kirim `text` / media / interaktif selama 24 jam ke depan. Di dashboard: badge **“24h closed”** dan composer nonaktif = belum ada balasan. Di API: `last_inbound_at` belum berubah / masih lebih dari 24 jam. ### Pelanggan membalas kemarin. Boleh kirim teks biasa hari ini? [Section titled “Pelanggan membalas kemarin. Boleh kirim teks biasa hari ini?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#pelanggan-membalas-kemarin-boleh-kirim-teks-biasa-hari-ini) **Boleh**, jika **pesan masuk terakhir** mereka kurang dari 24 jam yang lalu. Jika sudah lebih dari 24 jam, pakai template — meskipun minggu lalu Anda sempat chat panjang. ### Saya sudah kirim template. Bisa langsung kirim teks free-form? [Section titled “Saya sudah kirim template. Bisa langsung kirim teks free-form?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#saya-sudah-kirim-template-bisa-langsung-kirim-teks-free-form) **Tidak.** Lihat jawaban di atas — **wajib tunggu balasan pelanggan** dulu. Mengirim template lalu langsung `type: "text"` akan gagal dengan `outside_24h_window` jika belum ada inbound baru. ### Pesan pertama ke kontak baru — template atau teks? [Section titled “Pesan pertama ke kontak baru — template atau teks?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#pesan-pertama-ke-kontak-baru--template-atau-teks) **Template** (kecuali pelanggan chat duluan). Cold outreach dengan `type: "text"` gagal dengan `outside_24h_window` atau tidak pernah masuk jendela terbuka karena `last_inbound_at` masih null. ### Kenapa teks di dashboard berhasil tapi API dapat 131047? [Section titled “Kenapa teks di dashboard berhasil tapi API dapat 131047?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#kenapa-teks-di-dashboard-berhasil-tapi-api-dapat-131047) Aturan sama di semua tempat. Penyebab umum: * Anda uji di percakapan yang **jendelanya masih terbuka** di dashboard, tapi integrasi API menarget **kontak berbeda** atau **thread lama** dengan `last_inbound_at` yang sudah kedaluwarsa. * Selisih jam jarang jadi masalah; jendela berdasarkan **timestamp server** pada webhook inbound. Bandingkan `last_inbound_at` pada conversation id yang **persis** Anda kirimi. ### Apakah template sama dengan broadcast? [Section titled “Apakah template sama dengan broadcast?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#apakah-template-sama-dengan-broadcast) **Tidak.** **Template** adalah **format pesan** yang disetujui WhatsApp. **Broadcast** (di dashboard Kirimdev) adalah **kampanye** yang mengirim template yang sudah disetujui ke banyak penerima sekaligus. Lihat [Lihat panduan Broadcast](https://docs.kirimdev.com/recipes/broadcast-campaign/) . ### Marketing vs utility template — apakah beda? [Section titled “Marketing vs utility template — apakah beda?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#marketing-vs-utility-template--apakah-beda) **Ya, untuk kebijakan dan billing.** Meta menetapkan kategori (mis. **marketing**, **utility**, **authentication**). Template marketing review lebih ketat dan bisa wajib **opt-in** penerima; Kirimdev bisa mengembalikan `marketing_opted_out` jika kontak opt-out. Template utility / transaksional (update pesanan, reminder janji) cocok untuk alur pasca-pembelian. Pilih kategori jujur di WhatsApp Manager — template salah kategori bisa ditolak atau di-pause. ### Apakah template berbayar? [Section titled “Apakah template berbayar?”](https://docs.kirimdev.com/guides/24h-window-and-templates/#apakah-template-berbayar) **Meta menagih WABA Anda** sesuai aturan percakapan / template — bukan Kirimdev. Anda perlu **metode pembayaran** valid di Meta Business Suite. Lihat [Setup pembayaran WhatsApp Business](https://docs.kirimdev.com/guides/whatsapp-business-payment/) . ### Kiriman gagal dengan `template_param_mismatch` [Section titled “Kiriman gagal dengan template\_param\_mismatch”](https://docs.kirimdev.com/guides/24h-window-and-templates/#kiriman-gagal-dengan-template_param_mismatch) **Jumlah** parameter tidak cocok dengan template yang disetujui (mis. template punya `{{1}}` dan `{{2}}` tapi Anda kirim satu parameter). Jika yang salah adalah **format nilai** parameter (mata uang, tanggal, dsb.), kodenya `template_param_format_mismatch`. Ambil definisi template lewat `GET /v1/{phone_number_id}/templates/{name}` dan samakan strukturnya. Ini **bug di sisi pemanggil** — perbaiki parameter sebelum retry. ### Kiriman gagal dengan `template_not_found` / `132001` [Section titled “Kiriman gagal dengan template\_not\_found / 132001”](https://docs.kirimdev.com/guides/24h-window-and-templates/#kiriman-gagal-dengan-template_not_found--132001) Biasanya **kode bahasa salah** (`id` vs `id_ID`) atau template belum **approved** untuk nama tersebut. Daftar bahasa yang disetujui lewat `GET /v1/{phone_number_id}/templates`. Cheat sheet kode error ---------------------- [Section titled “Cheat sheet kode error”](https://docs.kirimdev.com/guides/24h-window-and-templates/#cheat-sheet-kode-error) | Gejala | Kirimdev `error.code` | Meta `provider_code` | Solusi | | --- | --- | --- | --- | | Free-form setelah 24 jam tanpa balasan (atau setelah template tanpa balasan) | `outside_24h_window` | `131047` | Kirim template jika perlu; **tunggu pelanggan balas** — baru free-form OK | | Template belum approved / bahasa salah | `template_not_found` | `132001` | Cek `GET .../templates`; pakai name + language yang approved | | Jumlah parameter salah | `template_param_mismatch` | bervariasi | Samakan jumlah komponen template | | Format nilai parameter salah | `template_param_format_mismatch` | bervariasi | Perbaiki format (mata uang, tanggal, dsb.) | | Billing Meta belum disetup | kegagalan terkait billing | bervariasi | [Setup pembayaran](https://docs.kirimdev.com/guides/whatsapp-business-payment/) | Katalog async lengkap: [Menangani kiriman gagal](https://docs.kirimdev.com/guides/failed-sends/) dan [Errors](https://docs.kirimdev.com/concepts/errors/) . Alur yang disarankan (integrasi) -------------------------------- [Section titled “Alur yang disarankan (integrasi)”](https://docs.kirimdev.com/guides/24h-window-and-templates/#alur-yang-disarankan-integrasi) Ada pesan masuk pelanggan? ──ya──► Jendela terbuka 24 jam ──► free-form OK │ tidak (atau >24 jam sejak inbound terakhir) │ ▼Kirim template approved ──► (jendela MASIH tertutup) ──► pelanggan balas ──► jendela terbuka ──► free-form OK import { Kirim, KirimError } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) try { await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'text', text: { body: 'Pesanan Anda sudah dikirim.' }, })} catch (err) { if (err instanceof KirimError && err.code === 'outside_24h_window') { await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'template', template: { name: 'order_shipped', language: 'id', components: [ { type: 'body', parameters: [{ type: 'text', text: 'Andi' }], }, ], }, }) } else { throw err }} Dokumen terkait --------------- [Section titled “Dokumen terkait”](https://docs.kirimdev.com/guides/24h-window-and-templates/#dokumen-terkait) * [Kirim teks](https://docs.kirimdev.com/sending/send-text/) — pesan free-form (jendela harus terbuka) * [Kirim template](https://docs.kirimdev.com/sending/send-templates/) — referensi payload template * [Kirim OTP](https://docs.kirimdev.com/sending/send-template-otp/) — template AUTHENTICATION + tombol `url` * [Menangani kiriman gagal](https://docs.kirimdev.com/guides/failed-sends/) — matriks retry untuk `outside_24h_window` * [Resep order shipped](https://docs.kirimdev.com/recipes/order-notifications/) — contoh template end-to-end * [API — Daftar template](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/) [Kirim template](https://docs.kirimdev.com/sending/send-templates/) [Panduan kiriman gagal](https://docs.kirimdev.com/guides/failed-sends/) --- # Subscribe to Webhooks | Kirimdev [Skip to content](https://docs.kirimdev.com/guides/webhooks/#_top) Guides Subscribe to Webhooks ===================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Fwebhooks%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Fwebhooks%2F%20and%20help%20me%20with%20the%20following%3A%20) Webhooks are how Kirimdev pushes things at you in real time — inbound WhatsApp messages, delivery status callbacks, conversation assignments, contact changes. By the end of this guide you will have a working endpoint that subscribes to the events you care about, verifies their signatures, and deduplicates retries. Prerequisites ------------- [Section titled “Prerequisites”](https://docs.kirimdev.com/guides/webhooks/#prerequisites) * A Kirimdev API key (`kdv_live_...`). * A **publicly reachable HTTPS endpoint** for Kirimdev to POST to. Plain HTTP is rejected at subscription time. For local development, expose your dev server via `ngrok`, `cloudflared tunnel`, or similar: # Pick one:ngrok http 3000cloudflared tunnel --url http://localhost:3000 Then use the generated `https://*.ngrok-free.app` URL. * An endpoint that: * Accepts `POST application/json`. * Responds within **10 seconds** (per-attempt timeout). * Returns any `2xx` for success. Anything else (3xx, 4xx except `408` / `429`, or 5xx) marks the delivery as failed and triggers a retry. 1. **Pick your events.** Subscribe only to what you actually handle — every extra event is a request you have to ack. The most common starter set: | Event | Use case | | --- | --- | | `message.received` | Inbound WhatsApp messages from customers. | | `message.sent` | Full outbound message body after Meta accepts the send. | | `message.status` | Outbound delivery callbacks (`sent` → `delivered` → `read`) and failures. | | `conversation.assigned` | Sync conversation ownership into your CRM / inbox. | | `conversation.closed` | Trigger post-resolution flows (NPS, CSAT, ticket close). | | `contact.created` | New WhatsApp contact appeared — sync to CRM. | | `contact.updated` | Existing contact’s name, email, or metadata changed. | Browse the full list in the [Event Catalog](https://docs.kirimdev.com/webhooks/events/) . 2. **Create the subscription.** Webhook subscriptions are **organization-level** — one subscription receives events across all your connected phone numbers. There is no `phone_number_id` in the path. * [cURL](https://docs.kirimdev.com/guides/webhooks/#tab-panel-63) * [TypeScript SDK](https://docs.kirimdev.com/guides/webhooks/#tab-panel-64) * [Python](https://docs.kirimdev.com/guides/webhooks/#tab-panel-65) curl -sS https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/kirim", "events": [ "message.received", "message.status", "conversation.assigned", "conversation.closed", "contact.created", "contact.updated" ], "description": "Production handler" }' import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) const sub = await kirim.webhookSubscriptions.create({ url: 'https://your-app.example.com/webhooks/kirim', events: [ 'message.received', 'message.status', 'conversation.assigned', 'conversation.closed', 'contact.created', 'contact.updated', ], description: 'Production handler',}) console.log(sub.id, sub.initial_secret) import os, httpx r = httpx.post( "https://api.kirimdev.com/v1/webhook_subscriptions", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}, json={ "url": "https://your-app.example.com/webhooks/kirim", "events": [ "message.received", "message.status", "conversation.assigned", "conversation.closed", "contact.created", "contact.updated", ], "description": "Production handler", },)r.raise_for_status()print(r.json()["data"]["id"], r.json()["data"]["initial_secret"]) Response: { "data": { "id": "wbs_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_subscription", "url": "https://your-app.example.com/webhooks/kirim", "status": "active", "events": ["message.received", "message.status", "..."], "secrets": [ { "id": "sec_01HXYZABCDEFGHJKMNPQRSTVWX", "created_at": "2026-05-23T10:00:00Z", "expires_at": null } ], "initial_secret": "whsec_…" }, "request_id": "req_…"} 3. **Store the `initial_secret` immediately.** Kirimdev returns `initial_secret` **once**, on creation, and never again. Drop it straight into your secrets manager (AWS Secrets Manager, Doppler, 1Password, `.env.local` for dev — wherever your app reads runtime config from). 4. **Verify the signature on every request.** Kirimdev signs every webhook delivery with HMAC-SHA256 over the raw request body. Reject any request where the signature doesn’t match — that’s how you know it actually came from Kirimdev and not a spoofer who guessed your URL. // Express example — note the raw body middleware.import crypto from 'node:crypto'import express from 'express' const app = express()const secret = process.env.KIRIM_WEBHOOK_SECRET! function verify(rawBody: string, signature: string): boolean { const expected = crypto .createHmac('sha256', secret) .update(rawBody) .digest('hex') return crypto.timingSafeEqual( Buffer.from(expected, 'hex'), Buffer.from(signature, 'hex'), )} app.post( '/webhooks/kirim', express.raw({ type: 'application/json' }), (req, res) => { const sig = req.header('x-kirim-signature') ?? '' if (!verify(req.body.toString('utf8'), sig)) { return res.status(401).send('invalid signature') } // ... proceed to step 5 ... },) The TypeScript SDK ships a helper: import { verifyWebhookSignature, InvalidSignatureError,} from '@kirimdev/sdk/webhooks' try { const event = await verifyWebhookSignature({ rawBody, signatureHeader: req.headers['x-kirim-signature'] as string, secrets: [process.env.KIRIM_WEBHOOK_SECRET!], }) // event = parsed JSON body. Branch on the X-Kirim-Event header // to decide whether it's a Meta passthrough or Kirimdev envelope.} catch (err) { if (err instanceof InvalidSignatureError) { return res.status(401).send('bad sig') } throw err} For full recipes (Python, Go, Ruby, multiple active secrets, timestamp validation), see [Verifying Signatures](https://docs.kirimdev.com/webhooks/signing/) . 5. **Deduplicate on `X-Kirim-Event-Id`.** Kirimdev delivers at-least-once. The same event may arrive twice if your handler processed it but the response didn’t reach Kirimdev before the 10-second timeout. Use the header as your dedup key: const eventId = req.header('x-kirim-event-id')!const fresh = await redis.set( `webhook:event:${eventId}`, '1', 'EX', 604800, // 7 days — covers Kirimdev's full retry budget 'NX',)if (!fresh) { return res.status(200).send('duplicate-ack')} If your stack doesn’t have Redis handy, a unique index on an `events_seen(event_id)` table works equally well. 6. **Handle the event.** Every Kirimdev webhook payload includes a `type` field. Branch on it: app.post( '/webhooks/kirim', express.raw({ type: 'application/json' }), async (req, res) => { // signature verification + dedup, as above ... const event = JSON.parse(req.body.toString('utf8')) switch (event.type) { case 'message.received': await onInboundMessage(event.data) break case 'message.status': await onStatusUpdate(event.data) break case 'conversation.assigned': await onConversationAssigned(event.data) break case 'conversation.closed': await onConversationClosed(event.data) break case 'contact.created': case 'contact.updated': await syncContactToCrm(event.data) break default: console.warn('Unhandled event type:', event.type) } res.status(200).send('ok') },) For event payload shapes, see the [Event Catalog](https://docs.kirimdev.com/webhooks/events/) and [Payload Examples](https://docs.kirimdev.com/webhooks/payloads/) . 7. **Test the round-trip locally.** With ngrok / cloudflared running, send a test message to your connected WhatsApp number from your phone. You should see your endpoint receive a `message.received` event within a second or two. No event? Check the **Developers → Webhook Deliveries** page in the Kirimdev dashboard, or list recent deliveries via the API: curl -sS "https://api.kirimdev.com/v1/webhook_deliveries?subscription_id=wbs_…&limit=10" \ -H "Authorization: Bearer $KIRIM_KEY" The `response_status_code` and `response_body` on each delivery tell you exactly how your endpoint replied. Common pitfalls --------------- [Section titled “Common pitfalls”](https://docs.kirimdev.com/guides/webhooks/#common-pitfalls) Rotating secrets ---------------- [Section titled “Rotating secrets”](https://docs.kirimdev.com/guides/webhooks/#rotating-secrets) A leaked secret should be rotatable in minutes without downtime: 1. **Create a new secret.** `POST /v1/webhook_subscriptions/{id}/secrets` returns a fresh plaintext. Kirimdev now signs every delivery with _both_ secrets (legacy and new) for the overlap window. 2. **Add the new secret to your verifier.** Update your secrets manager, redeploy. Your verifier now accepts either signature. 3. **Confirm new signatures verify.** Watch a few deliveries through the dashboard. 4. **Delete the old secret.** `DELETE /v1/webhook_subscriptions/{id}/secrets/{old_id}`. Kirimdev stops signing with it on the next event. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/guides/webhooks/#whats-next) Verify signatures Language-specific HMAC recipes, multi-secret verification, timing attacks. [Read the concept →](https://docs.kirimdev.com/webhooks/signing/) Event catalog Every event type, when it fires, and its payload shape. [Read the reference →](https://docs.kirimdev.com/webhooks/events/) Payload examples Copy-pasteable fixtures for every event — useful for tests. [Read the reference →](https://docs.kirimdev.com/webhooks/payloads/) Retries & auto-disable Backoff schedule, dead-letter queue, replay APIs. [Read the concept →](https://docs.kirimdev.com/webhooks/retry/) --- # Handle Failed Sends | Kirimdev [Skip to content](https://docs.kirimdev.com/guides/failed-sends/#_top) Guides Handle Failed Sends =================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Ffailed-sends%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Ffailed-sends%2F%20and%20help%20me%20with%20the%20following%3A%20) Sending a WhatsApp message has two failure surfaces, and confusing them is the most common integration mistake. This guide separates them, catalogues the stable error codes you can branch on, and walks through a production-ready handler. Two kinds of failure -------------------- [Section titled “Two kinds of failure”](https://docs.kirimdev.com/guides/failed-sends/#two-kinds-of-failure) | Surface | When | What to do | | --- | --- | --- | | **HTTP-level** | `POST /v1/{phone_number_id}/messages` returns `4xx` or `5xx`. | Caller bug or transient. Fix the request shape, then retry. Nothing was queued. | | **Async delivery** | The POST returned `200` with `status: "pending"`, but Meta later rejects it. The message ends up `status: "failed"` with an `error` object. | Branch on `error.code` and pick a retry or fallback strategy. | The async failure path is where things get interesting — Meta may take seconds to minutes to reject a send after Kirimdev has already returned a success response to you. HTTP-level failures ------------------- [Section titled “HTTP-level failures”](https://docs.kirimdev.com/guides/failed-sends/#http-level-failures) These are synchronous. Examples: | HTTP | Code | Meaning | Fix | | --- | --- | --- | --- | | `400` | `invalid_field_value` | Malformed body, bad query/path param, or a field that failed schema validation. | Validate the request shape against the API reference; the `message` names the offending field. | | `401` | `invalid_api_key` | API key revoked, malformed, or wrong env. | Re-issue a key in the dashboard; check `kdv_live_` vs `kdv_test_`. | | `404` | `resource_not_found` | The `{phone_number_id}` doesn’t exist **or** belongs to another organization. | Verify the id belongs to your org via `GET /v1/accounts`. The response is identical for “unknown” and “not yours” — this is deliberate, so callers cannot probe for other tenants’ ids. | | `409` | `idempotency_in_progress` | An identical request with the same `Idempotency-Key` is still being processed. | Wait and retry; the first request is finishing. | | `422` | `idempotency_key_reuse` | Same `Idempotency-Key` sent with a **different** body. | Generate a fresh key for genuinely new requests. | | `422` | `whatsapp_number_not_verified` | The account resolved, but it is not in a `connected` state (disconnected, error, connecting…). | Reconnect / finish verifying the number in the Kirimdev dashboard. | | `429` | `rate_limit_exceeded` | You exceeded your per-key write budget. | Back off using `Retry-After`; see [Rate limits](https://docs.kirimdev.com/concepts/rate-limits/)
. | | `5xx` | `internal_error` | Transient Kirimdev or Meta hiccup. | Retry with exponential backoff (with the same `Idempotency-Key`). | These never produce a `msg_…` id. There is nothing to track or follow up on — just fix the request and try again. Async delivery failures ----------------------- [Section titled “Async delivery failures”](https://docs.kirimdev.com/guides/failed-sends/#async-delivery-failures) When the POST returned `200` with `status: "pending"`, the message is in Kirimdev’s outbound queue. Meta acts on it asynchronously, and the result flows back to you in one of two ways: 1. **Webhook (preferred).** A `message.status` event arrives with `status: "failed"` and an `error` object. 2. **Polling.** `GET /v1/{phone_number_id}/messages/{id}` returns the same `error` object on the message resource. The `error` object shape: { "data": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "status": "failed", "error": { "code": "outside_24h_window", "message": "Conversation window closed; free-form text rejected.", "provider_code": 131047 } }} Always branch on `error.code`. The string is stable forever. The `provider_code` is Meta’s raw number — exposed for debugging only, don’t branch on it (Meta renumbers occasionally). Stable async error codes ------------------------ [Section titled “Stable async error codes”](https://docs.kirimdev.com/guides/failed-sends/#stable-async-error-codes) These are the codes you’ll see most often in production. The full catalogue lives in the [Errors concept](https://docs.kirimdev.com/concepts/errors/) page. | `error.code` | Meaning | Recommended action | | --- | --- | --- | | `outside_24h_window` | Free-form message sent after the 24-hour conversation window closed. | Re-engage via an approved template (`type: "template"`). Don’t retry the free-form send. See [24h window FAQ (ID)](https://docs.kirimdev.com/guides/24h-window-and-templates/)
. | | `template_not_found` | Template name / language does not exist or is not approved for this WABA. | Resubmit the template in WhatsApp Manager and wait for approval; pick a different approved template meanwhile. | | `template_param_mismatch` | Parameter **count** doesn’t match the approved template’s shape. | Validate against `GET /v1/{phone_number_id}/templates/{name}` before sending. Caller bug — never retry as-is. | | `template_param_format_mismatch` | A parameter **value** violates the template’s expected format (currency, date, etc.). | Fix the parameter shape, then retry with a fresh `Idempotency-Key`. | | `recipient_unavailable` | WhatsApp could not deliver the message. The number may not be registered, the recipient may not have accepted the latest terms, or their WhatsApp version may be outdated. | Don’t retry automatically. Verify the number or contact the recipient through another channel. Retry only after the underlying issue has been corrected. | | Billing / payment method missing | Meta cannot charge the WABA for template or paid conversations. | Add and verify a Business payment method in Meta Business Suite — see [WhatsApp Business payment setup](https://docs.kirimdev.com/guides/whatsapp-business-payment/)
. | | `media_upload_failed` | WhatsApp could not fetch the media, or its `Content-Type` is not one it supports. | Images must return `image/jpeg` or `image/png` — WebP is sticker-only. Beware CDNs that auto-negotiate format (`auto=format` serves WebP). Then retry. | | `upstream_error` | Generic Meta error — transient or unclassified upstream issue. | Retry with exponential backoff. Kirimdev already retried before surfacing this. | | `account_in_maintenance` | The sender account is temporarily in maintenance mode at Meta. | Wait for the account to recover. Kirimdev retries automatically; you only see this when retries exhaust. | | `subscription_inactive` | Your **Kirimdev** subscription is expired, canceled, or past due. The send was refused before it reached Meta, so `provider_code` is `null`. | Settle the outstanding invoice in Billing, then retry. Waiting does not help — this is not a quota that resets. | Detect failures: webhooks vs polling ------------------------------------ [Section titled “Detect failures: webhooks vs polling”](https://docs.kirimdev.com/guides/failed-sends/#detect-failures-webhooks-vs-polling) ### Webhooks (preferred) [Section titled “Webhooks (preferred)”](https://docs.kirimdev.com/guides/failed-sends/#webhooks-preferred) Subscribe to `message.status` once and let Kirimdev push the failure to you. No polling, sub-second latency, no read quota burn: // Inside your webhook handler — after signature verification + dedup.if (event.type === 'message.status' && event.data.status === 'failed') { await handleFailedSend(event.data)} The `message.status` event payload mirrors `GET /v1/{phone_number_id}/messages/{id}`, so the same `handleFailedSend` function works for both code paths. See the [Webhooks Guide](https://docs.kirimdev.com/guides/webhooks/) for the full subscription flow. ### Polling [Section titled “Polling”](https://docs.kirimdev.com/guides/failed-sends/#polling) For quick scripts or batch jobs where webhooks aren’t worth the setup: * [cURL](https://docs.kirimdev.com/guides/failed-sends/#tab-panel-49) * [TypeScript SDK](https://docs.kirimdev.com/guides/failed-sends/#tab-panel-50) * [Python](https://docs.kirimdev.com/guides/failed-sends/#tab-panel-51) curl -sS "https://api.kirimdev.com/v1/$PHONE_ID/messages/msg_01HXYZ…" \ -H "Authorization: Bearer $KIRIM_KEY" const phone = kirim.phoneNumbers(process.env.PHONE_ID!)const msg = await phone.messages.retrieve('msg_01HXYZ…') if (msg.status === 'failed') { console.log('failed:', msg.error?.code, msg.error?.message)} import os, httpx r = httpx.get( f"https://api.kirimdev.com/v1/{os.environ['PHONE_ID']}/messages/msg_01HXYZ…", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"},)msg = r.json()["data"]if msg["status"] == "failed": print("failed:", msg["error"]["code"]) Polling burns read quota and adds latency. Use webhooks for anything production. Retry strategy by error code ---------------------------- [Section titled “Retry strategy by error code”](https://docs.kirimdev.com/guides/failed-sends/#retry-strategy-by-error-code) Not every failure deserves a retry, and the few that do need different strategies. The recipe below is what most integrations end up with: | `error.code` | Retry? | Strategy | | --- | --- | --- | | `outside_24h_window` | No (don’t retry the same text) | Switch to a template send to the same recipient. | | `template_not_found` | No | Pick a different approved template, or wait for approval. | | `template_param_mismatch` | No | Caller bug. Log + alert; fix the params before sending again. | | `template_param_format_mismatch` | After fixing | Correct the parameter value, then retry with a new `Idempotency-Key`. | | `recipient_unavailable` | After verification | Do not retry automatically. Verify the number and ask the recipient to update WhatsApp or accept the latest terms before trying again. | | `media_upload_failed` | After fixing | Serve `image/jpeg` or `image/png` from a public URL, then retry with a new `Idempotency-Key`. | | `upstream_error` | Yes | Exponential backoff (e.g. 30s, 2m, 10m, 1h). Cap at 3–5 attempts. | | `account_in_maintenance` | Delayed | Pause sends to that account; resume when its `status` returns to `connected`. | | `subscription_inactive` | After paying | Stop sending and alert an operator. Backoff will not clear it — every attempt fails identically until the invoice is settled. | Worked example: end-to-end handler ---------------------------------- [Section titled “Worked example: end-to-end handler”](https://docs.kirimdev.com/guides/failed-sends/#worked-example-end-to-end-handler) A realistic handler that branches by code, falls back to templates, flags unreachable contacts, and schedules retries: * [TypeScript SDK](https://docs.kirimdev.com/guides/failed-sends/#tab-panel-52) * [Python](https://docs.kirimdev.com/guides/failed-sends/#tab-panel-53) import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) type FailedMessage = { id: string to: string status: 'failed' error: { code: string; message: string; provider_code: number | null }} export async function handleFailedSend(msg: FailedMessage) { switch (msg.error.code) { case 'outside_24h_window': // Re-engage via an approved template instead. await phone.messages.send({ messaging_product: 'whatsapp', to: msg.to, type: 'template', template: { name: 'reengagement', language: { code: 'id_ID' }, }, }) return case 'recipient_unavailable': // Mark the contact unreachable; stop trying this number. await flagContactUnreachable(msg.to, msg.error.code) return case 'template_param_mismatch': case 'template_param_format_mismatch': case 'template_not_found': // Caller bug or template issue. Alert ops, don't retry. await alertOps('Template problem', { msgId: msg.id, code: msg.error.code }) return case 'media_upload_failed': // Usually a Content-Type problem, not connectivity: WhatsApp // takes image/jpeg and image/png only (WebP is sticker-only). console.error('media_upload_failed', { id: msg.id, message: msg.error.message }) return case 'upstream_error': // Transient — exponential backoff up to 5 attempts. await scheduleRetry(msg, { attempts: 5, baseMs: 30_000 }) return case 'account_in_maintenance': // Account-wide cooldown at Meta. Pause everything to this phone. await pauseAccount(process.env.PHONE_ID!) return default: // Unknown code — don't crash, log + surface. console.warn('Unrecognized error code', msg.error.code, msg.error.message) }} import os, httpx, logging log = logging.getLogger(__name__)PHONE_ID = os.environ["PHONE_ID"]BASE = "https://api.kirimdev.com/v1"HEADERS = {"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"} def send_template(to: str, name: str, language: str = "id_ID"): return httpx.post( f"{BASE}/{PHONE_ID}/messages", headers=HEADERS, json={ "messaging_product": "whatsapp", "to": to, "type": "template", "template": {"name": name, "language": {"code": language}}, }, ) def handle_failed_send(msg: dict): code = msg["error"]["code"] to = msg["to"] if code == "outside_24h_window": send_template(to, "reengagement") return if code == "recipient_unavailable": flag_contact_unreachable(to, code) return if code in { "template_param_mismatch", "template_param_format_mismatch", "template_not_found", }: alert_ops("Template problem", msg_id=msg["id"], code=code) return if code == "media_upload_failed": # Usually Content-Type, not connectivity: image/jpeg or # image/png only (WebP is sticker-only). log.error("media_upload_failed %s %s", msg["id"], msg["error"]["message"]) return if code == "upstream_error": schedule_retry(msg, attempts=5, base_seconds=30) return if code == "account_in_maintenance": pause_account(PHONE_ID) return log.warning("Unrecognized error code %s: %s", code, msg["error"]["message"]) What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/guides/failed-sends/#whats-next) Errors reference Full catalogue of error codes, response envelope shape, and fallback buckets. [Read the concept →](https://docs.kirimdev.com/concepts/errors/) Idempotency Safely retry without duplicating sends. [Read the concept →](https://docs.kirimdev.com/concepts/idempotency/) Rate limits Per-key budgets, `Retry-After` header, backoff guidance. [Read the concept →](https://docs.kirimdev.com/concepts/rate-limits/) Subscribe to webhooks React to `message.status` events instead of polling. [Read the guide →](https://docs.kirimdev.com/guides/webhooks/) --- # Retries & Auto-Disable | Kirimdev [Skip to content](https://docs.kirimdev.com/webhooks/retry/#_top) Webhooks Retries & Auto-Disable ====================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fretry%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fwebhooks%2Fretry%2F%20and%20help%20me%20with%20the%20following%3A%20) Kirimdev guarantees at-least-once delivery via an **8-attempt** retry pipeline with **exponential backoff and jitter**, spread across a ~24-hour total window. After the 8th attempt fails, the delivery is marked `failed` and parks in the dead-letter queue. After **20 consecutive failed deliveries on the same subscription**, the subscription is auto-disabled. Retry schedule -------------- [Section titled “Retry schedule”](https://docs.kirimdev.com/webhooks/retry/#retry-schedule) | Attempt | Delay before attempt | | --- | --- | | 1 | immediate | | 2 | 10 s | | 3 | 30 s | | 4 | 2 m | | 5 | 10 m | | 6 | 1 h | | 7 | 6 h | | 8 | 24 h | Each delay carries ±20% jitter to avoid thundering herds on shared infrastructure. Per-attempt HTTP timeout: **10 seconds**. After attempt 8 fails, the delivery row status flips to `failed` and sits in the dead-letter queue until you either: * Replay it via the API or dashboard (see [Replay](https://docs.kirimdev.com/webhooks/retry/#replaying-failed-deliveries) below), or * The daily purge removes it 30 days after creation. HTTP status semantics --------------------- [Section titled “HTTP status semantics”](https://docs.kirimdev.com/webhooks/retry/#http-status-semantics) | Response | Treated as | Retried? | `error_code` | | --- | --- | --- | --- | | 2xx (200, 201, 204, …) | success | — | `null` | | 3xx | permanent failure — Kirimdev does **not** follow redirects | **no** — `dead` on the first attempt | `http_error` | | 4xx (most) | permanent failure | **no** — `dead` on the first attempt | `http_error` | | 4xx `408` (request timeout) | transient failure | yes | `http_error` | | 4xx `429` (rate limited) | transient failure | yes | `http_error` | | 5xx | transient failure | yes | `http_error` | | DNS / TLS / connection refused / reset | transient failure | yes | `connection_error` | | No response within 10 s | transient failure | yes | `timeout` | The “most 4xx → dead immediately” rule reflects reality: a 401, 403, or 404 from your server almost always means a config bug (wrong URL, bad gateway auth) that retrying can’t fix. Fix the config, then [replay](https://docs.kirimdev.com/webhooks/retry/#replaying-failed-deliveries) . Redirects are deliberately not followed. The request signature is computed against the URL you registered; following a redirect would hand a valid signature to whatever host the redirect points at. Point the subscription at the final URL instead. Unresponsive endpoints ---------------------- [Section titled “Unresponsive endpoints”](https://docs.kirimdev.com/webhooks/retry/#unresponsive-endpoints) Delivery capacity is shared, so one endpoint that stops answering must not delay everyone else’s events. Two limits apply per endpoint host: * **At most 5 requests in flight.** Further deliveries to the same host wait a few seconds before their attempt starts. This does not use up an attempt. * **Fast failure after repeated timeouts.** After 5 timeouts or connection errors in a row, the host is treated as unresponsive for 30 seconds, doubling up to 5 minutes while it keeps failing. Attempts that come due in that window fail with `error_code: "connection_error"` and an `error_message` starting with `Not sent`, **without a request being made**, then follow the normal retry schedule above. One successful response ends the window. The 8-attempt limit, the retry schedule and auto-disable are unchanged. An endpoint that answers within a couple of seconds is never affected. Reading a failure ----------------- [Section titled “Reading a failure”](https://docs.kirimdev.com/webhooks/retry/#reading-a-failure) Three fields, in this order: 1. **`error_code`** — the failure class. Start here. 2. **`response_status`** — the HTTP status, when there was one. 3. **`response_body_snippet`** — the first 1 KB your endpoint returned. `response_status` and `response_body_snippet` contain **only** what your endpoint sent. When both are `null`, your endpoint never answered, and `error_code` tells you whether that was a timeout or a connection failure. Four `error_code` values mean the request never left Kirimdev, so there is nothing to debug on your side: | `error_code` | What to do | | --- | --- | | `subscription_inactive` | The subscription was `paused` or `disabled` when the attempt came due. Re-enable, then replay. | | `subscription_deleted` | The subscription was deleted before delivery. Recreate it if you still want the events. | | `ssrf_blocked` | The URL resolves to a private or internal address. Use a publicly routable host. | | `no_signing_secret` | Every signing secret expired. Rotate in a new one, then replay. | `error_message` carries a short human-readable detail (200 characters max) for whichever code applies. Recommended endpoint behaviour ------------------------------ [Section titled “Recommended endpoint behaviour”](https://docs.kirimdev.com/webhooks/retry/#recommended-endpoint-behaviour) * **Ack within 1-2 seconds.** Persist the raw payload (and the `X-Kirim-Event-Id`) inside a quick DB write, then return 200. Hand off heavy processing to your own queue. app.post('/webhooks/kirim', async (req, res) => { await persistRawEvent(req.headers['x-kirim-event-id'], req.body) res.status(200).send('ok') // Async processing kicks off via your own worker.}) * **Return 503 if you’re overloaded** rather than 200-then-drop. 503 triggers a retryable failure; you’ll get the same payload again after the backoff. * **Never return 2xx for a payload you couldn’t store.** Acking prematurely breaks the at-least-once contract on your side. Idempotency on your side ------------------------ [Section titled “Idempotency on your side”](https://docs.kirimdev.com/webhooks/retry/#idempotency-on-your-side) Because deliveries are at-least-once, the **same event can arrive more than once** — typically when a retry fires after your server processed the original but didn’t respond in time. Dedupe on the `X-Kirim-Event-Id` header. The same id always represents the same logical event, regardless of attempt number or whether the delivery is a manual replay. const fresh = await redis.set(`kirim:evt:${eventId}`, '1', { EX: 604800, NX: true })if (!fresh) return res.status(200).send('duplicate-ack') See [Overview → Dedupe](https://docs.kirimdev.com/webhooks/overview/#dedupe-by-x-kirim-event-id) for the full pattern. Auto-disable ------------ [Section titled “Auto-disable”](https://docs.kirimdev.com/webhooks/retry/#auto-disable) After **20 consecutive failed attempts on the same subscription**, Kirimdev flips the subscription to `status: 'disabled'`: { "id": "wbs_…", "object": "webhook_subscription", "status": "disabled", "disabled_reason": "auto_disabled_max_consecutive_failures", "consecutive_failures": 20, "last_disabled_at": "2026-07-24T08:14:33Z", "last_disabled_reason": "auto_disabled_max_consecutive_failures", "...": "..."} The counter tracks **attempts, not deliveries**. This matters more than it sounds: a single delivery can burn up to 8 attempts on its way through the retry ladder, so an endpoint that reliably times out can trip the 20-attempt threshold after as few as **three events**. Any successful delivery resets the counter to zero. `disabled_reason` describes the current state and is cleared when you re-enable the subscription. `last_disabled_at` and `last_disabled_reason` are history — they are never cleared, so you can still tell that a subscription was auto-disabled after recovering it, and line the outage window up against your own logs. While disabled, **no new events fan out to this subscription**. New events that would have been sent are simply not enqueued — they are not buffered for later delivery, because re-enabling would otherwise trigger a thundering herd. Deliveries whose retries were still scheduled when the subscription was disabled are terminated with `error_code: "subscription_inactive"`. They keep their real `attempt_count` and the last response your endpoint gave, and they remain replayable once you re-enable. Re-enabling ----------- [Section titled “Re-enabling”](https://docs.kirimdev.com/webhooks/retry/#re-enabling) Once your endpoint is healthy: * [cURL](https://docs.kirimdev.com/webhooks/retry/#tab-panel-173) * [TypeScript](https://docs.kirimdev.com/webhooks/retry/#tab-panel-174) * [Python](https://docs.kirimdev.com/webhooks/retry/#tab-panel-175) curl -X PATCH \ https://api.kirimdev.com/v1/webhook_subscriptions/wbs_… \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "status": "active" }' await kirim.webhookSubscriptions.update('wbs_…', { status: 'active',}) httpx.patch( "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_…", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}, json={"status": "active"},).raise_for_status() Re-enabling resets `consecutive_failures` to 0. Future deliveries resume immediately. **Replaying old failed deliveries is opt-in** — they don’t fire automatically, so a stale endpoint doesn’t drown itself the second it comes back online. Pausing manually ---------------- [Section titled “Pausing manually”](https://docs.kirimdev.com/webhooks/retry/#pausing-manually) To temporarily stop deliveries without losing the subscription (e.g. during a planned maintenance window): await kirim.webhookSubscriptions.update('wbs_…', { status: 'paused' }) Paused subscriptions don’t accumulate failed deliveries — Kirimdev drops events that would have fanned out to them. Resume with `{ status: 'active' }`. Replaying failed deliveries --------------------------- [Section titled “Replaying failed deliveries”](https://docs.kirimdev.com/webhooks/retry/#replaying-failed-deliveries) The dead-letter queue keeps failed deliveries for 30 days. Inspect, filter, and replay them once your endpoint is healthy again. ### List failed deliveries [Section titled “List failed deliveries”](https://docs.kirimdev.com/webhooks/retry/#list-failed-deliveries) * [cURL](https://docs.kirimdev.com/webhooks/retry/#tab-panel-176) * [TypeScript](https://docs.kirimdev.com/webhooks/retry/#tab-panel-177) * [Python](https://docs.kirimdev.com/webhooks/retry/#tab-panel-178) curl -G https://api.kirimdev.com/v1/webhook_deliveries \ --data-urlencode "status=failed" \ --data-urlencode "subscription_id=wbs_…" \ --data-urlencode "limit=50" \ -H "Authorization: Bearer $KIRIM_KEY" // Paginate failed deliveries for a subscription.for await (const delivery of kirim.webhookDeliveries.list({ status: 'failed', subscription_id: 'wbs_…',})) { console.log(delivery.id, delivery.attempt_count, delivery.response_status, delivery.error_code)} resp = httpx.get( "https://api.kirimdev.com/v1/webhook_deliveries", params={"status": "failed", "subscription_id": "wbs_…", "limit": 50}, headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"},)resp.raise_for_status()for delivery in resp.json()["data"]: print(delivery["id"], delivery["attempt_count"]) ### Replay a single delivery [Section titled “Replay a single delivery”](https://docs.kirimdev.com/webhooks/retry/#replay-a-single-delivery) * [cURL](https://docs.kirimdev.com/webhooks/retry/#tab-panel-179) * [TypeScript](https://docs.kirimdev.com/webhooks/retry/#tab-panel-180) * [Python](https://docs.kirimdev.com/webhooks/retry/#tab-panel-181) curl -X POST \ https://api.kirimdev.com/v1/webhook_deliveries/wbd_…/replay \ -H "Authorization: Bearer $KIRIM_KEY" const replay = await kirim.webhookDeliveries.replay('wbd_…')console.log(replay.id, replay.replayed_from) httpx.post( f"https://api.kirimdev.com/v1/webhook_deliveries/{delivery_id}/replay", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"},).raise_for_status() ### Bulk replay [Section titled “Bulk replay”](https://docs.kirimdev.com/webhooks/retry/#bulk-replay) * [cURL](https://docs.kirimdev.com/webhooks/retry/#tab-panel-182) * [TypeScript](https://docs.kirimdev.com/webhooks/retry/#tab-panel-183) * [Python](https://docs.kirimdev.com/webhooks/retry/#tab-panel-184) curl -X POST \ https://api.kirimdev.com/v1/webhook_deliveries/bulk_replay \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "subscription_id": "wbs_…", "status": "failed", "created_after": "2026-05-20T00:00:00Z", "created_before": "2026-05-23T00:00:00Z" }' const result = await kirim.webhookDeliveries.bulkReplay({ subscription_id: 'wbs_…', status: 'failed', created_after: '2026-05-20T00:00:00Z', created_before: '2026-05-23T00:00:00Z',}) console.log(`enqueued ${result.enqueued} (capped: ${result.capped})`) resp = httpx.post( "https://api.kirimdev.com/v1/webhook_deliveries/bulk_replay", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}, json={ "subscription_id": "wbs_…", "status": "failed", "created_after": "2026-05-20T00:00:00Z", "created_before": "2026-05-23T00:00:00Z", },)resp.raise_for_status()print(resp.json()["data"]) **Cap: 1000 deliveries per `bulk_replay` call.** If your filter matches more, the response `capped` field is `true` — paginate via `created_after`/`created_before` and call again. Suggested recovery playbook --------------------------- [Section titled “Suggested recovery playbook”](https://docs.kirimdev.com/webhooks/retry/#suggested-recovery-playbook) 1. **Spot the auto-disable** via the email notification, the dashboard banner, or by polling `GET /v1/webhook_subscriptions/{id}` for `status: 'disabled'`. 2. **Fix the underlying issue.** TLS cert renewal, infra rollback, bug fix — whatever the failed deliveries’ response bodies indicate. 3. **Test against a single delivery first.** Pick one failed `wbd_…` and `replay` it. Check your endpoint returned 2xx. 4. **Re-enable the subscription** with `{ status: 'active' }`. 5. **Bulk-replay the backlog** filtered to the outage window. 6. **Set up monitoring** — alert on `subscription.status != 'active'` and on rising `consecutive_failures` so you catch the next outage before it auto-disables. Observability ------------- [Section titled “Observability”](https://docs.kirimdev.com/webhooks/retry/#observability) The dashboard’s **Developers → Webhook Deliveries** page shows every delivery (last 30 days), filterable by subscription, status, event type, and date range. Each row exposes: * Attempt count + last/next attempt timestamps * Failure reason, in plain language, derived from `error_code` * Response status + first 1 KB of the response body, shown only when your endpoint actually answered * Full payload (pretty-printed JSON, copy-to-clipboard) * Replay button The same data is queryable via `GET /v1/webhook_deliveries` — see the [API reference](https://docs.kirimdev.com/api/operations/webhook_deliveries/) . --- # Sync Your CRM | Kirimdev [Skip to content](https://docs.kirimdev.com/guides/sync-crm/#_top) Guides Sync Your CRM ============= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Fsync-crm%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Fsync-crm%2F%20and%20help%20me%20with%20the%20following%3A%20) If your team uses an external CRM alongside Kirimdev — HubSpot, Salesforce, Pipedrive, Notion, or any internal system — you’ll want contacts and conversations to flow between them. This guide shows the two patterns that work in production, when to pick each, and how to handle the awkward parts: conflict resolution, bulk operations, and keeping team assignments visible across both systems. The data model -------------- [Section titled “The data model”](https://docs.kirimdev.com/guides/sync-crm/#the-data-model) Map Kirimdev resources to whatever your CRM calls them: | Kirimdev | Typical CRM concept | | --- | --- | | `contact` (`ctc_…`) | Person / Lead / Contact | | `conversation` (`cnv_…`) | Engagement / Ticket / Thread | | `message` (`msg_…`) | Note / Activity / Log entry | | `label` (`lbl_…`) | Tag / List / Custom field | | Contact `metadata` | Custom field bag | Use the Kirimdev id (e.g. `ctc_01HXYZ…`) as the `external_id` on the CRM side. That way the join key is stable, opaque, and unique within Kirimdev — never reused across orgs. Two flows: push vs pull ----------------------- [Section titled “Two flows: push vs pull”](https://docs.kirimdev.com/guides/sync-crm/#two-flows-push-vs-pull) | Flow | When to use | Pros | Cons | | --- | --- | --- | --- | | **Push** (webhooks) | Production, real-time sync, low contact volume mutations per second. | Sub-second latency, no read quota burn, scales with mutations not contact count. | Requires a public HTTPS endpoint + signature verification. | | **Pull** (polling) | Initial backfill, batch ETL pipelines, recovery from a webhook outage. | No public endpoint needed; resumable via cursors. | Latency = poll interval; burns read quota proportional to volume. | Most production setups do **both** — push for steady-state, pull for initial backfill and reconciliation. Push flow (preferred) --------------------- [Section titled “Push flow (preferred)”](https://docs.kirimdev.com/guides/sync-crm/#push-flow-preferred) 1. **Subscribe to the events you care about.** For full CRM sync, you typically want all four contact / conversation events: * [cURL](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-54) * [TypeScript SDK](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-55) * [Python](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-56) curl -sS https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/kirim", "events": [ "contact.created", "contact.updated", "conversation.assigned", "conversation.closed" ], "description": "CRM sync" }' await kirim.webhookSubscriptions.create({ url: 'https://your-app.example.com/webhooks/kirim', events: [ 'contact.created', 'contact.updated', 'conversation.assigned', 'conversation.closed', ], description: 'CRM sync',}) import os, httpx httpx.post( "https://api.kirimdev.com/v1/webhook_subscriptions", headers={"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}, json={ "url": "https://your-app.example.com/webhooks/kirim", "events": [ "contact.created", "contact.updated", "conversation.assigned", "conversation.closed", ], "description": "CRM sync", },) Stash the `initial_secret` in your secrets manager — Kirimdev only returns it once. See the [Webhooks Guide](https://docs.kirimdev.com/guides/webhooks/) for the full setup flow. 2. **Idempotently upsert in your handler.** Always upsert by Kirimdev’s `external_id` (the `ctc_…` prefix), never by phone number or email — those fields can change in either system, but the Kirimdev id is stable forever. app.post( '/webhooks/kirim', express.raw({ type: 'application/json' }), async (req, res) => { // signature verification + dedup (see /guides/webhooks/) const event = JSON.parse(req.body.toString('utf8')) switch (event.type) { case 'contact.created': case 'contact.updated': { const c = event.data.contact await crm.people.upsert({ externalId: c.id, // ctc_01HXYZ… phone: c.phone_number, name: c.name, email: c.email, tags: c.labels?.map((l) => l.name) ?? [], customFields: c.metadata ?? {}, }) break } case 'conversation.assigned': { const { conversation, assignee } = event.data await crm.tickets.upsert({ externalId: conversation.id, assigneeId: assignee.user_id, status: 'open', }) break } case 'conversation.closed': { const { conversation } = event.data await crm.tickets.update(conversation.id, { status: 'closed', closedAt: new Date(), }) break } } res.status(200).send('ok') },) 3. **Push CRM changes back to Kirimdev.** When your CRM is the source of truth for a contact’s name, email, or custom metadata, propagate updates back to Kirimdev. Use the contact-scoped endpoint: // Inside your CRM webhook handler (or change-data-capture pipeline):async function pushContactToKirim(crmPerson: CrmPerson) { const phone = kirim.phoneNumbers(process.env.PHONE_ID!) await phone.contacts.update(crmPerson.kirimExternalId, { name: crmPerson.name, email: crmPerson.email, metadata: { crm_id: crmPerson.id, crm_segment: crmPerson.segment, last_synced_at: new Date().toISOString(), }, })} Pull flow (backfill & recovery) ------------------------------- [Section titled “Pull flow (backfill & recovery)”](https://docs.kirimdev.com/guides/sync-crm/#pull-flow-backfill--recovery) Polling is the right tool for two jobs: the very first sync (when there are no events yet), and reconciliation if your webhook handler was down. Use cursor pagination for both. ### Backfill contacts [Section titled “Backfill contacts”](https://docs.kirimdev.com/guides/sync-crm/#backfill-contacts) Walk all contacts under a phone number, paginating until cursor is exhausted: * [cURL](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-57) * [TypeScript SDK](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-58) * [Python](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-59) # First pagecurl -sS "https://api.kirimdev.com/v1/$PHONE_ID/contacts?limit=100&created_after=2026-05-01T00:00:00Z" \ -H "Authorization: Bearer $KIRIM_KEY" # Next page using the cursor from the previous responsecurl -sS "https://api.kirimdev.com/v1/$PHONE_ID/contacts?limit=100&cursor=ctc_01HXYZ…" \ -H "Authorization: Bearer $KIRIM_KEY" import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const phone = kirim.phoneNumbers(process.env.PHONE_ID!) // Async iteration handles cursor paging automatically.for await (const ctc of phone.contacts.list({ limit: 100, created_after: '2026-05-01T00:00:00Z',})) { await crm.people.upsert({ externalId: ctc.id, phone: ctc.phone_number, name: ctc.name, email: ctc.email, labelIds: ctc.labels.map((label) => label.id), })} import os, httpx BASE = "https://api.kirimdev.com/v1"HEADERS = {"Authorization": f"Bearer {os.environ['KIRIM_KEY']}"}PHONE_ID = os.environ["PHONE_ID"] cursor = Nonewhile True: params = {"limit": 100, "created_after": "2026-05-01T00:00:00Z"} if cursor: params["cursor"] = cursor r = httpx.get(f"{BASE}/{PHONE_ID}/contacts", headers=HEADERS, params=params) body = r.json() for ctc in body["data"]: crm_upsert_person( external_id=ctc["id"], phone=ctc["phone_number"], name=ctc.get("name"), email=ctc.get("email"), label_ids=[label["id"] for label in ctc["labels"]], ) if not body.get("has_more"): break cursor = body["next_cursor"] ### Find open conversations for routing [Section titled “Find open conversations for routing”](https://docs.kirimdev.com/guides/sync-crm/#find-open-conversations-for-routing) To pull open conversations (e.g. for an inbox view, support routing, or escalation alerts), read `labels` directly from each conversation. Every label contains its public `lbl_...` ID, name, and color; unlabeled conversations return an empty array. * [cURL](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-60) * [TypeScript SDK](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-61) * [Python](https://docs.kirimdev.com/guides/sync-crm/#tab-panel-62) curl -sS "https://api.kirimdev.com/v1/$PHONE_ID/conversations?status=open&limit=50" \ -H "Authorization: Bearer $KIRIM_KEY" for await (const cnv of phone.conversations.list({ status: 'open' })) { if (!cnv.assigned_to) { await crm.tickets.queueForRouting(cnv.id, cnv.contact.id, { labelIds: cnv.labels.map((label) => label.id), }) }} r = httpx.get( f"{BASE}/{PHONE_ID}/conversations", headers=HEADERS, params={"status": "open", "limit": 50},)for cnv in r.json()["data"]: if not cnv.get("assigned_to"): crm_queue_for_routing( cnv["id"], cnv["contact"]["id"], label_ids=[label["id"] for label in cnv["labels"]], ) See [Pagination](https://docs.kirimdev.com/concepts/pagination/) for cursor semantics — short version: cursors are opaque, only valid forward, and never expire. Conflict resolution ------------------- [Section titled “Conflict resolution”](https://docs.kirimdev.com/guides/sync-crm/#conflict-resolution) If both Kirimdev and your CRM can mutate the same fields, you need a rule. The cleanest one that scales: * **Kirimdev owns WhatsApp-related fields.** Phone number, conversation status, message history, labels applied via the inbox, assignment state. Your CRM mirrors these read-only. * **CRM owns business-side fields.** Name, email, lifecycle stage, custom segments, deal value, owner. Kirimdev mirrors these by writing to contact `metadata`. When a field could plausibly belong to either side, default to the CRM. WhatsApp is a channel; the CRM is the customer record. A safe upsert pattern: // Inside contact.updated handler from Kirimdev:await crm.people.update(crmPersonId, { // Only touch fields Kirimdev owns. whatsappPhone: c.phone_number, whatsappLabels: c.labels.map((l) => l.name), // DO NOT clobber CRM-owned fields like name/email here.}) // Inside CRM person.updated handler:await phone.contacts.update(c.kirimExternalId, { // Only touch fields the CRM owns. name: c.name, email: c.email, metadata: { crm_id: c.id, crm_segment: c.segment, },}) This avoids the most common sync bug: a circular update where Kirimdev patches the CRM, the CRM patches Kirimdev back, and your handlers oscillate forever. ### Permanent deletion and linked chat data [Section titled “Permanent deletion and linked chat data”](https://docs.kirimdev.com/guides/sync-crm/#permanent-deletion-and-linked-chat-data) Treat `DELETE /v1/{phone_number_id}/contacts/{id}` as an erasure operation, not as a reversible CRM sync update. It permanently removes the WhatsApp contact’s dependent data and, when the contact has a linked hosted-chat identity, also removes that identity’s snapshots, sessions, messages, and private media references. Private object deletion continues asynchronously from a durable queue. If you only need to stop messaging or temporarily hide a customer in your CRM, keep the Kirimdev contact and store that state in your own system. Disconnecting a WhatsApp number does not trigger this erasure. Bulk labelling from CRM segments -------------------------------- [Section titled “Bulk labelling from CRM segments”](https://docs.kirimdev.com/guides/sync-crm/#bulk-labelling-from-crm-segments) A common pattern: tag every contact in a CRM segment with a Kirimdev label, so the inbox can filter by it (e.g. “VIP”, “Trial”, “Past Due”). // Pull the segment from your CRM, then bulk-tag in Kirimdev.const vipContactIds = await crm.segments.fetchContactIds('vip-customers')// vipContactIds is an array of Kirimdev ctc_… ids (your CRM stored them). const phone = kirim.phoneNumbers(process.env.PHONE_ID!) // Chunk to stay under the 1000-per-request cap.function chunk(arr: T[], size: number): T[][] { const out: T[][] = [] for (let i = 0; i < arr.length; i += size) out.push(arr.slice(i, i + size)) return out} for (const ids of chunk(vipContactIds, 1000)) { const result = await phone.contacts.bulkLabel({ contact_ids: ids, label_id: 'lbl_vip', operation: 'attach', }) console.log(`Applied: ${result.applied}, skipped: ${result.skipped_cross_org}`)} Reverse the flow by subscribing to `contact.updated` and reading the new `labels` array to mirror the tag back into your CRM. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/guides/sync-crm/#whats-next) Webhook events Full payload shapes for `contact.*` and `conversation.*` events. [Read the reference →](https://docs.kirimdev.com/webhooks/events/) Subscribe to webhooks Set up the push side of the sync — endpoint, secret, verification. [Read the guide →](https://docs.kirimdev.com/guides/webhooks/) Idempotency Safe retries for the CRM → Kirimdev direction. [Read the concept →](https://docs.kirimdev.com/concepts/idempotency/) Rate limits Per-key budgets for high-throughput pulls and bulk operations. [Read the concept →](https://docs.kirimdev.com/concepts/rate-limits/) --- # WhatsApp Business payment setup | Kirimdev [Skip to content](https://docs.kirimdev.com/guides/whatsapp-business-payment/#_top) Guides WhatsApp Business payment setup =============================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Fwhatsapp-business-payment%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fguides%2Fwhatsapp-business-payment%2F%20and%20help%20me%20with%20the%20following%3A%20) Meta bills your **WhatsApp Business Account (WABA)** directly for conversation and template fees. Kirimdev does not collect those charges — we only provide the platform layer. If templates fail with billing-related errors, or WhatsApp Manager shows a missing payment method, fix it in **Meta Business Suite**, not in the Kirimdev dashboard. Before you start ---------------- [Section titled “Before you start”](https://docs.kirimdev.com/guides/whatsapp-business-payment/#before-you-start) * A Facebook account with **admin access** to the Business Manager that owns your WABA. * A valid **credit or debit card** (Visa or Mastercard are commonly accepted). * **Business details** ready — legal business name, full address, and tax ID (for Indonesia: **NPWP**). Set up billing in Meta Business Suite ------------------------------------- [Section titled “Set up billing in Meta Business Suite”](https://docs.kirimdev.com/guides/whatsapp-business-payment/#set-up-billing-in-meta-business-suite) 1. **Open Meta billing — payment methods.** Go directly to [Meta Business payment methods](https://business.facebook.com/billing_hub/payment_methods) and sign in with the Facebook account that has admin access to the Business Manager owning your WABA. 2. **Add a Business payment method (not from the WhatsApp menu).** On the [payment methods](https://business.facebook.com/billing_hub/payment_methods) page (Indonesian UI: _Tagihan dan Pembayaran_ → _Metode Pembayaran_): * Click **Add payment method** → choose **Add Business payment method** (_Tambah Metode Pembayaran Bisnis_). * **Do not** add the card from the WhatsApp account screen first — Meta expects a Business-level payment method, then you attach it to the WABA. Select **Credit / debit card**, enter the card details, and save. 3. **Complete Business Info.** In WhatsApp Manager (or the WABA settings area), open **Business info** (_Informasi Bisnis_) and fill in: | Field | Notes | | --- | --- | | **Business name** | Legal company / trade name | | **Business address** | Full street address, city, province, postal code | | **Tax ID** | NPWP for Indonesian entities — used on invoices and verification | Save changes. Mismatched legal names or tax IDs are a common cause of verification delays. 4. **Link the payment method to your WhatsApp account.** * Go to **Accounts** → **WhatsApp accounts**. * Open the WABA / phone number you use with Kirimdev. * Click **Add payment method** and select the **Business payment method** you created in step 2. Confirm the business name and NPWP match your official documents. Payment verification -------------------- [Section titled “Payment verification”](https://docs.kirimdev.com/guides/whatsapp-business-payment/#payment-verification) After you add a card, Meta usually: 1. Places a **small verification charge** on the card to confirm it is valid. 2. Completes verification within **1–3 business days** (timing varies by country and Business Manager state). Once verified, your WABA can send **approved paid templates** and other billable conversation categories according to Meta’s pricing. Troubleshooting --------------- [Section titled “Troubleshooting”](https://docs.kirimdev.com/guides/whatsapp-business-payment/#troubleshooting) | Symptom | What to check | | --- | --- | | ”Payment method required” in WhatsApp Manager | Open [payment methods](https://business.facebook.com/billing_hub/payment_methods)
, then repeat steps 2–4; ensure the method is attached at the **WABA** level, not only at Business level. | | Verification stuck > 3 days | Card issuer may block Meta charges; try another card or contact your bank. Confirm Business Info (especially NPWP) is complete. | | Templates still fail after billing is OK | Template may be pending Meta review, or the WABA is restricted — see [Handle failed sends](https://docs.kirimdev.com/guides/failed-sends/)
for Kirimdev error codes. | | Charges on the wrong entity | The Facebook user who added billing must be admin on the Business that owns the WABA connected in Kirimdev. | Related ------- [Section titled “Related”](https://docs.kirimdev.com/guides/whatsapp-business-payment/#related) * [Send templates](https://docs.kirimdev.com/sending/send-templates/) — when paid templates are required. * [Handle failed sends](https://docs.kirimdev.com/guides/failed-sends/) — distinguish billing issues from delivery and compliance errors. * [Meta Business payment methods](https://business.facebook.com/billing_hub/payment_methods) — add or manage Business-level cards. * [Meta: About billing](https://developers.facebook.com/docs/whatsapp/pricing/) — official pricing and billing model. --- # Send WhatsApp Order Notifications | Kirimdev [Skip to content](https://docs.kirimdev.com/recipes/order-notifications/#_top) Recipes Send WhatsApp Order Notifications ================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Frecipes%2Forder-notifications%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Frecipes%2Forder-notifications%2F%20and%20help%20me%20with%20the%20following%3A%20) You run an ecommerce shop. When an order ships, you want the customer to receive a WhatsApp message with the tracking link — reliably, once, and with full visibility into whether it actually arrived. This recipe wires together an **approved Meta template**, an **idempotent send** keyed by your order id, and a **`message.status` webhook** so you can tell delivery apart from “Meta accepted it but it bounced an hour later”. Architecture ------------ [Section titled “Architecture”](https://docs.kirimdev.com/recipes/order-notifications/#architecture) ┌──────────────┐ order.shipped ┌──────────────┐ POST /v1/.../messages ┌──────────┐│ Your shop │ ─────────────────► │ Your backend │ ────────────────────────► │ Kirimdev││ (Shopify/ │ │ (this guide) │ └────┬─────┘│ custom) │ └──────┬───────┘ │└──────────────┘ │ forwards │ │ ▼ ┌──────▼────────┐ message.status ┌──────────┐ │ Webhook │ ◄───────────────────── │ Meta │ │ /kirim-hook │ (delivered/failed) └────┬─────┘ └───────────────┘ │ ▼ ┌──────────┐ │ Customer │ └──────────┘ Two hops, one direction for the send, one direction for the status — everything driven by webhooks so nothing polls. Pre-requisites -------------- [Section titled “Pre-requisites”](https://docs.kirimdev.com/recipes/order-notifications/#pre-requisites) * A Kirimdev API key (`kdv_live_…`). See [Authentication](https://docs.kirimdev.com/authentication/) . * A connected WhatsApp Business account (resolve its `phone_number_id` via [`GET /v1/accounts`](https://docs.kirimdev.com/api/) — see step 2). * A Meta-approved template named `your_order_shipped`. The shape we assume in this recipe: | Component | Content | | --- | --- | | **Header** (text) | `Order #{{1}}` | | **Body** (text) | `Hi {{1}}, your order is on its way! Track it here:` | | **Button** (URL) | dynamic suffix `{{1}}` appended to a fixed base URL | Templates are approved inside Meta Business Manager — Kirimdev doesn’t gate the approval, it forwards your placeholders to Meta verbatim. Walkthrough ----------- [Section titled “Walkthrough”](https://docs.kirimdev.com/recipes/order-notifications/#walkthrough) 1. **Approve the template in Meta Business Manager.** Submit `your_order_shipped` with the three components above. Meta typically responds within a few minutes for transactional templates. Once approved, it appears in [`GET /v1/{phone_number_id}/templates`](https://docs.kirimdev.com/api/) with `status: "APPROVED"`. 2. **Resolve your `phone_number_id`.** Every send and every template lookup is scoped to a specific connected WhatsApp number. Pull the list once at boot: import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! }) const accounts = await kirim.accounts.list()const shop = accounts.find((a) => a.phone_number === '+628111222333')if (!shop) throw new Error('shop WA account not connected') const PHONE_NUMBER_ID = shop.phone_number_id // e.g. "106540352242922" Cache `PHONE_NUMBER_ID` — it never changes for a given connected account. See [Resource IDs](https://docs.kirimdev.com/concepts/resource-ids/) for the full shape. 3. **Hook your shop’s `order.shipped` event.** Whatever ecommerce platform you use (Shopify, WooCommerce, custom Postgres trigger), funnel “this order shipped” events into one HTTP handler. We’ll use a tiny Hono server below; swap for your framework freely. 4. **Build an idempotent template send.** The idempotency key is **derived from the order id**, not random. That way retries from your shop’s webhook, queue redeliveries, or your own re-run scripts all collapse to a single send: import { createHash } from 'node:crypto' const idempotencyKey = (orderId: string) => createHash('sha256').update(`shipped:${orderId}`).digest('hex') Pass it via the SDK’s per-request override: await kirim.phoneNumbers(PHONE_NUMBER_ID).messages.send( { messaging_product: 'whatsapp', to: customer.phone, // '+628999888777' type: 'template', template: { name: 'your_order_shipped', language: { code: 'id_ID' }, components: [ { type: 'header', parameters: [{ type: 'text', text: order.id }], }, { type: 'body', parameters: [{ type: 'text', text: customer.first_name }], }, { type: 'button', sub_type: 'url', index: '0', parameters: [{ type: 'text', text: order.tracking_slug }], }, ], }, }, { idempotencyKey: idempotencyKey(order.id) },) Re-running this with the same `order.id` returns the cached response with `Idempotent-Replayed: true` — see [Idempotency](https://docs.kirimdev.com/concepts/idempotency/) . 5. **Subscribe to delivery callbacks.** Webhook subscriptions are org-level (root scope), not per-phone: const sub = await kirim.webhookSubscriptions.create({ url: 'https://your-shop.example/kirim-hook', events: ['message.status'],})console.log(sub.signing_secret) // store this in your secret manager — shown ONCE See [Webhooks overview](https://docs.kirimdev.com/webhooks/overview/) and [Webhook signing](https://docs.kirimdev.com/webhooks/signing/) for the verification contract. 6. **Handle `failed` status with a graceful fallback.** The customer’s WhatsApp may be unreachable (`recipient_not_on_whatsapp`), their phone number invalid (`invalid_recipient_phone`), or Meta may drop the message after accepting it. Catch those in your `message.status` handler and escalate. Full code --------- [Section titled “Full code”](https://docs.kirimdev.com/recipes/order-notifications/#full-code) * [TypeScript (SDK)](https://docs.kirimdev.com/recipes/order-notifications/#tab-panel-81) * [Python](https://docs.kirimdev.com/recipes/order-notifications/#tab-panel-82) * [curl](https://docs.kirimdev.com/recipes/order-notifications/#tab-panel-83) import { Hono } from 'hono'import { Kirim } from '@kirimdev/sdk'import { verifyWebhookSignature } from '@kirimdev/sdk/webhooks'import { createHash } from 'node:crypto' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const PHONE_NUMBER_ID = '106540352242922' const app = new Hono() // 1. Your shop fires this when an order ships.app.post('/internal/order-shipped', async (c) => { const { order, customer } = await c.req.json() const key = createHash('sha256').update(`shipped:${order.id}`).digest('hex') const msg = await kirim.phoneNumbers(PHONE_NUMBER_ID).messages.send( { messaging_product: 'whatsapp', to: customer.phone, type: 'template', template: { name: 'your_order_shipped', language: { code: 'id_ID' }, components: [ { type: 'header', parameters: [{ type: 'text', text: order.id }] }, { type: 'body', parameters: [{ type: 'text', text: customer.first_name }] }, { type: 'button', sub_type: 'url', index: '0', parameters: [{ type: 'text', text: order.tracking_slug }], }, ], }, }, { idempotencyKey: key }, ) await db.shipped_sends.upsert({ order_id: order.id, message_id: msg.id }) return c.json({ ok: true, message_id: msg.id })}) // 2. Kirimdev posts delivery updates here.app.post('/kirim-hook', async (c) => { const raw = await c.req.text() const ok = await verifyWebhookSignature( raw, c.req.header('x-kirim-signature'), process.env.KIRIM_WEBHOOK_SECRET!, ) if (!ok) return c.text('bad signature', 401) const event = JSON.parse(raw) if (event.type !== 'message.status') return c.text('ok') const { id, status, error } = event.data await db.shipped_sends.update({ where: { message_id: id }, data: { status } }) if (status === 'failed') { // Escalate — try email fallback, or alert your ops channel. await fallbackEmail(id, error) } return c.text('ok')}) export default app import hashlibimport osfrom fastapi import FastAPI, Request, HTTPExceptionimport httpx KIRIM_KEY = os.environ["KIRIM_KEY"]PHONE_NUMBER_ID = "106540352242922"BASE = "https://api.kirimdev.com/v1" app = FastAPI()client = httpx.AsyncClient( base_url=BASE, headers={"Authorization": f"Bearer {KIRIM_KEY}"}, timeout=30.0,) @app.post("/internal/order-shipped")async def order_shipped(req: Request): payload = await req.json() order, customer = payload["order"], payload["customer"] key = hashlib.sha256(f"shipped:{order['id']}".encode()).hexdigest() r = await client.post( f"/{PHONE_NUMBER_ID}/messages", json={ "messaging_product": "whatsapp", "to": customer["phone"], "type": "template", "template": { "name": "your_order_shipped", "language": {"code": "id_ID"}, "components": [ {"type": "header", "parameters": [{"type": "text", "text": order["id"]}]}, {"type": "body", "parameters": [{"type": "text", "text": customer["first_name"]}]}, {"type": "button", "sub_type": "url", "index": "0", "parameters": [{"type": "text", "text": order["tracking_slug"]}]}, ], }, }, headers={"Idempotency-Key": key}, ) r.raise_for_status() return {"ok": True, "message_id": r.json()["id"]} For webhook verification, mirror the HMAC scheme in [Webhook signing](https://docs.kirimdev.com/webhooks/signing/) — Python equivalent is `hmac.new(secret, raw_body, hashlib.sha256).hexdigest()` compared against `X-Kirim-Signature`. KEY=$(printf 'shipped:%s' "$ORDER_ID" | sha256sum | cut -d' ' -f1) curl -X POST "https://api.kirimdev.com/v1/106540352242922/messages" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Idempotency-Key: $KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+628999888777", "type": "template", "template": { "name": "your_order_shipped", "language": { "code": "id_ID" }, "components": [ { "type": "header", "parameters": [{ "type": "text", "text": "A-1042" }] }, { "type": "body", "parameters": [{ "type": "text", "text": "Ayu" }] }, { "type": "button", "sub_type": "url", "index": "0", "parameters": [{ "type": "text", "text": "abc123xyz" }] } ] } }' What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/recipes/order-notifications/#whats-next) Idempotency contract The header semantics, replay rules, and the `Idempotent-Replayed` response header. → [/concepts/idempotency/](https://docs.kirimdev.com/concepts/idempotency/) Handle failed sends Branching on `error.code`, retry strategies per failure class. → [/guides/failed-sends/](https://docs.kirimdev.com/guides/failed-sends/) Webhook signing Verify `X-Kirim-Signature` so nobody fakes a delivered status. → [/webhooks/signing/](https://docs.kirimdev.com/webhooks/signing/) Broadcast campaign Same template, many recipients — rate-limit aware. → [/recipes/broadcast-campaign/](https://docs.kirimdev.com/recipes/broadcast-campaign/) --- # Broadcast | Kirimdev [Skip to content](https://docs.kirimdev.com/recipes/broadcast-campaign/#_top) Recipes Broadcast ========= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Frecipes%2Fbroadcast-campaign%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Frecipes%2Fbroadcast-campaign%2F%20and%20help%20me%20with%20the%20following%3A%20) Broadcast di Kirimdev adalah **kampanye sekali jalan**: satu template WhatsApp yang sama dikirim ke banyak penerima — promo, pengumuman, pengingat, undangan event, dan sejenisnya. Semua dikelola dari menu **Broadcast** di dashboard. Sebelum mulai ------------- [Section titled “Sebelum mulai”](https://docs.kirimdev.com/recipes/broadcast-campaign/#sebelum-mulai) Template sudah disetujui Di luar chat aktif 24 jam, WhatsApp hanya mengizinkan **template** yang sudah lulus review. Buat dan setujui template dulu di dashboard (Templates) atau WhatsApp Manager sebelum membuat broadcast. Daftar penerima opt-in Kirim hanya ke orang yang **setuju** menerima pesan marketing / notifikasi dari Anda. Tanpa consent, rating nomor bisa turun dan batas kirim harian mengecil. Patuhi batas harian WhatsApp membatasi **berapa banyak penerima unik** yang boleh Anda hubungi per 24 jam (250 → 2k → 10k → 100k → Unlimited). Broadcast besar di hari pertama sering mentok batas — pecah kampanye atau naikkan tier secara organik dulu. Lihat [tabel tier Meta](https://docs.kirimdev.com/recipes/broadcast-campaign/#batas-messaging-tier-meta) . Konten jujur & relevan Template harus sesuai kategori (marketing / utility / auth). Jangan janji misleading; sediakan cara **berhenti berlangganan** (opt-out) jika template marketing. Batas messaging tier Meta ------------------------- [Section titled “Batas messaging tier Meta”](https://docs.kirimdev.com/recipes/broadcast-campaign/#batas-messaging-tier-meta) Broadcast template di luar jendela 24 jam dihitung sebagai **pesan business-initiated**. Meta membatasi **berapa banyak nomor WhatsApp unik** yang boleh Anda hubungi dalam periode **24 jam bergulir** (_moving 24-hour period_) — ini yang sering disebut **messaging tier** atau **messaging limit**. ### Tabel tier [Section titled “Tabel tier”](https://docs.kirimdev.com/recipes/broadcast-campaign/#tabel-tier) | Tier | Maks. penerima unik / 24 jam | | --- | --- | | Baru | 250 | | Setelah scaling path | 2.000 | | Auto-scale 1 | 10.000 | | Auto-scale 2 | 100.000 | | Auto-scale 3 | Unlimited | Yang **tidak** dihitung ke kuota harian: balasan agent di dalam **jendela layanan 24 jam** setelah pelanggan chat dulu (customer service window). Tier naik otomatis jika kualitas pesan bagus dan portfolio memakai setidaknya ~50% kuota saat ini dalam 7 hari terakhir (pengecekan Meta setiap ±6 jam). Untuk naik dari 250 → 2.000, selesaikan salah satu **scaling path**: verifikasi bisnis, verifikasi lewat solution provider, atau kirim 2.000 template terkirim ke penerima unik dalam 30 hari dengan rating template tinggi. Detail resmi: [Messaging Limits — Meta](https://developers.facebook.com/docs/whatsapp/messaging-limits/) . ### Cara cek tier di dashboard Meta [Section titled “Cara cek tier di dashboard Meta”](https://docs.kirimdev.com/recipes/broadcast-campaign/#cara-cek-tier-di-dashboard-meta) 1. Buka [Meta Business Suite](https://business.facebook.com/) → masuk ke Business Portfolio yang memegang nomor WhatsApp Anda. 2. Buka **WhatsApp Manager** (menu WhatsApp / Account tools). 3. Pilih **Account tools** → panel **Messaging limits**. Di panel itu Anda melihat **tier / batas harian saat ini** untuk portfolio. Meta **tidak** menampilkan sisa kuota harian yang tersisa — hanya tier aktif. Jika broadcast mentok di tengah jalan, cek juga halaman detail broadcast di Kirimdev (baris gagal dengan kuota) dan [panduan kiriman gagal](https://docs.kirimdev.com/guides/failed-sends/) (`quota_exceeded`). Langkah di dashboard -------------------- [Section titled “Langkah di dashboard”](https://docs.kirimdev.com/recipes/broadcast-campaign/#langkah-di-dashboard) 1. **Siapkan template.** Pastikan status template **Approved** dan bahasa/konten sudah benar. Uji dulu ke nomor internal sebelum blast ke ribuan orang. Baca juga: [Jendela 24 jam & template (FAQ)](https://docs.kirimdev.com/guides/24h-window-and-templates/) . 2. **Buka Broadcast → Buat broadcast.** Pilih nomor WhatsApp pengirim, beri nama kampanye, lalu pilih template. 3. **Isi variabel template.** Nama pelanggan, kode promo, tanggal, dll. Jika upload CSV, pastikan kolom nomor telepon format benar (disarankan E.164, contoh `+628123456789`). 4. **Pilih audiens.** * **Semua kontak** — hati-hati; pastikan seluruh basis data opt-in. * **Label** — segmentasi aman (mis. “Pelanggan aktif”, “Newsletter”). * **Kontak terpilih** — uji kecil sebelum scale. * **CSV** — impor daftar dengan consent tercatat. 5. **Jadwalkan atau kirim sekarang.** Review ringkasan penerima + preview template. Klik kirim; progress tampil di halaman detail broadcast (terkirim / gagal). 6. **Pantau hasil.** Cek baris yang **gagal** — nomor tidak terdaftar WhatsApp, opt-out marketing, atau batas harian habis. Jangan spam ulang ke yang gagal tanpa memperbaiki penyebabnya. Praktik terbaik --------------- [Section titled “Praktik terbaik”](https://docs.kirimdev.com/recipes/broadcast-campaign/#praktik-terbaik) | Topik | Rekomendasi | | --- | --- | | **Frekuensi** | Jangan blast berulang ke basis yang sama dalam waktu singkat. | | **Segmentasi** | Kirim promo relevan per label, bukan satu pesan ke seluruh database. | | **Jam kirim** | Hindari malam dini hari; hormati zona waktu pelanggan. | | **Opt-out** | Hormati pelanggan yang minta berhenti; jangan masukkan lagi ke kampanye marketing. | | **Uji kecil** | 10–50 penerima internal dulu, baru scale ke ribuan. | | **Warm-up nomor** | Nomor baru mulai dari batas kecil; naikkan volume bertahap minggu demi minggu. | Kesalahan yang sering terjadi ----------------------------- [Section titled “Kesalahan yang sering terjadi”](https://docs.kirimdev.com/recipes/broadcast-campaign/#kesalahan-yang-sering-terjadi) Broadcast vs chat biasa ----------------------- [Section titled “Broadcast vs chat biasa”](https://docs.kirimdev.com/recipes/broadcast-campaign/#broadcast-vs-chat-biasa) | | **Chat / balasan agent** | **Broadcast template** | | --- | --- | --- | | **Kapan** | Ada chat masuk dalam 24 jam terakhir | Kapan saja, ke banyak penerima sekaligus | | **Bentuk pesan** | Teks, media, interaktif | Template yang sudah disetujui | | **Risiko** | Rendah jika kontekstual | Lebih tinggi jika spam atau tanpa opt-in | Penjelasan jendela 24 jam: [FAQ template](https://docs.kirimdev.com/guides/24h-window-and-templates/) . Selanjutnya ----------- [Section titled “Selanjutnya”](https://docs.kirimdev.com/recipes/broadcast-campaign/#selanjutnya) Template Cara kerja template & parameter. → [/sending/send-templates/](https://docs.kirimdev.com/sending/send-templates/) Jendela 24 jam Kapan boleh chat bebas vs wajib template. → [/guides/24h-window-and-templates/](https://docs.kirimdev.com/guides/24h-window-and-templates/) Kiriman gagal Arti status gagal di dashboard. → [/guides/failed-sends/](https://docs.kirimdev.com/guides/failed-sends/) Integrasi API Kirim template programmatically. → [/sending/send-templates/](https://docs.kirimdev.com/sending/send-templates/) --- # WhatsApp Support Bot with n8n + AI | Kirimdev [Skip to content](https://docs.kirimdev.com/recipes/support-bot/#_top) Recipes WhatsApp Support Bot with n8n + AI ================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Frecipes%2Fsupport-bot%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Frecipes%2Fsupport-bot%2F%20and%20help%20me%20with%20the%20following%3A%20) A customer messages your business WhatsApp number. Within a second: 1. **AI classifies** the intent — question, complaint, or small-talk. 2. **n8n routes** based on the classification. 3. You either **auto-reply** with a templated answer or **assign the conversation** to your support team for a human to pick up. You write zero backend code. Everything lives in an n8n workflow on top of [`@kirimdev/n8n-nodes-kirim`](https://github.com/kirim-dev/n8n-nodes-kirim) . Why n8n ------- [Section titled “Why n8n”](https://docs.kirimdev.com/recipes/support-bot/#why-n8n) * **Declarative** — the workflow IS the runtime; no Docker image to ship. * **First-class AI nodes** — OpenAI, Anthropic, local Ollama all drop-in. * **HMAC verification is automatic** — the **Kirim Trigger** node refuses unsigned payloads, so you can’t accidentally ship an unauthenticated webhook to production. * **Observability** — every execution is a row in n8n’s history with full input/output snapshots. If you’re already on Make / Zapier / Pipedream, the same pattern applies — substitute their Kirimdev integration. The fallback at the end of this page is for teams who’d rather own the code. Architecture ------------ [Section titled “Architecture”](https://docs.kirimdev.com/recipes/support-bot/#architecture) ┌─────────────────┐ │ Customer WA │ └────────┬────────┘ │ message.received ▼ ┌────────────────────┐ │ Kirim Trigger │ ← n8n node, HMAC verified │ (event: msg.recv) │ └────────┬───────────┘ │ ▼ ┌────────────────────┐ │ AI Agent node │ → returns JSON { intent, reply } │ (OpenAI/Anthropic)│ └────────┬───────────┘ │ ▼ ┌────────────────────┐ │ Switch on intent │ └─┬───────┬────────┬─┘ │ │ │ ▼ ▼ ▼ question complaint small_talk │ │ │ ▼ ▼ ▼ Send Update Send Text Template Conv (AI reply) (assign + label) One trigger in, three exits out. Every branch ends with a Kirim node call so the customer always gets a response (or a human gets pinged). Walkthrough ----------- [Section titled “Walkthrough”](https://docs.kirimdev.com/recipes/support-bot/#walkthrough) 1. **Install the community node.** In your n8n instance: **Settings → Community Nodes → Install** → enter `@kirimdev/n8n-nodes-kirim` → confirm. Wait for the install to finish (n8n restarts the node runtime automatically). 2. **Add a Kirim API credential.** **Credentials → New → Kirim API**. Paste your `kdv_live_…` key. Save. The same credential is used by both the Kirim Trigger and the Kirim action nodes. 3. **Add the Kirim Trigger node.** Drag **Kirim Trigger** onto the canvas as the workflow’s start node. Configure: * **Event**: `message.received` * **Phone Number ID**: `106540352242922` (or `*` to receive from every connected number in the org) Click **Listen for Test Event** and send yourself a test WhatsApp message. You should see the raw event arrive — that confirms the subscription is wired and HMAC verification passed. 4. **Add the AI Agent node.** Drag **AI Agent** (or **OpenAI** / **Anthropic** if you want a single-shot call) after the trigger. System prompt: You are a WhatsApp support triage classifier for an Indonesianecommerce store. Classify the incoming message as exactly one of: - "question" — customer asking about product, pricing, or service - "complaint" — customer has a problem (broken item, late delivery, refund) - "small_talk" — greeting, thanks, off-topic chatter Respond with strict JSON, no prose:{ "intent": "question" | "complaint" | "small_talk", "reply": ""} User prompt: `{{ $json.data.messages[0].text.body }}` (n8n’s expression syntax pulls the inbound text from the Meta-shaped payload). 5. **Add a Switch node.** Route on `{{ $json.intent }}` with three rules: | Condition | Output | | --- | --- | | `equals "question"` | → Output 0 | | `equals "complaint"` | → Output 1 | | `equals "small_talk"` | → Output 2 | 6. **Branch — `question` → send template auto-reply.** Drag a **Kirim** node onto output 0. Operation: **Message → Send Template**. * Phone Number ID: `{{ $('Kirim Trigger').item.json.phone_number_id }}` * To: `{{ $('Kirim Trigger').item.json.data.messages[0].from }}` * Template name: `auto_reply_question` * Language: `id_ID` `auto_reply_question` is a pre-approved template along the lines of _“Halo! Tim kami akan membalas dalam 1 jam kerja. Sementara itu, FAQ lengkap di `{{1}}`.”_ with one URL parameter. 7. **Branch — `complaint` → assign to a human.** Drag a **Kirim** node onto output 1. Operation: **Conversation → Update**. * Conversation ID: `{{ $('Kirim Trigger').item.json.data.conversation_id }}` * Assigned User ID: `U7d2k9mq` (a member of your support team) * Status: `open` Then a second **Kirim** node — **Conversation → Add Label**: * Label: `auto-triaged` The human picks the conversation up from the Kirimdev inbox UI; they see the inbound message plus the AI’s classification stored as a label. 8. **Branch — `small_talk` → send AI reply as text.** Drag a **Kirim** node onto output 2. Operation: **Message → Send Text**. * To: `{{ $('Kirim Trigger').item.json.data.messages[0].from }}` * Body: `{{ $('AI Agent').item.json.reply }}` This works because small-talk happens **inside** the 24-hour conversation window — the customer literally just messaged you, so a free-form text reply is allowed (see [Send text](https://docs.kirimdev.com/sending/send-text/) ). 9. **Add a final Label step for audit.** On every branch, add a Kirim **Conversation → Add Label** with label `auto-triaged`. You can then filter the inbox by that label in the dashboard to spot-check the bot’s decisions. 10. **Activate.** Toggle the workflow to **Active**. n8n persists the webhook subscription with Kirimdev; deliveries now flow continuously. Sample n8n workflow (excerpt) ----------------------------- [Section titled “Sample n8n workflow (excerpt)”](https://docs.kirimdev.com/recipes/support-bot/#sample-n8n-workflow-excerpt) A trimmed export of the key connections — drop into n8n via **Import from JSON** as a starting point, then add your credentials and template names: { "name": "WA Support Triage", "nodes": [ { "name": "Kirim Trigger", "type": "@kirimdev/n8n-nodes-kirim.kirimTrigger", "parameters": { "event": "message.received", "phoneNumberId": "106540352242922" }, "credentials": { "kirimApi": "Kirim Prod" } }, { "name": "AI Triage", "type": "@n8n/n8n-nodes-langchain.agent", "parameters": { "systemMessage": "You are a WhatsApp support triage classifier...", "responseFormat": "json" } }, { "name": "Switch on intent", "type": "n8n-nodes-base.switch", "parameters": { "rules": [ { "value": "={{$json.intent}}", "operation": "equals", "compareValue": "question" }, { "value": "={{$json.intent}}", "operation": "equals", "compareValue": "complaint" }, { "value": "={{$json.intent}}", "operation": "equals", "compareValue": "small_talk" } ] } } ], "connections": { "Kirim Trigger": { "main": [[{ "node": "AI Triage", "type": "main", "index": 0 }]] }, "AI Triage": { "main": [[{ "node": "Switch on intent", "type": "main", "index": 0 }]] } }} Fallback — pure TypeScript (no n8n) ----------------------------------- [Section titled “Fallback — pure TypeScript (no n8n)”](https://docs.kirimdev.com/recipes/support-bot/#fallback--pure-typescript-no-n8n) Prefer code? The same flow with `@kirimdev/sdk` and any HTTP server. * [TypeScript (SDK)](https://docs.kirimdev.com/recipes/support-bot/#tab-panel-84) * [curl (manual subscribe)](https://docs.kirimdev.com/recipes/support-bot/#tab-panel-85) import { Hono } from 'hono'import { Kirim } from '@kirimdev/sdk'import { verifyWebhookSignature } from '@kirimdev/sdk/webhooks'import OpenAI from 'openai' const kirim = new Kirim({ apiKey: process.env.KIRIM_KEY! })const openai = new OpenAI()const PHONE_NUMBER_ID = '106540352242922'const SUPPORT_USER_ID = 'U7d2k9mq' const SYSTEM = `You are a WhatsApp support triage classifier...Respond with strict JSON: {"intent":"question|complaint|small_talk","reply":""}` const app = new Hono() app.post('/kirim-hook', async (c) => { const raw = await c.req.text() const ok = await verifyWebhookSignature( raw, c.req.header('x-kirim-signature'), process.env.KIRIM_WEBHOOK_SECRET!, ) if (!ok) return c.text('bad signature', 401) const event = JSON.parse(raw) if (event.type !== 'message.received') return c.text('ok') const inbound = event.data.messages?.[0] if (!inbound?.text?.body) return c.text('ok') // 1. Triage with the LLM. const ai = await openai.chat.completions.create({ model: 'gpt-4o-mini', response_format: { type: 'json_object' }, messages: [ { role: 'system', content: SYSTEM }, { role: 'user', content: inbound.text.body }, ], }) const { intent, reply } = JSON.parse(ai.choices[0].message.content!) const phone = kirim.phoneNumbers(PHONE_NUMBER_ID) // 2. Route. if (intent === 'question') { await phone.messages.send({ messaging_product: 'whatsapp', to: inbound.from, type: 'template', template: { name: 'auto_reply_question', language: { code: 'id_ID' }, components: [ { type: 'body', parameters: [{ type: 'text', text: 'https://shop.example/faq' }] }, ], }, }) } else if (intent === 'complaint') { await kirim.conversations.update(event.data.conversation_id, { assigned_user_id: SUPPORT_USER_ID, status: 'open', }) } else { await phone.messages.send({ messaging_product: 'whatsapp', to: inbound.from, type: 'text', text: { body: reply || 'Halo! 👋' }, }) } // 3. Audit label. await kirim.conversations.addLabel(event.data.conversation_id, { label: 'auto-triaged' }) return c.text('ok')}) export default app curl -X POST "https://api.kirimdev.com/v1/webhook_subscriptions" \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-bot.example/kirim-hook", "events": ["message.received"] }'# Response includes signing_secret — store it. Shown ONCE. What’s next ----------- [Section titled “What’s next”](https://docs.kirimdev.com/recipes/support-bot/#whats-next) Webhook event catalog Every event Kirimdev publishes, its source (Meta vs Kirimdev), and the payload shape. → [/webhooks/events/](https://docs.kirimdev.com/webhooks/events/) Webhook signing HMAC scheme, header names, replay protection. → [/webhooks/signing/](https://docs.kirimdev.com/webhooks/signing/) Conversation API Assign, label, resolve — the inbox primitives the bot calls. → [/api/](https://docs.kirimdev.com/api/) n8n nodes GitHub Source, issues, contributing. → [github.com/kirim-dev/n8n-nodes-kirim](https://github.com/kirim-dev/n8n-nodes-kirim) --- # Webhook number filters keep working after a number is reconnected | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-09-webhook-filter-follows-number/#_top) Webhook number filters keep working after a number is reconnected ================================================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-webhook-filter-follows-number%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-webhook-filter-follows-number%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 9, 2026 Webhook subscriptions Fixed --------------------------- [Section titled “Webhook subscriptions ”](https://docs.kirimdev.com/changelog/2026-10-09-webhook-filter-follows-number/#webhook-subscriptions-) Removing a WhatsApp number from Kirimdev and connecting the same number again created a new account internally. A subscription scoped to that number with `phone_number_ids` then stopped receiving its events, with no error. Filters now match the phone number itself, so events for a reconnected number keep reaching the subscription. * Applies to filters created or updated since October 9, 2026. To apply it to an existing subscription, send its `phone_number_ids` again with `PATCH /v1/webhook_subscriptions/{id}`. * `phone_number_ids` in responses now returns the numbers you set, even while one of them is disconnected. Older subscriptions still list only numbers that are currently connected. * Unfiltered subscriptions and payloads are unchanged. [Scoping a subscription to specific phone numbers](https://docs.kirimdev.com/webhooks/overview/#scoping-a-subscription-to-specific-phone-numbers) --- # message.sent outbound webhook | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-16-message-sent-webhook/#_top) message.sent outbound webhook ============================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-16-message-sent-webhook%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-16-message-sent-webhook%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 16, 2026 Webhooks Added -------------- [Section titled “Webhooks ”](https://docs.kirimdev.com/changelog/2026-06-16-message-sent-webhook/#webhooks-) New subscription event **`message.sent`** — fires after Meta accepts an outbound send and returns a `wamid`. Includes the full message body (text, template name, media caption), `session` (= `phone_number_id` for multi-number routing), `direction: outbound`, and `from_me: true`. **Sources covered** * Public API `POST /v1/{phone_number_id}/messages` * Dashboard composer * Broadcast template sends (`message.source: broadcast`) * Coexistence phone-app echoes (`message.source: app`) **Not a replacement for** * `message.status` — still use for `delivered` / `read` / `failed` transitions (Meta passthrough, no body) * Synchronous API response — still the fastest queue acknowledgement See [Event catalogue → message.sent](https://docs.kirimdev.com/webhooks/events/#messagesent) . --- # Automatic WhatsApp slots for setup-link onboarding | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-27-automatic-setup-link-slots/#_top) Automatic WhatsApp slots for setup-link onboarding ================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-27-automatic-setup-link-slots%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-27-automatic-setup-link-slots%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 27, 2026 Customer onboarding Changed --------------------------- [Section titled “Customer onboarding ”](https://docs.kirimdev.com/changelog/2026-09-27-automatic-setup-link-slots/#customer-onboarding-) Customer setup-link onboarding no longer stops immediately when the provider’s WhatsApp account quota is full. If the provider wallet can cover the prorated price, Kirimdev automatically purchases one **Extra WhatsApp Number** unit and continues connecting the account. The purchase remains provisional while Meta onboarding completes: * successful WABA webhook subscription commits the charge and slot; * a connection that has not succeeded within 30 minutes is disconnected, its provisional add-on unit is removed, and the original wallet amount is refunded automatically; * retries and concurrent setup links are serialized and idempotent, preventing duplicate purchases or refunds. * repeated resolve requests no longer invalidate each other’s browser session, and **Try again** obtains a fresh one-time nonce before reopening Meta. When wallet balance is insufficient, the callback continues to return `403 account_limit_reached`; no charge is made. --- # message.sent media_url for outbound attachments | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-21-message-sent-media-url/#_top) message.sent media\_url for outbound attachments ================================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-21-message-sent-media-url%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-21-message-sent-media-url%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 21, 2026 Webhooks Changed ---------------- [Section titled “Webhooks ”](https://docs.kirimdev.com/changelog/2026-06-21-message-sent-media-url/#webhooks-) The **`message.sent`** webhook now includes **`message.media_url`** and **`message.media_status`** for outbound media messages (image, video, audio, document, sticker), plus Meta-style nested blocks (`image.link`, `document.filename`, etc.) for integrators migrating from inbound parsers. * API and dashboard sends: `media_url` is the permanent `https://media.kirimdev.com/...` URL (same asset the inbox uses). * Public API sends now persist the outbound `link` on the message row at insert time so the webhook can include it (previously only passed to the worker queue). * Phone-app echoes: `message.sent` is deferred until storage upload completes (text echoes still fire immediately). Echo type is inferred from the media block (`image`, `video`, `audio`, `document`, `sticker`) so outbound media is not mislabeled as `text`. If download fails after retries, the webhook fires with `media_status: "failed"`. See [Event catalogue → message.sent](https://docs.kirimdev.com/webhooks/events/#messagesent) . --- # New `setup_link_inactive` error code replaces wrong-domain `webhook_subscription_disabled` on customer setup links | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-05-setup-link-inactive-error-code/#_top) New \`setup\_link\_inactive\` error code replaces wrong-domain \`webhook\_subscription\_disabled\` on customer setup links ========================================================================================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-setup-link-inactive-error-code%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-setup-link-inactive-error-code%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 5, 2026 `PATCH /v1/customers/{id}/setup_links/{link_id}` Changed -------------------------------------------------------- [Section titled “PATCH /v1/customers/{id}/setup\_links/{link\_id} ”](https://docs.kirimdev.com/changelog/2026-06-05-setup-link-inactive-error-code/#patch-v1customersidsetup_linkslink_id-) When the setup link being patched is no longer in the `active` state (it’s `consumed`, `expired`, or `revoked`), the API now returns the new `setup_link_inactive` error code instead of `webhook_subscription_disabled`. Status code stays `409 conflict`. `DELETE /v1/customers/{id}/setup_links/{link_id}` Changed --------------------------------------------------------- [Section titled “DELETE /v1/customers/{id}/setup\_links/{link\_id} ”](https://docs.kirimdev.com/changelog/2026-06-05-setup-link-inactive-error-code/#delete-v1customersidsetup_linkslink_id-) Same change for the revoke endpoint: a non-active link now surfaces as `setup_link_inactive` rather than the previous wrong-domain `webhook_subscription_disabled`. Why --- [Section titled “Why”](https://docs.kirimdev.com/changelog/2026-06-05-setup-link-inactive-error-code/#why) The old code was confusing for SDK consumers: receiving `webhook_subscription_disabled` while operating on a customer setup link suggested a webhook subscription was involved when it wasn’t. The new code lives in the same `conflict` bucket and carries identical retry semantics — generate a fresh setup link to recover. Migration --------- [Section titled “Migration”](https://docs.kirimdev.com/changelog/2026-06-05-setup-link-inactive-error-code/#migration) If you were branching on `error.code === 'webhook_subscription_disabled'` in your setup link integration, switch to `error.code === 'setup_link_inactive'`. Webhook subscription endpoints continue to return `webhook_subscription_disabled` as before — no change there. --- # Contextual replies on Public API sends | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-15-public-api-reply-context/#_top) Contextual replies on Public API sends ====================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-public-api-reply-context%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-public-api-reply-context%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 15, 2026 Public API Added ---------------- [Section titled “Public API ”](https://docs.kirimdev.com/changelog/2026-06-15-public-api-reply-context/#public-api-) `POST /v1/{phone_number_id}/messages` outbound sends now accept an optional top-level **`context`** object: "context": { "message_id": "wamid...." } Pass the inbound **wamid** from your webhook payload (`messages[0].id`) — not a Kirim `msg_*` external id. Works for all outbound send types (`text`, media, `template`, `interactive`). The reply appears as a quoted bubble on the recipient’s WhatsApp, same as Meta’s native contextual reply. TypeScript SDK Changed ---------------------- [Section titled “TypeScript SDK ”](https://docs.kirimdev.com/changelog/2026-06-15-public-api-reply-context/#typescript-sdk-) `SendMessageParams` includes optional `context?: { message_id: string }`. No new method — pass it on `phone.messages.send(...)`. n8n node Added -------------- [Section titled “n8n node ”](https://docs.kirimdev.com/changelog/2026-06-15-public-api-reply-context/#n8n-node-) `@kirimdev/n8n-nodes-kirim` v0.1.8 adds **Reply To Message ID (Wamid)** on every send operation (Text, Template, Image, Document, Video, Audio, Interactive). Wire it from the inbound trigger: `={{ $json.entry[0].changes[0].value.messages[0].id }}` --- # Voice note played status + played_at on messages | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-17-voice-played-status/#_top) Voice note played status + played\_at on messages ================================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-17-voice-played-status%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-17-voice-played-status%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 17, 2026 Public API — `played_at` on messages Added ------------------------------------------ [Section titled “Public API — played\_at on messages ”](https://docs.kirimdev.com/changelog/2026-06-17-voice-played-status/#public-api--played_at-on-messages-) Meta emits a `played` status webhook when a recipient **first plays** an outbound **voice note** (`audio` with `voice: true`). Kirimdev now stores that moment on the message row as `played_at` (ISO-8601) and returns it from `GET /v1/{phone_number_id}/messages/{id}` and list endpoints when present. The timestamp is taken from Meta’s `statuses[].timestamp` on the webhook (converted to UTC), not the worker’s processing time — so `played_at` aligns with the forwarded `message.status` payload your subscriber already receives. The delivery `status` field is unchanged — it still cycles `sent` → `delivered` → `read` (or `failed`). `played_at` is an independent engagement signal, not a replacement for `read`. Webhooks — `message.status` passthrough Changed ----------------------------------------------- [Section titled “Webhooks — message.status passthrough ”](https://docs.kirimdev.com/changelog/2026-06-17-voice-played-status/#webhooks--messagestatus-passthrough-) `message.status` events forwarded from Meta may now include `statuses[].status: "played"` for voice notes. Subscribers already receive the raw Meta JSON — no envelope change. Handle `played` in your status state machine alongside `sent`, `delivered`, `read`, and `failed`. Dashboard — voice played analytics Changed ------------------------------------------ [Section titled “Dashboard — voice played analytics ”](https://docs.kirimdev.com/changelog/2026-06-17-voice-played-status/#dashboard--voice-played-analytics-) The Analytics **Voice played** KPI now counts only outbound `audio` rows with a `played_at` stamp, and the percentage denominator on the **Messages** subject is **delivered voice notes** (`metadata.voice = true`), capped at 100%. The inbox mic indicator appears only on voice notes (not generic audio attachments). --- # Contact erasure now covers linked hosted-chat data | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-22-contact-erasure-covers-hosted-chat/#_top) Contact erasure now covers linked hosted-chat data ================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-22-contact-erasure-covers-hosted-chat%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-22-contact-erasure-covers-hosted-chat%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 22, 2026 Contact deletion Fixed ---------------------- [Section titled “Contact deletion ”](https://docs.kirimdev.com/changelog/2026-09-22-contact-erasure-covers-hosted-chat/#contact-deletion-) `DELETE /v1/{phone_number_id}/contacts/{id}` now applies the same permanent erasure boundary to any linked hosted-chat identity. In addition to the existing WhatsApp contact, conversation, and message cascade, Kirimdev removes linked Kichat display-name and phone snapshots, customer sessions, messages, and media records. Private media bytes are placed in a durable deletion queue before the database references disappear. The response shape and endpoint parameters are unchanged. Disconnecting a WhatsApp number is still non-destructive and does not erase hosted-chat history; only an explicit permanent contact deletion performs this erasure. --- # AI Agent labels now send contact.updated | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-08-ai-label-contact-updated/#_top) AI Agent labels now send contact.updated ======================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-08-ai-label-contact-updated%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-08-ai-label-contact-updated%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 8, 2026 AI Agent labels Fixed --------------------- [Section titled “AI Agent labels ”](https://docs.kirimdev.com/changelog/2026-10-08-ai-label-contact-updated/#ai-agent-labels-) When the AI Agent tagged a conversation, the label stayed on that conversation only. It was not added to the contact, and no `contact.updated` webhook was sent, so integrations that react to contact labels never saw it. AI-applied labels now behave like a label added from the dashboard or the public API: * The label is added to the conversation **and** to its contact. * One `contact.updated` event is sent with the contact’s current `labels`. * Re-applying a label the contact already has sends nothing. The event payload is unchanged. [contact.updated reference](https://docs.kirimdev.com/webhooks/events/#contactupdated) --- # Labels in contact and conversation responses | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-24-contact-conversation-labels/#_top) Labels in contact and conversation responses ============================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-24-contact-conversation-labels%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-24-contact-conversation-labels%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 24, 2026 Public API Changed ------------------ [Section titled “Public API ”](https://docs.kirimdev.com/changelog/2026-09-24-contact-conversation-labels/#public-api-) Contact and conversation resources now include a `labels` array in both list and detail responses: * `GET /v1/{phone_number_id}/contacts` * `GET /v1/{phone_number_id}/contacts/{id}` * `GET /v1/{phone_number_id}/conversations` * `GET /v1/{phone_number_id}/conversations/{id}` Each item contains the public label `id` (`lbl_...`), `name`, and `color`. Resources without labels return `labels: []`, so integrations do not need a separate null check. { "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "green" } ]} TypeScript SDK Changed ---------------------- [Section titled “TypeScript SDK ”](https://docs.kirimdev.com/changelog/2026-09-24-contact-conversation-labels/#typescript-sdk-) `@kirimdev/sdk@3.21.0` updates the generated `Contact`, `ContactListItem`, `Conversation`, and `ConversationListItem` types to expose the same `labels` array. MCP Changed ----------- [Section titled “MCP ”](https://docs.kirimdev.com/changelog/2026-09-24-contact-conversation-labels/#mcp-) `list_conversations`, `get_conversation`, `search_contacts`, `create_contact`, and `update_contact` responses now expose the same embedded labels. --- # Sends to a blocked contact are refused with contact_blocked | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-17-contact-blocked-error/#_top) Sends to a blocked contact are refused with contact\_blocked ============================================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-17-contact-blocked-error%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-17-contact-blocked-error%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 17, 2026 `POST /v1/{phone_number_id}/messages` Added ------------------------------------------- [Section titled “POST /v1/{phone\_number\_id}/messages ”](https://docs.kirimdev.com/changelog/2026-10-17-contact-blocked-error/#post-v1phone_number_idmessages-) Agents can block a contact on one WhatsApp number from the dashboard inbox. While the contact is blocked, every send to it on that number is refused before it reaches Meta: | `error.code` | When it fires | Recoverable? | | --- | --- | --- | | `contact_blocked` | An agent blocked the recipient on this WhatsApp number in the dashboard. Your other numbers are not affected. | Yes, once the contact is unblocked in the dashboard. Retrying without that will fail the same way. | { "error": { "type": "invalid_request_error", "code": "contact_blocked", "message": "This contact is blocked on this WhatsApp number. Unblock it in the dashboard to send messages.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} The same code is returned by the TypeScript SDK (as `InvalidRequestError` with `code: 'contact_blocked'`) and by the MCP message send tools. Block state is dashboard-only: it is not exposed on contact objects and there is no endpoint to block or unblock a contact. Customer `contact.*` webhook payloads do not change. --- # Enriched message.received webhooks | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-15-message-received-kirim-enrichment/#_top) Enriched message.received webhooks ================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-message-received-kirim-enrichment%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-message-received-kirim-enrichment%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 15, 2026 Webhooks Changed ---------------- [Section titled “Webhooks ”](https://docs.kirimdev.com/changelog/2026-06-15-message-received-kirim-enrichment/#webhooks-) `message.received` deliveries still use the Meta passthrough envelope (`object` + `entry[]`) so existing parsers keep working unchanged. A new optional top-level **`kirim`** block adds Kirimdev routing context: * `conversation_id`, `contact_id`, `message_id`, `phone_number_id` * `labels[]` — conversation labels at delivery time * `conversation.status`, `conversation.assigned_to` * `contact.name`, `contact.phone_number` (E.164 with `+`) * `media_url` — permanent `https://media.kirimdev.com/...` URL when the asset is ready (`null` for text messages) * `media_status` — `ready`, `failed`, `unavailable`, or `null` for text **Delivery timing** * **Text and other non-media messages** — webhook fires immediately (same latency as before). * **Inbound media** (image, video, audio, document, sticker) — webhook waits until the file is uploaded to Kirimdev storage so `kirim.media_url` is populated on the first delivery (~1–3 seconds typical). If the download exhausts retries, the webhook still fires with `media_status: "failed"` and `media_url: null` — use `GET /v1/{phone_number_id}/messages/{message_id}/media` as a fallback. The Meta `entry[]` shape is unchanged. Media bytes are **not** inlined in the Meta `image` / `document` object — only `id` and `mime_type`, same as Meta’s native webhook contract. TypeScript SDK Changed ---------------------- [Section titled “TypeScript SDK ”](https://docs.kirimdev.com/changelog/2026-06-15-message-received-kirim-enrichment/#typescript-sdk-) `MetaPassthroughBody` and `MessageReceivedKirimContext` are exported from `@kirimdev/sdk/webhooks`. The `kirim` field is optional — strict Meta-only parsers can ignore it. --- # Dropped the duplicate `token` field from customer setup link create responses | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-05-drop-duplicate-token-field/#_top) Dropped the duplicate \`token\` field from customer setup link create responses =============================================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-drop-duplicate-token-field%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-drop-duplicate-token-field%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 5, 2026 `POST /v1/customers/{id}/setup_links` Breaking ---------------------------------------------- [Section titled “POST /v1/customers/{id}/setup\_links ”](https://docs.kirimdev.com/changelog/2026-06-05-drop-duplicate-token-field/#post-v1customersidsetup_links-) The response no longer includes a `token` field. The plaintext token is still returned exactly once — embedded in the path of `setup_url`. Before: { "id": "csl_...", "object": "customer_setup_link", "setup_url": "https://app.kirimdev.com/onboard/csl_xxxxxxxxxxxxxxxxxxxxxxxxxxxx", "token": "csl_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"} After: { "id": "csl_...", "object": "customer_setup_link", "setup_url": "https://app.kirimdev.com/onboard/csl_xxxxxxxxxxxxxxxxxxxxxxxxxxxx"} Migration --------- [Section titled “Migration”](https://docs.kirimdev.com/changelog/2026-06-05-drop-duplicate-token-field/#migration) If you were reading `response.token` directly, switch to extracting it from `response.setup_url`: const url = new URL(response.setup_url)const token = url.pathname.split('/').pop() // 'csl_xxxxxxxx...' Or — preferably — just hand the entire `setup_url` to your end customer as-is. That’s what the field is for. `@kirimdev/sdk` Breaking ------------------------ [Section titled “@kirimdev/sdk ”](https://docs.kirimdev.com/changelog/2026-06-05-drop-duplicate-token-field/#kirimdevsdk-) Bumped to **3.3.0**. The `CustomerSetupLinkWithToken` interface no longer carries `token`. TypeScript will catch the migration for you at compile time. --- # One slow webhook endpoint no longer delays everyone's events | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-09-webhook-endpoint-isolation/#_top) One slow webhook endpoint no longer delays everyone's events ============================================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-webhook-endpoint-isolation%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-webhook-endpoint-isolation%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 9, 2026 Webhook delivery Changed ------------------------ [Section titled “Webhook delivery ”](https://docs.kirimdev.com/changelog/2026-10-09-webhook-endpoint-isolation/#webhook-delivery-) On October 9 an endpoint that stopped answering held a large share of our shared delivery capacity, and webhooks for other integrations were delayed by up to an hour. Events were not lost. Deliveries are now isolated per endpoint host: * At most **5 requests in flight** to one host. Further deliveries wait a few seconds before their attempt starts, without using up an attempt. * After **5 timeouts or connection errors in a row**, the host is treated as unresponsive for 30 seconds (doubling up to 5 minutes). Attempts due in that window fail with `error_code: "connection_error"` and an `error_message` starting with `Not sent`, without a request being made, and are retried on the normal schedule. The retry schedule, the 8-attempt limit, auto-disable and payloads are unchanged. Endpoints that answer within a couple of seconds are not affected. [Retries and unresponsive endpoints](https://docs.kirimdev.com/webhooks/retry/#unresponsive-endpoints) --- # Message status error details restored | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-09-message-status-error-passthrough/#_top) Message status error details restored ===================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-09-message-status-error-passthrough%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-09-message-status-error-passthrough%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 9, 2026 Meta status details Fixed ------------------------- [Section titled “Meta status details ”](https://docs.kirimdev.com/changelog/2026-09-09-message-status-error-passthrough/#meta-status-details-) Meta-emitted `message.status` webhooks now preserve the structured `statuses[].errors` block. Subscribers can read numeric delivery error codes such as `131049`, together with the title, message, details, trace id, and error subcode when Meta provides them. Status callbacks also preserve Meta’s `statuses[].pricing` fields, including `billable`, `type`, `category`, and `pricing_model`, plus legacy `statuses[].conversation` metadata when present. [View the payload format](https://docs.kirimdev.com/webhooks/payloads/#messagestatus--meta-passthrough) --- # MCP server adds OAuth sign-in | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-09-mcp-oauth/#_top) MCP server adds OAuth sign-in ============================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-mcp-oauth%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-mcp-oauth%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 9, 2026 MCP server Added ---------------- [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-10-09-mcp-oauth/#mcp-server-) `https://api.kirimdev.com/mcp` now supports OAuth 2.1 as defined by the MCP authorization spec (revision 2026-07-28). An OAuth-capable client only needs the URL: it opens a browser, you sign in to Kirimdev, pick the organization, and approve the permissions. * **Owners and admins only.** MCP tools act across the whole organization, so agents cannot authorize a client. Membership and role are checked on every request — removing or demoting a member cuts off their connections immediately. * **One organization per connection.** Members of several organizations choose one during sign-in. * **Scoped permissions:** `mcp:read` (read tools), `mcp:write` (contacts, labels, templates, customers, mark as read) and `mcp:send` (`send_message`), chosen with checkboxes on the consent page — sending is off unless you tick it. A call outside the granted scopes returns `403 insufficient_scope`, which lets the client ask you for more access. * **Client identity** uses OAuth Client ID Metadata Documents. Dynamic Client Registration is not offered; clients that only support it can keep using an API key. MCP server Changed ------------------ [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-10-09-mcp-oauth/#mcp-server--1) A request without credentials still returns `401` with the `missing_api_key` error, and now also carries a `WWW-Authenticate: Bearer resource_metadata="https://api.kirimdev.com/.well-known/oauth-protected-resource/mcp"` header so clients can discover the sign-in flow. Bearer API keys (`kdv_live_…`) work exactly as before. Every tool that changes data (`send_message`, `mark_as_read`, contact, label, template and customer writes, `start_bulk_label_by_message`) is now annotated `destructiveHint: true`; read tools stay `readOnlyHint: true`. Clients such as Claude therefore ask before each write instead of running it automatically. API-key and OAuth connections behave the same. Tool calls made over OAuth do not appear in the dashboard’s API request logs yet; API-key calls are logged as before. [Connect with OAuth](https://docs.kirimdev.com/tools/mcp/setup/#sign-in-with-oauth) --- # Pre-send compliance checks on POST /messages | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/#_top) 2026 Pre-send compliance checks on POST /messages ============================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-04-compliance-pre-send-checks%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-04-compliance-pre-send-checks%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 4, 2026 `POST /v1/{phone_number_id}/messages` Changed --------------------------------------------- [Section titled “POST /v1/{phone\_number\_id}/messages ”](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/#post-v1phone_number_idmessages-) The messages endpoint now runs **three pre-send checks** before enqueuing the WhatsApp send. Each check has a stable error code surfaced via the standard `422` error envelope, so you can branch on it without parsing the human-readable message. ### New error codes [Section titled “New error codes”](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/#new-error-codes) | `error.code` | When it fires | Recoverable? | | --- | --- | --- | | `marketing_opted_out` | The recipient stopped receiving marketing messages from your WhatsApp business (via the WhatsApp app menu). Only applies to template sends with category `MARKETING`. | No — wait for the customer to opt back in. The `user_preferences` webhook delivers a `resume` event when they do. | | `account_restricted` | Meta has restricted your WhatsApp account (policy violation, business-initiated messaging temporarily blocked, etc.). Check your account status in WhatsApp Manager. | Sometimes — depends on the restriction type and expiration. The dashboard banner surfaces the active restriction. | | `consent_required` | The recipient has not opted in to receive messages from your business. | No — collect opt-in via your own channel first. See [Get opt-in for WhatsApp](https://developers.facebook.com/docs/whatsapp/overview/getting-opt-in/)
on Meta’s developer docs. | | `upstream_error` | The WhatsApp account is disconnected. | Yes — reconnect the account via the dashboard. | ### Example 422 response [Section titled “Example 422 response”](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/#example-422-response) { "error": { "type": "invalid_request_error", "code": "marketing_opted_out", "message": "Customer has opted out of marketing messages.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### Why this matters [Section titled “Why this matters”](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/#why-this-matters) Previously, these conditions surfaced only after Meta rejected the send — usually as a `failed` status on the message resource a few seconds later. Catching them at request time has three benefits: * **No wasted quota** — your Meta-side rate budget is preserved. * **No quality-rating impact** — sends that Meta would have rejected for opt-out reasons would lower your phone number’s quality rating; we no longer expose your account to that risk. * **Synchronous feedback** — the calling code can show the right error UI immediately instead of polling for terminal status. Webhook events Added -------------------- [Section titled “Webhook events ”](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/#webhook-events-) The platform now subscribes to two more Meta webhook fields: * **`user_preferences`** — recipient opted out of (or back into) marketing messages on a per-business basis. Drives the `marketing_opted_out` check above. * **`account_alerts`** — Meta-side alerts on messaging limits, Official Business Account decisions, and profile-photo loss. Both feed into the dashboard notification bell and the WhatsApp account compliance banner. Make sure both fields are toggled ON in your Meta App Dashboard under WhatsApp → Configuration → Webhooks. SDK Changed ----------- [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-06-04-compliance-pre-send-checks/#sdk-) The TypeScript SDK has been re-synced against the latest OpenAPI spec. The `Message.error.code` field is now documented with the full known-code list. --- # Operator suspend now blocks outbound sends on customer-owned accounts | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-05-customer-suspended-enforcement/#_top) Operator suspend now blocks outbound sends on customer-owned accounts ===================================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-customer-suspended-enforcement%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-customer-suspended-enforcement%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 5, 2026 `POST /v1/{phone_number_id}/messages` Changed --------------------------------------------- [Section titled “POST /v1/{phone\_number\_id}/messages ”](https://docs.kirimdev.com/changelog/2026-06-05-customer-suspended-enforcement/#post-v1phone_number_idmessages-) When the WhatsApp account that owns `phone_number_id` is attached to a Customer (tenant-of-tenant on the [multi-tenant platform tier](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/) ) whose status is `suspended` or `archived`, the API now refuses the send up-front with a `422` and the new `customer_suspended` error code. Previously the operator-facing status flip had no runtime effect — the send went through. The check applies to every send surface: * `POST /v1/{phone_number_id}/messages` (Public API) * Dashboard send * Broadcasts — a suspended Customer aborts the broadcast at start AND mid-flight (the periodic compliance re-read picks up a suspension that lands during a long broadcast and stops further enqueues). ### New error code [Section titled “New error code”](https://docs.kirimdev.com/changelog/2026-06-05-customer-suspended-enforcement/#new-error-code) | `error.code` | When it fires | Recoverable? | | --- | --- | --- | | `customer_suspended` | The Customer that owns the sender WhatsApp account is `suspended` (operator-forced block) or `archived` (terminal soft-delete). | Yes for `suspended` — the operator clicks **Unsuspend** in the dashboard. No for `archived`. | ### Example 422 response [Section titled “Example 422 response”](https://docs.kirimdev.com/changelog/2026-06-05-customer-suspended-enforcement/#example-422-response) { "error": { "type": "invalid_request_error", "code": "customer_suspended", "message": "The customer account that owns this sender is suspended. Sends are blocked until the operator unsuspends the customer.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} Customer-owned accounts only — direct-org WhatsApp accounts (those NOT attached to a Customer row, i.e. `customer_id IS NULL`) are unaffected. Dashboard Added --------------- [Section titled “Dashboard ”](https://docs.kirimdev.com/changelog/2026-06-05-customer-suspended-enforcement/#dashboard-) The Customer detail page now exposes **Suspend** and **Unsuspend** buttons next to **Archive**. Suspend asks for confirmation (parallel to the Archive flow) since it stops every outgoing WhatsApp message from the Customer’s accounts until it’s reversed. SDK Changed ----------- [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-06-05-customer-suspended-enforcement/#sdk-) The TypeScript SDK OpenAPI snapshot has been refreshed. The `Message.error.code` known-values list now includes `customer_suspended`. No method changes — the existing `InvalidRequestError` already carries the new code as a string. --- # Faster Public API polling | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-19-conversation-list-polling/#_top) Faster Public API polling ========================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-19-conversation-list-polling%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-19-conversation-list-polling%2F%20and%20help%20me%20with%20the%20following%3A%20) Added Changed **Added** * `GET /v1/{phone_number_id}/conversations` accepts optional `updated_since` (ISO 8601) — returns only rows with `updated_at` strictly after the timestamp. * List responses include a weak **`ETag`** header. Send it back as **`If-None-Match`** on the next poll to receive **`304 Not Modified`** when the page is unchanged. * Short-lived **Redis cache** (8 s TTL, invalidated on conversation writes) for repeated identical list queries. * `GET /v1/{phone_number_id}/messages/{id}` — short-lived **Redis cache** (5–60 s TTL by status, invalidated on status transitions) and weak **`ETag`** / **`304 Not Modified`** for high-frequency status polls. No request changes required — existing pollers benefit automatically. **Changed** * **Business** plan orgs now map to the **Business HTTP API tier** (1 200 write/min, 12 000 read/min on `/v1/*`). Previously the plan name fell through to the Starter/default bucket (600 read/min). This does **not** change **Send Rate Limit** (`quota.messages_per_second`) — that quota remains whatever you set under Admin → Plans → Entitlements. See [Polling list endpoints](https://docs.kirimdev.com/concepts/polling/) for integration recipes. --- # Hermes integration docs clarified | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-23-hermes-docs-clarification/#_top) Hermes integration docs clarified ================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-23-hermes-docs-clarification%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-23-hermes-docs-clarification%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 23, 2026 Documentation Changed --------------------- [Section titled “Documentation ”](https://docs.kirimdev.com/changelog/2026-06-23-hermes-docs-clarification/#documentation-) The [Hermes Agent integration](https://docs.kirimdev.com/tools/hermes/) pages were updated to reflect the intended audience: * **Owners and trusted internal numbers** chat with Hermes on WhatsApp to drive Kirimdev (send templates, check inbox, etc.) through the Public API. * **Not** a customer-facing WhatsApp bot — customer threads stay in the Kirimdev inbox, n8n, or your own API integrations. Also removed the localhost API URL example from the setup guide; production gateways use `https://api.kirimdev.com/v1` by default. --- # MCP server supports protocol revision 2026-07-28 | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-13-mcp-protocol-2026-07-28/#_top) MCP server supports protocol revision 2026-07-28 ================================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-13-mcp-protocol-2026-07-28%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-13-mcp-protocol-2026-07-28%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 13, 2026 MCP server Changed ------------------ [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-08-13-mcp-protocol-2026-07-28/#mcp-server-) The remote MCP endpoint (`POST /mcp`) now speaks **MCP protocol revision `2026-07-28`** in addition to the 2025-era revisions it already served. A client that negotiates the newer revision — its handshake uses `server/discover` and a per-request `_meta` envelope instead of the 2025 `initialize` handshake — now connects successfully instead of being rejected with `Unsupported protocol version`. Nothing about the tools, authentication, rate limiting, or error envelopes changed. All 24 tools behave exactly as before, and clients speaking the 2025-era revisions keep working unchanged — a single endpoint serves both eras and picks the right one per connection. No action is required. If your MCP client recently started negotiating `2026-07-28` and saw connection failures, they are resolved. [MCP overview](https://docs.kirimdev.com/tools/mcp/) --- # Clearer undeliverable message errors | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-30-clearer-undeliverable-errors/#_top) Clearer undeliverable message errors ==================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-30-clearer-undeliverable-errors%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-30-clearer-undeliverable-errors%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 30, 2026 Actionable recipient errors Fixed --------------------------------- [Section titled “Actionable recipient errors ”](https://docs.kirimdev.com/changelog/2026-09-30-clearer-undeliverable-errors/#actionable-recipient-errors-) Messages rejected by Meta with error `131026` still return the stable `recipient_unavailable` code and are not retried automatically. The error message now lists the possible recipient-side causes documented by Meta: the number may not be registered on WhatsApp, the recipient may not have accepted the latest terms, or their WhatsApp version may be outdated. When Meta provides a more specific `details` value, Kirimdev preserves it. The raw provider code remains available as `provider_code: 131026` for diagnostics. [Review failed-send handling](https://docs.kirimdev.com/guides/failed-sends/) --- # WhatsApp reactions in Public API v1 | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-08-whatsapp-reactions/#_top) WhatsApp reactions in Public API v1 =================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-08-whatsapp-reactions%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-08-whatsapp-reactions%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 8, 2026 Outbound reactions Added ------------------------ [Section titled “Outbound reactions ”](https://docs.kirimdev.com/changelog/2026-09-08-whatsapp-reactions/#outbound-reactions-) `POST /v1/{phone_number_id}/messages` now accepts Meta-native reaction payloads with `type: "reaction"`, a target wamid at `reaction.message_id`, and an emoji. Send an empty emoji to remove the business reaction. The existing TypeScript SDK `messages.send()` method includes the reaction variant in its generated request type. Inbound reaction webhooks Fixed ------------------------------- [Section titled “Inbound reaction webhooks ”](https://docs.kirimdev.com/changelog/2026-09-08-whatsapp-reactions/#inbound-reaction-webhooks-) Inbound WhatsApp reactions now reach subscribed `message.received` webhooks. The payload retains Meta’s `reaction.message_id` and `reaction.emoji` shape, including an empty emoji when the customer removes a reaction. [Read the reaction guide](https://docs.kirimdev.com/sending/send-reactions/) --- # Guide — message correlation & tenant routing for platform mode | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-29-platform-message-correlation-guide/#_top) Guide — message correlation & tenant routing for platform mode ============================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-29-platform-message-correlation-guide%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-29-platform-message-correlation-guide%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 29, 2026 Message correlation & tenant routing guide Added ------------------------------------------------ [Section titled “Message correlation & tenant routing guide ”](https://docs.kirimdev.com/changelog/2026-08-29-platform-message-correlation-guide/#message-correlation--tenant-routing-guide-) Multi-tenant platforms (a SaaS onboarding many end-customers, each with their own WhatsApp number) repeatedly ask the same two questions: 1. A `message.status` webhook lands on my single URL — **which end-customer** does it belong to? 2. I sent a message and got a `msg_…` id, but the status webhooks speak `wamid.…` — **how do I link them?** The facts were already documented across the platform, event, and payload references; this new page pulls them into one deterministic, end-to-end recipe so you don’t have to stitch them together yourself. It covers: * Using **`phone_number_id`** (learned from `customer.onboarded`) as the join key from a tenant to every message event. * The two consumption models — one URL routed by `phone_number_id`, or one subscription per customer scoped by `phone_number_ids`. * Correlating **`msg_… ↔ wamid.…`** via `message.sent`, including that webhook order is not guaranteed (buffer status by `wamid`). * Failed sends: `wamid` for post-Meta failures, `msg_…` for pre-Meta failures, correlated directly. * What retention removes, and why you should persist the mapping yourself. No API or webhook behavior changed — this is documentation only. [Read the guide →](https://docs.kirimdev.com/platform/message-correlation/) --- # Clearer template validation errors | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-15-template-validation-details/#_top) Clearer template validation errors ================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-15-template-validation-details%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-15-template-validation-details%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 15, 2026 Meta validation details Fixed ----------------------------- [Section titled “Meta validation details ”](https://docs.kirimdev.com/changelog/2026-09-15-template-validation-details/#meta-validation-details-) Failed template creation requests now return the most specific explanation provided by Meta. When available, Kirimdev preserves Meta’s detailed reason, user-facing message and title instead of returning only the generic `Invalid parameter` message. The response remains an `invalid_field_value` error. Its `message` now helps identify the rejected component or parameter, while Kirimdev logs Meta’s trace ID and structured error metadata for support investigations. [Read the template creation guide](https://docs.kirimdev.com/sending/create-templates/) --- # BSUID identity-change ingestion & webhook accuracy | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-16-bsuid-identity-change-ingestion/#_top) BSUID identity-change ingestion & webhook accuracy ================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-16-bsuid-identity-change-ingestion%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-16-bsuid-identity-change-ingestion%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 16, 2026 `contact.identity_updated` on phone-number change Changed --------------------------------------------------------- [Section titled “contact.identity\_updated on phone-number change ”](https://docs.kirimdev.com/changelog/2026-08-16-bsuid-identity-change-ingestion/#contactidentity_updated-on-phone-number-change-) Meta now reports a WhatsApp user changing their phone number (and the BSUID rotation that comes with it) as a **system message** on the `messages` webhook — the older `user_id_update` field is no longer a subscribable event. Kirimdev ingests both: the contact’s row is migrated to the new BSUID (and phone, when Meta still shares it) in place, and the existing [`contact.identity_updated`](https://docs.kirimdev.com/webhooks/events/#contactidentity_updated) webhook fires exactly as before. If you subscribe to `contact.identity_updated`, no action is required — you keep receiving the same event with the same payload, now including rotations triggered by a phone-number change. The rotation never creates a new contact or a duplicate conversation: the BSUID is the stable anchor and the existing contact row is updated. Correct contact on batched webhooks Fixed ----------------------------------------- [Section titled “Correct contact on batched webhooks ”](https://docs.kirimdev.com/changelog/2026-08-16-bsuid-identity-change-ingestion/#correct-contact-on-batched-webhooks-) When Meta batches messages from **multiple senders** in a single webhook delivery (for example, group chats), each incoming message is now matched to its own contact — name, username, and BSUID. Previously every message in such a batch could be attributed to the first contact in the payload. Single-sender deliveries (the vast majority) are unaffected. Parent BSUID on status webhooks Fixed ------------------------------------- [Section titled “Parent BSUID on status webhooks ”](https://docs.kirimdev.com/changelog/2026-08-16-bsuid-identity-change-ingestion/#parent-bsuid-on-status-webhooks-) Outbound **delivered / read** status webhooks now correctly populate the parent BSUID for managed businesses enrolled in the parent BSUID program. Meta renamed this field on the wire (to `recipient_parent_user_id`); we now read the current name, so the value is no longer silently dropped. This only affects parent-BSUID-enrolled portfolios; regular accounts see no change. [Webhook events](https://docs.kirimdev.com/webhooks/events/) --- # Disconnect a customer's WhatsApp account over the Public API | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-09-disconnect-customer-whatsapp-account/#_top) Disconnect a customer's WhatsApp account over the Public API ============================================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-09-disconnect-customer-whatsapp-account%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-09-disconnect-customer-whatsapp-account%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 9, 2026 `DELETE /v1/customers/{id}/whatsapp_accounts/{phone_number_id}` Added --------------------------------------------------------------------- [Section titled “DELETE /v1/customers/{id}/whatsapp\_accounts/{phone\_number\_id} ”](https://docs.kirimdev.com/changelog/2026-08-09-disconnect-customer-whatsapp-account/#delete-v1customersidwhatsapp_accountsphone_number_id-) Customers connect their own WhatsApp number through a [setup link](https://docs.kirimdev.com/platform/setup-links/) . Until now, once connected, the only way to remove that number was from the dashboard. You can now do it over the Public API. Identify the account by the `phone_number_id` returned in `GET /v1/customers/{id}` (the `whatsapp_accounts[].phone_number_id` field), then delete it: curl -sS -X DELETE \ 'https://api.kirimdev.com/v1/customers/cus_335T08.../whatsapp_accounts/1111475158712095' \ -H 'Authorization: Bearer kdv_live_xxx' { "data": { "phone_number_id": "1111475158712095", "object": "whatsapp_account", "disconnected": true }, "request_id": "req_..."} This mirrors removing the account from the dashboard: the number is best-effort unsubscribed from Meta webhooks, the account is soft-deleted, and a full purge of its data is scheduled. The call is **scoped to the customer** — you can only disconnect an account the addressed customer owns — and **idempotent**: once the account is gone, a repeat call returns `404 resource_not_found`. ### SDK support [Section titled “SDK support”](https://docs.kirimdev.com/changelog/2026-08-09-disconnect-customer-whatsapp-account/#sdk-support) `@kirimdev/sdk` ≥ 3.16.0 exposes it as `kirim.customers.disconnectWhatsappAccount`: await kirim.customers.disconnectWhatsappAccount( 'cus_335T08RM0EAKN9DTE6RD5RWP7B', '1111475158712095',) [Read the Customers docs →](https://docs.kirimdev.com/platform/customers/#disconnecting-an-account) --- # /v1/me now returns the org's teams | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-14-me-teams/#_top) /v1/me now returns the org's teams ================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-14-me-teams%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-14-me-teams%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 14, 2026 `GET /v1/me` Added ------------------ [Section titled “GET /v1/me ”](https://docs.kirimdev.com/changelog/2026-06-14-me-teams/#get-v1me-) The introspection endpoint now returns the **list of teams under the calling organization** alongside the existing `organization`, `api_key`, and `rate_limits` blocks. Each entry surfaces the internal `id` you must pass as `team_id` on team-scoped writes. { "data": { "organization": { "id": "org_…", "object": "organization", "name": "Acme" }, "api_key": { "id": "key_…", "object": "api_key", "label": "prod", "last4": "abcd" }, "rate_limits": { "tier": "default", "write_per_minute": 60, "read_per_minute": 600 }, "teams": [ { "id": "team_01H…", "object": "team", "name": "Default", "slug": "default" }, { "id": "team_01J…", "object": "team", "name": "Sales", "slug": "sales" } ] }, "request_id": "req_…"} ### Why [Section titled “Why”](https://docs.kirimdev.com/changelog/2026-06-14-me-teams/#why) `POST /v1/customers` (and other team-scoped writes) requires a `team_id` whenever the org has more than one team. Until now there was no programmatic way to enumerate those ids — integrators had to copy them out of the dashboard. `/me` is the natural discovery point and now makes onboarding flows fully self-service. Behaviour matrix for `team_id` resolution stays the same: | Org has | `team_id` omitted | `team_id` provided | | --- | --- | --- | | 1 team | Auto-selected | Validated; rejected if cross-org | | 2+ teams | `400 missing_required_field`, `param: team_id` | Validated; rejected if cross-org | | 0 teams | `400 invalid_field_value` | (same) | ### SDK support [Section titled “SDK support”](https://docs.kirimdev.com/changelog/2026-06-14-me-teams/#sdk-support) `@kirimdev/sdk` ≥ 3.5.0 exposes the new array on the typed `MeContext` returned by `kirim.me()`: const ctx = await kirim.me() const teamId = ctx.teams.length === 1 ? ctx.teams[0]!.id : promptUserToPickATeam(ctx.teams) await kirim.customers.create({ name: 'Acme', team_id: teamId }) A new exported type `MePublicTeam` covers the per-entry shape if you need to pass the list around in your own code. ### Compatibility [Section titled “Compatibility”](https://docs.kirimdev.com/changelog/2026-06-14-me-teams/#compatibility) This change is **purely additive**. Existing consumers ignoring the extra field continue to work without modification — no breaking changes to any other field on the `/me` response. [Read the Authentication docs →](https://docs.kirimdev.com/authentication/) --- # MCP adds safe bulk labeling by message keyword | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-01-mcp-bulk-label-by-message/#_top) MCP adds safe bulk labeling by message keyword ============================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-01-mcp-bulk-label-by-message%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-01-mcp-bulk-label-by-message%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 1, 2026 MCP server Added ---------------- [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-10-01-mcp-bulk-label-by-message/#mcp-server-) Three tools add a preview-first workflow for large contact selections: * `preview_bulk_label_by_message` snapshots contacts whose **inbound** messages contain a literal keyword in a required date range. * `start_bulk_label_by_message` starts that exact snapshot after confirmation. * `get_bulk_label_job` reports asynchronous progress and the final changed / unchanged counts. The preview never returns message bodies. Keywords must contain at least three characters, date ranges are capped at 366 days, previews expire after 15 minutes, and operations are capped at 10,000 contacts. Larger matches must be narrowed before they can start. Bulk writes run in bounded 250-contact transactions with one worker operation at a time per WhatsApp account. Retries are idempotent, so a worker restart cannot create duplicate label attachments. The MCP surface now contains **27 tools**. The existing single-contact `add_contact_label` and `remove_contact_label` tools remain unchanged. [Review the bulk-label tools](https://docs.kirimdev.com/tools/mcp/tools/#preview_bulk_label_by_message) [Prompting guide](https://docs.kirimdev.com/tools/mcp/prompting/) --- # Create templates with media header from public URL | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-17-create-template-media-url/#_top) Create templates with media header from public URL ================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-17-create-template-media-url%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-17-create-template-media-url%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 17, 2026 Templates Changed ----------------- [Section titled “Templates ”](https://docs.kirimdev.com/changelog/2026-06-17-create-template-media-url/#templates-) ### Media header samples via public URL [Section titled “Media header samples via public URL”](https://docs.kirimdev.com/changelog/2026-06-17-create-template-media-url/#media-header-samples-via-public-url) `POST /v1/{phone_number_id}/templates` now resolves **IMAGE / VIDEO / DOCUMENT** header samples from a public **`https://` URL**: * **Preferred:** `example.header_url: ["https://…"]` * **Compatible:** the same URL in `example.header_handle` (existing integrations that already sent a Supabase/CDN link) Kirimdev downloads the file, uploads it to Meta’s Resumable Upload API using the connected account’s credentials, and submits the resulting asset handle to Meta. No Meta access token or manual upload step is required on the integrator side. Pass-through of an existing Meta handle (`4::…`) in `example.header_handle` is unchanged. ### Clearer errors on create [Section titled “Clearer errors on create”](https://docs.kirimdev.com/changelog/2026-06-17-create-template-media-url/#clearer-errors-on-create) When Meta rejects template **content** or the header media URL is invalid, the API now returns **`400 invalid_field_value`** (`param: "components"`) instead of a generic **`502 whatsapp_upstream_error`**. Transient upstream failures still map to 502. ### Documentation [Section titled “Documentation”](https://docs.kirimdev.com/changelog/2026-06-17-create-template-media-url/#documentation) New guide: [Create templates](https://docs.kirimdev.com/sending/create-templates/) — distinguishes creation (`example.header_url`) from send-time header media (`image.link`). [Create templates guide](https://docs.kirimdev.com/sending/create-templates/) --- # Complete contact and conversation pagination | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-01-contact-conversation-pagination/#_top) Complete contact and conversation pagination ============================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-01-contact-conversation-pagination%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-01-contact-conversation-pagination%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 1, 2026 Reliable bulk-list traversal Fixed ---------------------------------- [Section titled “Reliable bulk-list traversal ”](https://docs.kirimdev.com/changelog/2026-10-01-contact-conversation-pagination/#reliable-bulk-list-traversal-) `GET /v1/{phone_number_id}/contacts` and `GET /v1/{phone_number_id}/conversations` now preserve full timestamp precision inside their opaque cursors. Previously, a large import or history sync could create many rows within the same millisecond. A cursor at that boundary could skip some of those rows even though they remained retrievable through an exact filter. Iterating until `has_more` is `false` now returns every matching row without that gap. No client changes are required. Continue passing each `next_cursor` value back verbatim and do not parse or modify it. [Review pagination semantics](https://docs.kirimdev.com/concepts/pagination/) --- # Template parameters are checked before sending | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-10-09-template-parameter-checks/#_top) Template parameters are checked before sending ============================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-template-parameter-checks%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-10-09-template-parameter-checks%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** October 9, 2026 Sending templates Changed ------------------------- [Section titled “Sending templates ”](https://docs.kirimdev.com/changelog/2026-10-09-template-parameter-checks/#sending-templates-) `POST /v1/{phone_number_id}/messages` with `type: "template"` now compares your `components` with the approved template before accepting the request. Previously these sends returned `202` and failed a moment later with a generic Meta error such as `100` or `132000`. The request is rejected with `400 invalid_request_error`, code `invalid_field_value`, when: * the `header` or `body` parameter count differs from the template; * a `text` parameter is missing, `null`, or blank; * a `text` parameter contains a newline, a tab, or more than 4 consecutive spaces; * a media header or a URL button with a variable has no value. The message names the component, for example `URL button "Pay now" (index 0) requires a parameter.` No message or contact is created for a rejected request. Sends that match the template are unchanged. Authentication and carousel templates, and templates Kirimdev has not synced yet, are not checked here. [Parameter checks before sending](https://docs.kirimdev.com/sending/send-templates/#parameter-checks-before-sending) --- # Webhooks for pre-delivery send failures + longer transient retries | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-09-pre-meta-failed-webhook/#_top) Webhooks for pre-delivery send failures + longer transient retries ================================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-09-pre-meta-failed-webhook%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-09-pre-meta-failed-webhook%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 9, 2026 Pre-delivery failures now emit `message.status` Added ----------------------------------------------------- [Section titled “Pre-delivery failures now emit message.status ”](https://docs.kirimdev.com/changelog/2026-08-09-pre-meta-failed-webhook/#pre-delivery-failures-now-emit-messagestatus-) Some outbound sends fail **before Meta ever admits the message** — a transient Meta outage (error `131000`), a quota/entitlement refusal, an account cooldown, or a compliance block. Meta issues no `wamid` and sends **no status webhook** for these, so previously the only way to learn about them was to poll `GET /v1/messages/{id}`. A webhook consumer would see the send accepted and never hear that it failed. `message.status` now synthesizes a `failed` event for these cases, so you get the same push signal you already get for a Meta-emitted failure. Two differences to code for: * **`statuses[0].id` is the Kirimdev `msg_…` id**, not a `wamid.…` — none exists. It equals the `id` returned by your original send call, so correlation is direct. * **`errors[0].code`** is Meta’s integer code when the failure came back from Meta (e.g. `131000`); for a Kirimdev-side refusal it is the sentinel `-1`. Map either to a stable Kirimdev code via the [error catalogue](https://docs.kirimdev.com/concepts/errors/) . Longer retries for transient Meta failures Changed -------------------------------------------------- [Section titled “Longer retries for transient Meta failures ”](https://docs.kirimdev.com/changelog/2026-08-09-pre-meta-failed-webhook/#longer-retries-for-transient-meta-failures-) Transient Meta errors like `131000` (“Something went wrong”) are often a brief server-side blip that clears in minutes. They previously exhausted their retries within seconds and surfaced as a permanent failure. They now retry on a longer schedule — roughly **1 min → 2 min → 4 min → 8 min** (about a 15-minute window) — before the terminal `failed` event fires, so a short Meta outage resolves itself instead of stranding the message. [Webhook event reference →](https://docs.kirimdev.com/webhooks/events/#messagestatus) [Handling failed sends](https://docs.kirimdev.com/guides/failed-sends/) --- # MCP server gains label tools | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-24-mcp-label-tools/#_top) MCP server gains label tools ============================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-24-mcp-label-tools%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-24-mcp-label-tools%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 24, 2026 MCP server Added ---------------- [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-06-24-mcp-label-tools/#mcp-server-) Six label tools join the Kirimdev MCP server — the surface grows from **18 to 24 tools**. Attach and detach are **contact-scoped only**: Kirimdev already syncs contact labels to every conversation for that contact, so exposing a second conversation-label tool would duplicate behavior and confuse assistants. The new tools: * **`list_labels`** — discover `lbl_...` ids across the org * **`create_label`** / **`update_label`** / **`delete_label`** — label CRUD * **`add_contact_label`** / **`remove_contact_label`** — attach or detach on a contact (syncs to conversations) They wrap the existing `/v1/labels` and contact label REST endpoints. No Public API or SDK changes — MCP-only. [Browse all 24 MCP tools](https://docs.kirimdev.com/tools/mcp/tools/) [MCP overview](https://docs.kirimdev.com/tools/mcp/) --- # Webhook deliveries now tell you why they failed | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/#_top) Webhook deliveries now tell you why they failed =============================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-26-webhook-delivery-failure-reason%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-26-webhook-delivery-failure-reason%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** July 26, 2026 Delivery failures are no longer ambiguous Added ----------------------------------------------- [Section titled “Delivery failures are no longer ambiguous ”](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/#delivery-failures-are-no-longer-ambiguous-) A dead webhook delivery used to give you a status code and, sometimes, a snippet of a response body. When the failure had nothing to do with an HTTP response — a timeout, a refused connection, or us declining to send at all — you got nothing useful. Worse, our own internal reason was written into `response_body_snippet` and displayed under the label “Response body”, so a message like `Subscription is disabled` looked like something your own server had said. Every delivery object now carries two new fields: { "id": "wbd_...", "object": "webhook_delivery", "status": "dead", "attempt_count": 6, "response_status": null, "response_body_snippet": null, "error_code": "timeout", "error_message": "The operation was aborted due to timeout", ...} `response_status` and `response_body_snippet` now mean exactly one thing: what **your** endpoint returned. If they are `null`, your endpoint never answered — and `error_code` says why. ### Error codes [Section titled “Error codes”](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/#error-codes) | `error_code` | What happened | | --- | --- | | `http_error` | Your endpoint answered with a non-2xx status. `response_status` holds it. | | `timeout` | Your endpoint accepted the connection but did not answer within 10 seconds. | | `connection_error` | We could not reach your endpoint at all — DNS, firewall, TLS, or a reset socket. | | `subscription_inactive` | Not sent. The subscription was `paused` or `disabled` when the attempt came due. | | `subscription_deleted` | Not sent. The subscription was deleted before the event could be delivered. | | `ssrf_blocked` | Not sent. The target URL resolves to a private or internal address. | | `no_signing_secret` | Not sent. Every signing secret on the subscription had expired. | The first three mean your endpoint is involved. The rest mean the request never left our side, so there is nothing to debug on yours — fix the subscription and replay. `error_code` is `null` on a successful delivery, including one that succeeded after earlier attempts failed. Retry history is no longer destroyed Fixed ------------------------------------------ [Section titled “Retry history is no longer destroyed ”](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/#retry-history-is-no-longer-destroyed-) When a delivery was terminated for an internal reason — most commonly because the subscription had been auto-disabled while its retries were still scheduled — we rewrote the row as if it had never been sent: `attempt_count` reset to `0`, and `response_status`, `duration_ms` and `response_body_snippet` cleared. That is fixed. Terminating a delivery now preserves the real `attempt_count` and whatever the last genuine attempt recorded. A delivery that failed six times against your endpoint before the subscription was disabled now reports `attempt_count: 6` and the status your server actually returned, alongside `error_code: "subscription_inactive"`. Rows written before this release are not repaired — the data was not stored. Deliveries created from now on are accurate. Auto-disable is now traceable Added ----------------------------------- [Section titled “Auto-disable is now traceable ”](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/#auto-disable-is-now-traceable-) Webhook subscription objects gain `last_disabled_at` and `last_disabled_reason`: { "id": "wbs_...", "object": "webhook_subscription", "status": "active", "disabled_reason": null, "last_disabled_at": "2026-07-24T08:14:33Z", "last_disabled_reason": "auto_disabled_max_consecutive_failures", ...} `disabled_reason` describes the _current_ state and is cleared when you re-enable a subscription. The `last_disabled_*` pair is history and is never cleared, so you can still tell that a subscription was auto-disabled after you have recovered it — and correlate the outage window with your own logs. A reminder of the policy behind it: 20 consecutive failed **attempts** (not deliveries) flip a subscription to `disabled`. Because one delivery can burn up to 8 attempts, an endpoint that reliably times out can trip the threshold in as few as three events. SDK Changed ----------- [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/#sdk-) `@kirimdev/sdk@3.15.0` picks up all four fields through the refreshed `openapi.json` snapshot. No method signatures changed, so upgrading is a version bump and nothing else. One thing to know if you build `WebhookDelivery` objects by hand — test fixtures, mocks — `error_code` and `error_message` are required on the response type, so those literals need the two new keys. const delivery = await kirim.webhookDeliveries.retrieve('wbd_...') if (delivery.error_code === 'timeout') { // your endpoint was too slow — check the handler, not the payload} else if (delivery.error_code === 'subscription_inactive') { // nothing was sent; re-enable the subscription, then replay} Dashboard Changed ----------------- [Section titled “Dashboard ”](https://docs.kirimdev.com/changelog/2026-07-26-webhook-delivery-failure-reason/#dashboard-) Developers → Deliveries shows a dedicated **Failure reason** block with plain-language copy for each error code, kept separate from the response body. The list view falls back to the error code in the **Resp** column when there is no HTTP status, so failures are readable without opening every row. [Read about retries and the DLQ →](https://docs.kirimdev.com/webhooks/retry/) --- # Customers — multi-tenant platform mode | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/#_top) 2026 Customers — multi-tenant platform mode ====================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-customers-multi-tenant-platform%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-05-customers-multi-tenant-platform%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 5, 2026 `/v1/customers/*` Added ----------------------- [Section titled “/v1/customers/\* ”](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/#v1customers-) Kirimdev now supports **multi-tenant platform mode**: your organization can model its own end-customers (logistics companies, salons, stores, …) as first class objects, hand each one a setup link, and have them connect their own WhatsApp Business number without ever logging in to the Kirimdev dashboard. After onboarding, you send messages on each customer’s behalf via the same `/v1/{phone_number_id}/messages` endpoint you already use. > A **Customer** here is NOT a WhatsApp chat partner — those remain on the `/v1/{phone_number_id}/contacts` resource. A Customer is one of _your_ tenants, owning zero or more WhatsApp accounts. ### New endpoints [Section titled “New endpoints”](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/#new-endpoints) | Method | Path | Description | | --- | --- | --- | | `GET` | `/v1/customers` | List end-customers | | `POST` | `/v1/customers` | Create a customer | | `GET` | `/v1/customers/{id}` | Retrieve (includes assigned WhatsApp accounts) | | `PATCH` | `/v1/customers/{id}` | Update name / email / metadata / status | | `DELETE` | `/v1/customers/{id}` | Soft-archive | | `GET` | `/v1/customers/{id}/setup_links` | List setup links | | `POST` | `/v1/customers/{id}/setup_links` | Generate a setup link (token returned ONCE) | | `DELETE` | `/v1/customers/{id}/setup_links/{link_id}` | Revoke a still-active link | ### New MCP tools [Section titled “New MCP tools”](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/#new-mcp-tools) The official MCP server (`POST /mcp`) gains five new tools: * `list_customers` * `get_customer` * `create_customer` * `update_customer` * `create_customer_setup_link` ### SDK support [Section titled “SDK support”](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/#sdk-support) `@kirimdev/sdk` ≥ 3.3.0 exposes the new resource as `kirim.customers` (versions 3.2.x shipped the same surface, but the create-setup-link response previously also carried a redundant `token` field that was dropped in 3.3.0 — see [the 2026-06-05 drop note](https://docs.kirimdev.com/changelog/2026-06-05-drop-duplicate-token-field/) ): const customer = await kirim.customers.create({ name: 'Acme Logistics', email: 'admin@acme.io', metadata: { crm_id: 'C-1234', branch: 'Jakarta' },}) const link = await kirim.customers.createSetupLink(customer.id, { expires_in_hours: 168,})console.log('Send this URL to your customer:', link.setup_url)// → https://app.kirimdev.com/onboard/csl_xxxxxxxxxxxxxxxxxxxxxxxxxxxx ### Webhooks [Section titled “Webhooks”](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/#webhooks) No new webhook event types in this release. The existing `whatsapp_account.connected` event fires when a customer’s onboarding completes — the payload now includes `customer_id` so your worker can attribute the new number to the right tenant immediately. ### Rollout [Section titled “Rollout”](https://docs.kirimdev.com/changelog/2026-06-05-customers-multi-tenant-platform/#rollout) **Updated 2026-06-05:** Gating moved from an env flag to plan-driven entitlements. The Customers feature is now available on the **Business plan** and above; Pro and Starter requests return HTTP 402 with `code: "feature_not_entitled"`. [Read the Platform docs →](https://docs.kirimdev.com/platform/) --- # Message history is now deleted after your plan's retention window | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-02-message-retention/#_top) Message history is now deleted after your plan's retention window ================================================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-02-message-retention%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-02-message-retention%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 2, 2026 Message retention Changed ------------------------- [Section titled “Message retention ”](https://docs.kirimdev.com/changelog/2026-08-02-message-retention/#message-retention-) Every plan has always advertised a history retention window — `quota.history_retention_days`. It is now enforced. Messages older than that window are **permanently deleted**, together with the inbound media Kirimdev downloaded for them. | Plan | History retained | | --- | --- | | Starter | 90 days | | Pro | 365 days | | Business | 365 days | Read `quota.history_retention_days` rather than hard-coding a number; your account may be on a custom value, and `-1` means unlimited. ### What this changes for integrations [Section titled “What this changes for integrations”](https://docs.kirimdev.com/changelog/2026-08-02-message-retention/#what-this-changes-for-integrations) `GET` endpoints that read message history return only what is still stored. A range older than your window comes back empty or partial. That is a successful response, not an error, and it is indistinguishable from a period in which nothing was sent. `media_url` on a deleted message stops resolving. If you rely on those files, mirror them to your own storage. Webhooks are unaffected — they fire when the event happens, long before any message approaches the window. ### What is not deleted [Section titled “What is not deleted”](https://docs.kirimdev.com/changelog/2026-08-02-message-retention/#what-is-not-deleted) Deletion is scoped to messages and does not cascade: * **Contacts** and **conversations** remain intact. A conversation is one phone number and it stays in your inbox; only its old messages go. * **Media Library** files keep their own lifecycle and storage quota. They are never removed by retention, even when a message that used them is. * **Broadcast campaigns** and their per-recipient records are untouched. ### Analytics survive [Section titled “Analytics survive”](https://docs.kirimdev.com/changelog/2026-08-02-message-retention/#analytics-survive) Aggregate metrics — volume, delivery funnel, per-template performance — stay available for periods whose messages have been deleted. Daily counters are captured before deletion so charts do not go blank as history ages out. Response-time metrics are the exception: they pair two specific messages and cannot be rebuilt from counters, so they are reported only for the period still inside your window. [Read the full retention guide](https://docs.kirimdev.com/concepts/message-retention/) --- # A past-due subscription no longer reports itself as a quota problem | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-01-subscription-inactive-message-error/#_top) A past-due subscription no longer reports itself as a quota problem =================================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-01-subscription-inactive-message-error%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-01-subscription-inactive-message-error%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 1, 2026 `subscription_inactive` on failed messages Added ------------------------------------------------ [Section titled “subscription\_inactive on failed messages ”](https://docs.kirimdev.com/changelog/2026-08-01-subscription-inactive-message-error/#subscription_inactive-on-failed-messages-) When a Kirimdev subscription is expired, canceled, or past due, every quota on the account resolves to zero and outbound sends are refused before they reach Meta. Until now that refusal was reported as: { "status": "failed", "error": { "code": "invalid_request", "message": "Monthly message quota exceeded for this organization.", "provider_code": null }} Both halves were misleading. `invalid_request` reads as “your payload is malformed”, and the message pointed at a monthly allowance that was in fact untouched — on the 1st of the month the counter had already reset and sends still failed, because the limit was zero, not the usage. Failed messages from this cause now carry a code of their own: { "status": "failed", "error": { "code": "subscription_inactive", "message": "Subscription is not active (expired or past due). Settle the outstanding invoice to resume sending.", "provider_code": null }} `provider_code` is always `null` — the request never leaves our infrastructure. This is the same code the synchronous API already returns as HTTP 402 when a lapsed subscription blocks a write, so one branch in your code now covers both the immediate rejection and the asynchronous message failure. ### Not the same as `billing_issue` [Section titled “Not the same as billing\_issue”](https://docs.kirimdev.com/changelog/2026-08-01-subscription-inactive-message-error/#not-the-same-as-billing_issue) Two different bills, two different fixes: | Code | Who is owed | Where you fix it | | --- | --- | --- | | `subscription_inactive` | Kirimdev | Billing → pay the outstanding invoice | | `billing_issue` | Meta (`provider_code: 131042`) | Meta Business Suite → add or repair the WABA payment method | ### Retry behavior [Section titled “Retry behavior”](https://docs.kirimdev.com/changelog/2026-08-01-subscription-inactive-message-error/#retry-behavior) `subscription_inactive` is terminal until someone pays. Backoff will not clear it, so treat it as an alert rather than a retry: every attempt fails identically while the subscription is lapsed. Genuine quota exhaustion is unchanged — it still returns `invalid_request` with the monthly-quota message, and still clears at the start of the next calendar month (UTC). Dashboard Changed ----------------- [Section titled “Dashboard ”](https://docs.kirimdev.com/changelog/2026-08-01-subscription-inactive-message-error/#dashboard-) A message that failed this way used to show the badge “Permintaan tidak valid” with the quota text underneath. It now reads “Langganan belum aktif” and tells the operator to settle the invoice, so the message is no longer mistaken for a malformed request or a limit that will lift on its own. Broadcast recipients failed by the same gate now record the reason too; previously the code column was left empty, which hid the cause from the admin failed-messages view. [Handling failed sends →](https://docs.kirimdev.com/guides/failed-sends/) --- # Setup links | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/setup-links/#_top) Concepts Setup links =========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fsetup-links%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fsetup-links%2F%20and%20help%20me%20with%20the%20following%3A%20) A **setup link** is a one-time URL you hand to your end-customer so they can connect their own WhatsApp Business number to your Kirimdev platform. The customer never needs a Kirimdev login. https://app.kirimdev.com/onboard/csl_3V3EMgPDU4zCTm7Fju7KWvqb └────── plaintext token ──────┘ | | | | --- | --- | | Resource type | `customer_setup_link` | | Public id prefix | `csl_` (used for the id AND the token) | | Scope | One specific customer (`cus_…`) | | Lifetime | 1 hour to 30 days; default 7 days | | Usage | Single-use — consumed once and never re-usable | Token format ------------ [Section titled “Token format”](https://docs.kirimdev.com/platform/setup-links/#token-format) A plaintext token is **`csl_` followed by 24 base64url characters**: csl_3V3EMgPDU4zCTm7Fju7KWvqb That’s ~144 bits of entropy (`randomBytes(18).toString('base64url')`). Prefix lookups + argon2id verification make brute force impractical without also bypassing the [per-token rate limit](https://docs.kirimdev.com/platform/setup-links/#per-token-rate-limit) . Fields ------ [Section titled “Fields”](https://docs.kirimdev.com/platform/setup-links/#fields) | Field | Type | Description | | --- | --- | --- | | `id` | string | Public id, `csl_…`. **Different from the token plaintext.** Used to revoke or patch the link. | | `object` | literal | Always `'customer_setup_link'` | | `customer_id` | string | Internal id of the owning customer (not the `cus_…` public id — historical artifact). | | `status` | enum | `active`, `consumed`, `expired`, or `revoked`. | | `token_last4` | string | Last 4 chars of the plaintext, for UI hint (”…Wvqb”). | | `expires_at` | string | ISO 8601. Hard ceiling 30 days from creation. | | `consumed_at` | string \| null | ISO 8601 of successful Embedded Signup completion. Only set when `status = 'consumed'`. | | `success_redirect_url` | string \| null | See [Redirect URLs](https://docs.kirimdev.com/platform/redirect-urls/)
. | | `failure_redirect_url` | string \| null | See [Redirect URLs](https://docs.kirimdev.com/platform/redirect-urls/)
. | | `created_at` | string | ISO 8601. | The create response **adds** two write-once fields: | Field | Type | Description | | --- | --- | --- | | `token` | string | Plaintext token (`csl_…24chars`). **Persist immediately or discard.** | | `setup_url` | string | Full URL ready to hand to the customer. | Lifecycle --------- [Section titled “Lifecycle”](https://docs.kirimdev.com/platform/setup-links/#lifecycle) A setup link is born `active` and exits into one of three terminal states. There are no other transitions. | Status | Meaning | Terminal? | | --- | --- | --- | | `active` | Newly created. The customer can resolve and consume it. | No | | `consumed` | The end-customer completed Embedded Signup. A WhatsApp account row was inserted and its id recorded in `consumed_by_account_id`. | Yes | | `expired` | `expires_at` passed. Flipped lazily on the next resolve attempt. | Yes | | `revoked` | Operator manually invalidated the link via `DELETE`. | Yes | ### Transitions [Section titled “Transitions”](https://docs.kirimdev.com/platform/setup-links/#transitions) | From | To | Trigger | | --- | --- | --- | | `(new)` | `active` | `POST /v1/customers/{id}/setup_links` | | `active` | `consumed` | End-customer completes Meta Embedded Signup via the link | | `active` | `expired` | `now >= expires_at` at next resolve (or by the background sweep) | | `active` | `revoked` | `DELETE /v1/customers/{id}/setup_links/{link_id}` | Terminal states are permanent. You cannot revive a link — generate a new one. Patching redirect URLs ([see below](https://docs.kirimdev.com/platform/setup-links/#patch-redirect-urls) ) is the only mutation allowed on an active link. Generate -------- [Section titled “Generate”](https://docs.kirimdev.com/platform/setup-links/#generate) const link = await kirim.customers.createSetupLink(customer.id, { expires_in_hours: 168, success_redirect_url: 'https://yourapp.com/onboarded', failure_redirect_url: 'https://yourapp.com/onboard-failed',}) await sendEmailToTenant(customer.email!, { subject: 'Connect your WhatsApp', body: `Click here to connect: ${link.setup_url}`,}) | Param | Default | Limits | | --- | --- | --- | | `expires_in_hours` | `168` (7 days) | 1 to 720 (30 days) | | `success_redirect_url` | none | https only ([http://localhost](http://localhost/)
ok in dev). 2048 chars max. No fragment. | | `failure_redirect_url` | none | (same as success) | List ---- [Section titled “List”](https://docs.kirimdev.com/platform/setup-links/#list) for await (const link of kirim.customers.listSetupLinks(customer.id, { status: 'active' })) { console.log(link.id, link.expires_at, link.token_last4)} Returns up to the 50 most recent links per customer, newest first. Optional `status` filter (`active`, `consumed`, `expired`, `revoked`). Patch redirect URLs ------------------- [Section titled “Patch redirect URLs”](https://docs.kirimdev.com/platform/setup-links/#patch-redirect-urls) If you typo’d the URL or your routing changed, patch an **active** link without rotating the token: await kirim.customers.updateSetupLink(customer.id, link.id, { success_redirect_url: 'https://yourapp.com/onboarded-v2', failure_redirect_url: null, // clears the redirect}) The same validation rules apply (https, no private hosts, no fragment). Patching a non-active link returns `409 conflict`. Revoke ------ [Section titled “Revoke”](https://docs.kirimdev.com/platform/setup-links/#revoke) await kirim.customers.revokeSetupLink(customer.id, link.id) Revoking is idempotent for race safety — calling DELETE on an already-consumed link returns 409, not an error you need to handle specially. Security -------- [Section titled “Security”](https://docs.kirimdev.com/platform/setup-links/#security) The setup link is a **bearer credential**. Anyone who has the URL can complete onboarding for that specific customer. That is intentional — the operator sends it to a known tenant — but it shapes how we store and rate-limit it. ### What we store [Section titled “What we store”](https://docs.kirimdev.com/platform/setup-links/#what-we-store) We do **not** store the plaintext token. The DB columns are: | Column | What it holds | Purpose | | --- | --- | --- | | `token_prefix` | First 16 chars of the plaintext | Indexed lookup for resolution | | `token_hash` | `argon2id(plaintext)` | Constant-time verification | | `token_last4` | Last 4 chars | UI hint only | Compromise of the database does not give an attacker usable tokens — argon2id reversal is not feasible at the cost we tune to (19 MiB memory, time cost 2). Compromise of an in-flight email, however, _does_. Treat setup link URLs like password-reset links in your own threat model. ### Per-token rate limit [Section titled “Per-token rate limit”](https://docs.kirimdev.com/platform/setup-links/#per-token-rate-limit) Even if an attacker rotates IPs, the rate-limit bucket is keyed on the **token prefix**. The current ceiling is **30 calls per 60s** to either `/resolve` or `/callback`. Legitimate users complete onboarding in 2-4 calls; the cap lets us cut off brute-force prefix probing fast. ### Nonce-based CSRF [Section titled “Nonce-based CSRF”](https://docs.kirimdev.com/platform/setup-links/#nonce-based-csrf) After `/resolve` succeeds, the server sets a short-lived (10 minute) nonce in Redis keyed by the token prefix. The matching `/callback` must echo that nonce, then we consume it. This stops a malicious page from tricking a logged-in user into finishing the flow with someone else’s Meta `code`. ### Lazy expiry [Section titled “Lazy expiry”](https://docs.kirimdev.com/platform/setup-links/#lazy-expiry) We never serve a token whose `expires_at` is in the past — even if the periodic sweep hasn’t flipped the status yet. The resolve handler does the comparison on every call. ### Audit trail [Section titled “Audit trail”](https://docs.kirimdev.com/platform/setup-links/#audit-trail) `consumed_by_account_id` references `whatsapp_accounts(id)` with `ON DELETE SET NULL`. If the resulting WhatsApp account is later deleted, the link row stays addressable for audit; only the pointer becomes null. `created_by_user_id` is recorded on every link. When created via the Public API, this resolves to the user who originally created the API key. See also -------- [Section titled “See also”](https://docs.kirimdev.com/platform/setup-links/#see-also) * **[Redirect URLs](https://docs.kirimdev.com/platform/redirect-urls/) ** — validation and the query param contract on success/failure redirects. * **[Onboarding flow](https://docs.kirimdev.com/platform/onboarding-flow/) ** — end-to-end sequence including the public `/onboard/{token}` page. * **[Webhooks](https://docs.kirimdev.com/platform/webhooks/) ** — the `customer.setup_link.created` and `customer.setup_link.consumed` events. --- # Quickstart | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/quickstart/#_top) Quickstart ========== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fquickstart%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fquickstart%2F%20and%20help%20me%20with%20the%20following%3A%20) By the end of this guide you’ll have: 1. A new end-customer recorded on your Kirimdev org 2. A one-time setup link emailed (or DM’d) to that customer 3. That customer’s WhatsApp number connected to your platform 4. A test message sent from their number to a recipient **Prerequisites** * Kirimdev workspace on the **Business plan** or above — Customers is plan-gated. Upgrade in Billing settings if `POST /v1/customers` returns 402 (`feature_not_entitled`). Pro and Starter do not include this feature. * An API key with write scope: `kdv_live_…`. [Manage keys](https://docs.kirimdev.com/authentication/) * Meta Embedded Signup configured on your Facebook app (the same one you use for your own WhatsApp accounts). 1. **Install the SDK** bun add @kirimdev/sdk# or: npm install @kirimdev/sdk 2. **Create the customer** * [TypeScript](https://docs.kirimdev.com/platform/quickstart/#tab-panel-70) * [cURL](https://docs.kirimdev.com/platform/quickstart/#tab-panel-71) import { Kirim } from '@kirimdev/sdk' const kirim = new Kirim({ apiKey: process.env.KIRIM_API_KEY! }) const customer = await kirim.customers.create({ name: 'Acme Logistics', email: 'admin@acme.io', metadata: { crm_id: 'C-1234', branch: 'Jakarta' },}) console.log(customer.id)// → 'cus_335T08RM0EAKN9DTE6RD5RWP7B' curl -sS https://api.kirimdev.com/v1/customers \ -H 'Authorization: Bearer kdv_live_xxx' \ -H 'Content-Type: application/json' \ -d '{ "name": "Acme Logistics", "email": "admin@acme.io", "metadata": { "crm_id": "C-1234", "branch": "Jakarta" } }' Customer is created in `status: 'pending'`. It transitions to `active` automatically once the first WhatsApp number connects. 3. **Generate a setup link** * [TypeScript](https://docs.kirimdev.com/platform/quickstart/#tab-panel-72) * [cURL](https://docs.kirimdev.com/platform/quickstart/#tab-panel-73) const link = await kirim.customers.createSetupLink(customer.id, { expires_in_hours: 168, // 7 days success_redirect_url: 'https://yourapp.com/onboarded', failure_redirect_url: 'https://yourapp.com/onboard-failed',}) // IMPORTANT: link.token and link.setup_url are returned ONCE.// Persist or relay them now — list/get calls never re-expose them.console.log(link.setup_url)// → 'https://app.kirimdev.com/onboard/csl_3V3EMgPDU4zCTm7Fju7KWvqb' curl -sS https://api.kirimdev.com/v1/customers/cus_xxx/setup_links \ -H 'Authorization: Bearer kdv_live_xxx' \ -H 'Content-Type: application/json' \ -d '{ "expires_in_hours": 168, "success_redirect_url": "https://yourapp.com/onboarded", "failure_redirect_url": "https://yourapp.com/onboard-failed" }' 4. **Deliver the link to your tenant** Email, in-app message, SMS — however you communicate. The default TTL is 7 days; max 30 days (`expires_in_hours: 720`). 5. **Tenant clicks the link** The Kirimdev onboarding page opens without requiring a Kirimdev login, validates the token, and triggers Meta Embedded Signup against _your_ Facebook app. On success the tenant is auto-redirected to your `success_redirect_url` with these query params appended: ?customer_id=cus_335T08RM0EAKN9DTE6RD5RWP7B&account_id=wa_internal_id_xxx&status=success On failure, the URL is your `failure_redirect_url` with `status=failed&reason=`. 6. **Listen for `customer.onboarded`** Subscribe to webhooks so your backend learns the moment a customer finishes onboarding: await kirim.webhookSubscriptions.create({ url: 'https://yourapp.com/webhooks/kirim', events: ['customer.onboarded', 'customer.setup_link.consumed'],}) The `customer.onboarded` payload carries `phone_number_id` — that’s the value you plug into `POST /v1/{phone_number_id}/messages` to send on the new account’s behalf. See [the full event catalogue](https://docs.kirimdev.com/platform/webhooks/) . 7. **Send a test message** const phoneNumberId = '1111475158712095' // from the webhook payload await kirim.phoneNumbers(phoneNumberId).messages.send({ messaging_product: 'whatsapp', to: '+6285887130408', type: 'text', text: { body: 'Halo dari platform!' },}) There is **no special code path** for customer-owned accounts. The Public API doesn’t distinguish them from direct-org accounts — `phone_number_id` is the only identity that matters at send time. What you just did ----------------- [Section titled “What you just did”](https://docs.kirimdev.com/platform/quickstart/#what-you-just-did) | Step | API call | Result | | --- | --- | --- | | Created the customer | `POST /v1/customers` | `customer.status = 'pending'` | | Generated a setup link | `POST /v1/customers/{id}/setup_links` | Plaintext URL returned once | | Tenant onboarded via the link | (browser flow) | `customer.status = 'active'`, WA account attached | | Sent a message | `POST /v1/{phone_number_id}/messages` | First outbound message on the tenant’s number | Next steps ---------- [Section titled “Next steps”](https://docs.kirimdev.com/platform/quickstart/#next-steps) * **[Customers concept reference](https://docs.kirimdev.com/platform/customers/) ** — full field list, status lifecycle, multi-team rules. * **[Setup links](https://docs.kirimdev.com/platform/setup-links/) ** — token hashing, TTL, lifecycle states, revocation. * **[Redirect URLs](https://docs.kirimdev.com/platform/redirect-urls/) ** — validation rules, query param contract, common UX patterns. * **[Webhook event catalogue](https://docs.kirimdev.com/platform/webhooks/) ** — six `customer.*` events with payload samples. --- # Voice notes + faster inbound media downloads | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-10-voice-notes-and-inline-media-url/#_top) 2026 Voice notes + faster inbound media downloads ============================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-10-voice-notes-and-inline-media-url%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-10-voice-notes-and-inline-media-url%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 10, 2026 Public API — voice notes Added ------------------------------ [Section titled “Public API — voice notes ”](https://docs.kirimdev.com/changelog/2026-06-10-voice-notes-and-inline-media-url/#public-api--voice-notes-) Outbound `audio` messages now accept an `audio.voice` boolean. When `true`, WhatsApp renders the bubble as a voice note (waveform + play icon + microphone glyph) on the recipient’s phone instead of a generic audio file attachment. Voice-note presentation is also a prerequisite for the recipient-side speech-to-text transcript feature. { "messaging_product": "whatsapp", "to": "+628123456789", "type": "audio", "audio": { "link": "https://cdn.example.com/order-ready.ogg", "voice": true }} The field is optional; omitting it (or setting `false`) keeps the existing audio-attachment behaviour, so nothing changes for senders who don’t opt in. See the updated [Send audio guide](https://docs.kirimdev.com/sending/send-audio/) for the full payload and notes on which file formats encode well as voice notes. This mirrors the [Meta WhatsApp Cloud API change](https://developers.facebook.com/docs/whatsapp/cloud-api/messages/audio-messages/) shipped on October 16, 2025 and forwards the flag verbatim — no translation layer. TypeScript SDK Added -------------------- [Section titled “TypeScript SDK ”](https://docs.kirimdev.com/changelog/2026-06-10-voice-notes-and-inline-media-url/#typescript-sdk-) `@kirimdev/sdk` accepts the new `voice` field on `audio` payloads automatically — the SDK derives its types from the same OpenAPI spec that powers the API reference. No new SDK method is required; the field appears as an optional boolean on the existing `type: 'audio'` variant of `phone.messages.send(...)`. MCP server Added ---------------- [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-06-10-voice-notes-and-inline-media-url/#mcp-server-) The existing `send_message` MCP tool now accepts `audio.voice` — Claude, ChatGPT, and other MCP-aware clients can compose voice notes immediately. No new tool registration is needed. Inbound media — faster downloads Changed ---------------------------------------- [Section titled “Inbound media — faster downloads ”](https://docs.kirimdev.com/changelog/2026-06-10-voice-notes-and-inline-media-url/#inbound-media--faster-downloads-) Media downloads for inbound `image` / `video` / `audio` / `document` / `sticker` messages now use the signed CDN URL Meta inlines on the webhook payload (a change Meta rolled out on October 16, 2025). This removes one Graph API round-trip per inbound media — in practice inbound photos / voice notes / documents arrive in your S3 bucket roughly twice as fast, and a class of `GET /{mediaId}` rate-limit errors goes away entirely. The fallback path remains: if the inline URL is missing (older webhooks, message-history backfill) or expired (rate-limit pause delayed the job past the ~5-minute TTL), the worker still issues `GET /{mediaId}` and retries the download. No customer-side action is required; URLs in `messages[].media_url` keep the same shape. [Read the send-audio guide](https://docs.kirimdev.com/sending/send-audio/) [API Reference](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # MCP retries, limits, and audit controls hardened | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-20-mcp-production-hardening/#_top) MCP retries, limits, and audit controls hardened ================================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-20-mcp-production-hardening%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-20-mcp-production-hardening%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 20, 2026 MCP server Changed ------------------ [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-09-20-mcp-production-hardening/#mcp-server-) Every mutating MCP tool now accepts an optional `idempotency_key`. Reuse the same key and identical arguments when retrying after a timeout; Kirimdev replays the first successful result for 24 hours instead of executing the mutation twice. JSON-RPC request IDs remain correlation identifiers and do not deduplicate retries. MCP now applies the same inactive-subscription write policy as `/v1`. Read-only tools remain available, while message sends and other mutations return `subscription_inactive` until billing is restored. Feature and quota failures from the Business customer tools now use the documented structured tool error envelope. Read-only calls use the read rate-limit bucket and mutations use the write bucket, even though both travel through HTTP `POST`. Every authenticated `tools/call` admitted by the rate limiter is also recorded in API request logs under a sanitized `/mcp/tools/` path without copying tool arguments or message content. Tools now publish MCP safety hints for read-only, destructive, idempotent, and open-world behavior. Contact tools also match the Public API contract: invalid exact phone filters are rejected, BSUID/username fields are documented, and `update_contact` can update a WhatsApp username. [Review the MCP tools](https://docs.kirimdev.com/tools/mcp/tools/) [MCP overview](https://docs.kirimdev.com/tools/mcp/) --- # BSUID + WhatsApp username support | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#_top) BSUID + WhatsApp username support ================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-01-bsuid-username-support%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-01-bsuid-username-support%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** July 1, 2026 Business-Scoped User IDs (BSUID) Added -------------------------------------- [Section titled “Business-Scoped User IDs (BSUID) ”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#business-scoped-user-ids-bsuid-) WhatsApp introduced **usernames** in 2026. Users who adopt a username no longer expose their phone number in webhooks after 30 days of no direct interaction. To keep integrations working, Meta ships a per-portfolio identifier called **Business-Scoped User ID (BSUID)** — format `{ISO country}.{alphanumeric}`, e.g. `US.13491208655302741918`. Managed businesses with linked portfolios also get a **parent BSUID** carrying an `ENT` segment (`US.ENT.11815799212886844830`). Kirimdev now accepts, stores, and exposes both identifiers end-to-end. ### Sending: `recipient` field on `POST /v1/{phone_number_id}/messages` [Section titled “Sending: recipient field on POST /v1/{phone\_number\_id}/messages”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#sending-recipient-field-on-post-v1phone_number_idmessages) `to` (E.164 phone number) stays required-or-`recipient`. Send to a BSUID by omitting `to` and setting `recipient` instead: { "messaging_product": "whatsapp", "recipient": "US.13491208655302741918", "type": "text", "text": { "body": "Hi from BSUID." }} If both `to` and `recipient` are supplied, Meta uses `to` (documented precedence). The send response now includes: * `to` — the phone number when sent via `to`, `null` otherwise * `bsuid`, `parent_bsuid`, `username` — the recipient contact’s identifiers ### Contacts: BSUID as first-class identity [Section titled “Contacts: BSUID as first-class identity”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#contacts-bsuid-as-first-class-identity) `POST /v1/{phone_number_id}/contacts` accepts either `phone_number` or `bsuid` (at least one is required). `username` is display-only info and NOT identity — usernames can change. `GET /v1/{phone_number_id}/contacts` gains `bsuid` and `username` filters alongside `phone`. Every contact response now includes `bsuid`, `parent_bsuid`, and `username` (all nullable). ### Auth OTP restriction [Section titled “Auth OTP restriction”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#auth-otp-restriction) WhatsApp Business Platform rejects OTP authentication templates (one-tap, zero-tap, copy-code) sent to a BSUID with error `131062`. The public API pre-flight guard rejects the combo BEFORE calling Meta and returns: { "error": { "type": "invalid_request_error", "code": "bsuid_not_supported_for_template", "message": "Business-Scoped User ID recipients are not supported for authentication OTP templates. Send to a phone number (`to`) instead." }} MCP tools Changed ----------------- [Section titled “MCP tools ”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#mcp-tools-) Three tools accept the new identifiers: * `send_message` — `recipient` alongside `to`. Description explains precedence + auth OTP limitation. * `create_contact` — `phone_number` optional, `bsuid` optional, at least one required. `username` field added. * `search_contacts` — `bsuid` (exact) and `username` (case-insensitive exact) filters. Webhooks Added -------------- [Section titled “Webhooks ”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#webhooks-) Two changes for subscribers: * **`message.status` events** now include `recipient_user_id` and `recipient_parent_user_id` alongside the existing `recipient_id` (phone) — matching Meta’s shape 1:1 so BSUID sends can be reconciled without a follow-up lookup. * **New event type `contact.identity_updated`** fires when Meta rotates a contact’s BSUID (typically after the user changes their phone number). Payload: { "id": "evt_...", "type": "contact.identity_updated", "created_at": "2026-07-01T02:00:00Z", "data": { "contact_id": "ctc_...", "old_bsuid": "US.oldbsuid", "new_bsuid": "US.newbsuid", "old_parent_bsuid": null, "new_parent_bsuid": null, "phone_number": "628123456789" }} Subscribe to `contact.identity_updated` on any webhook subscription to keep your BSUID→user mapping fresh without polling. SDK Changed ----------- [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#sdk-) `@kirimdev/sdk` ships the shape via a fresh `openapi.json` snapshot. `SendMessageParams` gains `recipient`; `CreateContactParams` gains `bsuid` + `username`; `ListContactsParams` gains `bsuid` + `username` filters; `Contact` + `Message` types expose the same three fields. Zero migration for existing callers using `to` + `phone_number`. // Send by BSUIDawait kirim.phoneNumbers(pnid).messages.send({ messaging_product: 'whatsapp', recipient: 'US.13491208655302741918', type: 'text', text: { body: 'Hi.' },}) // Search by BSUIDconst paginator = kirim.phoneNumbers(pnid).contacts.list({ bsuid: 'US.13491208655302741918',}) Broadcasts Added ---------------- [Section titled “Broadcasts ”](https://docs.kirimdev.com/changelog/2026-07-01-bsuid-username-support/#broadcasts-) Broadcast recipients can be BSUID-only (contacts whose phone number is unknown). The worker’s dispatcher picks the identifier per row — phone wins over BSUID on Meta precedence. Auth OTP templates on BSUID-only recipients are pre-flighted to `failed` with `bsuid_not_supported_for_template` before enqueuing. CSV imports still expect a `phone_number` column; audience-by-label / audience-by-selected pick up BSUID-enriched contacts automatically. [Read the sending docs →](https://docs.kirimdev.com/sending/send-text/) --- # Hermes Agent integration docs | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-15-hermes-agent-integration/#_top) 2026 Hermes Agent integration docs ============================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-hermes-agent-integration%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-hermes-agent-integration%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 15, 2026 Documentation Added ------------------- [Section titled “Documentation ”](https://docs.kirimdev.com/changelog/2026-06-15-hermes-agent-integration/#documentation-) Kirimdev now documents the **[Hermes Agent](https://hermes-agent.nousresearch.com/) ** integration — a self-hosted alternative to the [MCP server](https://docs.kirimdev.com/tools/mcp/) for teams that want customers to chat with an AI **on WhatsApp** instead of inside Claude Desktop or Cursor. The **[kirimdev-hermes](https://github.com/kirimdev/kirimdev-hermes) ** plugin (source, MIT) receives signed `message.received` webhooks, runs the Hermes gateway, and replies via the same `/v1` API key you already use for REST. New pages: * **[Hermes overview](https://docs.kirimdev.com/tools/hermes/) ** — architecture, MCP vs Hermes, use cases (owner copilot, gated support, template ops, cron) * **[Hermes setup](https://docs.kirimdev.com/tools/hermes/setup/) ** — install plugin, configure env vars, create webhook subscription, smoke test [Read the Hermes guide](https://docs.kirimdev.com/tools/hermes/) --- # MCP server gains 5 new tools | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/#_top) 2026 MCP server gains 5 new tools ============================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-02-mcp-tools-expansion%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-02-mcp-tools-expansion%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 2, 2026 MCP server Added ---------------- [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/#mcp-server-) Five new tools land on the Kirimdev MCP server today — the surface grows from 6 to **11 tools**. The additions close three gaps that came up repeatedly in AI-assistant workflows: * **Delivery status visibility** — after `send_message` returns a `pending` row, the assistant could not poll for transitions to `sent` / `delivered` / `read` / `failed` without dropping back to the REST API or the dashboard. * **Read-then-reply loop** — the read-receipt branch of the messages endpoint was deliberately excluded from MCP at launch because we thought assistants would not hold a `wamid`. In practice, every call to `get_conversation` already returns inbound `wamid`s — so the workflow was achievable but the tool was missing. * **Light CRM** — assistants could read contacts via `search_contacts` but could not create or edit them, so even simple triage flows required a human round-trip. The new tools: ### `get_message` [Section titled “get\_message”](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/#get_message) Fetch a single message by its `msg_` id. Returns the same shape as `list_messages` entries, including the `error: { code, message, provider_code }` triple on failed sends. ### `list_messages` [Section titled “list\_messages”](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/#list_messages) Browse messages on a connected account, ordered newest-first. Filter by `conversation_id`, `direction`, `status`, or a `created_after` / `created_before` time window. Useful for “show me all failed sends today” audits and conversation-history sync jobs. ### `mark_as_read` [Section titled “mark\_as\_read”](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/#mark_as_read) Send a “read” receipt back to the original sender (turns the double-tick blue on their phone) and flip the local row to `status: "read"`. Optionally show a typing indicator alongside — Meta combines the two in a single upstream call. Takes the Meta-native `wamid` (from your inbound webhook payload, or from `get_conversation` / `get_message` output), **not** a Kirim `msg_` external id. Only inbound messages can be marked as read; outbound sends return `invalid_field_value`. Repeated calls on an already-read message are idempotent. ### `create_contact` [Section titled “create\_contact”](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/#create_contact) Create a new contact on a connected WhatsApp account. Keyed by `(account, phone_number)`; duplicates return `invalid_field_value` so the caller can fall back to `search_contacts`. Phone numbers accept `+62…` or `62…` (normalised to the canonical digit-only form the rest of the platform uses). ### `update_contact` [Section titled “update\_contact”](https://docs.kirimdev.com/changelog/2026-06-02-mcp-tools-expansion/#update_contact) Patch an existing contact by its `ctc_` id. At least one of `name` / `email` / `metadata` must be provided. Phone number is intentionally **not** patchable — it is the identity column; create a new contact and migrate if the number changes. All five tools follow the same multi-tenant scoping, error envelope, and rate-limiting as the existing six. The matching `/v1` REST endpoints (`GET /v1/{phone_number_id}/messages`, `GET .../messages/{id}`, `POST .../contacts`, `PATCH .../contacts/{id}`, plus the read-receipt branch of `POST .../messages`) are unchanged — these tools wrap surface that already shipped. [Browse all 11 MCP tools](https://docs.kirimdev.com/tools/mcp/tools/) [MCP overview](https://docs.kirimdev.com/tools/mcp/) --- # Edit message templates via API and SDK | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-26-edit-template/#_top) Edit message templates via API and SDK ====================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-26-edit-template%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-26-edit-template%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 26, 2026 Templates Added --------------- [Section titled “Templates ”](https://docs.kirimdev.com/changelog/2026-08-26-edit-template/#templates-) You can now **edit** an existing WhatsApp message template’s content programmatically — previously the public surface was create / list / get / sync only, and changing an approved template meant using the dashboard or Meta Business Manager. The request body is **components-only** and works like Meta’s edit endpoint: send the **full** desired `components` array — Meta replaces **all** components at once, so this is a **replacement, not a partial patch**. `name`, `language`, and `category` cannot change. When a name has multiple languages, pass `?language=` to pick which one to edit. A successful edit puts the template **back into Meta review**, so the returned `status` is `pending`; poll `GET /v1/{phone_number_id}/templates/{name}` for the eventual `approved` / `rejected` transition. ### REST [Section titled “REST”](https://docs.kirimdev.com/changelog/2026-08-26-edit-template/#rest) curl -X PATCH "https://api.kirimdev.com/v1/106540352242922/templates/order_update?language=id" \ -H "Authorization: Bearer $KIRIM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "components": [ { "type": "BODY", "text": "Pesanan {{1}} sudah dikirim.", "example": { "body_text": [["A123"]] } } ] }' Only templates **already reviewed by Meta** (`approved` / `rejected`) can be edited — a template still `pending` review returns **`409 template_not_editable`** (a `ConflictError` in the SDK). Meta also enforces edit **rate limits**: an approved template can be edited **10 times per 30 days** or **once per 24 hours** (rejected templates are unlimited); hitting the cap surfaces as `429` / `400`. ### SDK Added [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-08-26-edit-template/#sdk-) const template = await kirim .phoneNumbers('106540352242922') .templates.update( 'order_update', { components: [ { type: 'BODY', text: 'Pesanan {{1}} sudah dikirim.', example: { body_text: [['A123']] }, }, ], }, { language: 'id' }, ) console.log(template.status) // "pending" Editing is intentionally **not** exposed on the MCP server: an edit mutates a production template and re-triggers Meta review, so it stays an explicit API/SDK action rather than something an autonomous agent can trigger (consistent with MCP already omitting template delete). [Create & edit templates](https://docs.kirimdev.com/sending/create-templates/) [API reference](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/patch/) --- # Template names are validated, and inbound messages with control characters no longer disappear | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-07-25-template-name-validation-and-control-char-fix/#_top) Template names are validated, and inbound messages with control characters no longer disappear ============================================================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-25-template-name-validation-and-control-char-fix%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-25-template-name-validation-and-control-char-fix%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** July 25, 2026 `POST /v1/{phone_number_id}/messages` Changed --------------------------------------------- [Section titled “POST /v1/{phone\_number\_id}/messages ”](https://docs.kirimdev.com/changelog/2026-07-25-template-name-validation-and-control-char-fix/#post-v1phone_number_idmessages-) `template.name` is now **trimmed and validated** before the send is attempted. Meta accepts only lowercase letters, numbers, and underscores (`^[a-z0-9_]+$`). "name": "order_shipped" // ok"name": "order_shipped " // ok - trimmed for you"name": "order shipped" // 400 invalid_request_error"name": "Order_Shipped" // 400 invalid_request_error"name": "order-shipped" // 400 invalid_request_error Previously the name was passed to Meta verbatim. A name carrying a stray trailing space — the usual copy-paste artifact — came back as `(#131000) Something went wrong`, Meta’s generic bucket. On our side that code is classified as a transient upstream fault, so the send was retried three times with the same malformed payload and then reported to you as `upstream_error`. The message looked like a Meta outage; it was a typo. Two changes follow from that: * **Surrounding whitespace now succeeds instead of failing.** If your integration has been sending `"kirim_hasil_mcu "`, it starts working. * **Names that trimming cannot repair fail fast**, with `400 invalid_request_error` naming the offending field, rather than burning three retries and surfacing a misleading 5xx. SDK users catch this as `InvalidRequestError` instead of `ApiServerError`. If you send template names assembled from spreadsheet cells or form input, this is the case to re-check — those are the sources that carry invisible whitespace. Webhooks — inbound messages with control characters Fixed --------------------------------------------------------- [Section titled “Webhooks — inbound messages with control characters ”](https://docs.kirimdev.com/changelog/2026-07-25-template-name-validation-and-control-char-fix/#webhooks--inbound-messages-with-control-characters-) An inbound WhatsApp message whose body contained a NUL byte (`0x00`) was **silently lost**: it never appeared in the inbox, never advanced the conversation’s 24-hour window, and never produced a `message.received` webhook. NUL is rejected outright by our datastore, which failed the write for the whole message; the retries replayed the same content and the message was dropped. In practice this came from broadcast-style bodies where an emoji or formatting sequence had been mangled upstream before it ever reached us, so the sender saw a normal message and had no way to tell it had not landed. Control characters are now stripped as the payload enters the platform. Newlines, carriage returns, and tabs are preserved, and emoji, accents, and other multi-byte text are untouched — only the characters that cannot legally be stored are removed. Affected messages now arrive normally. No action is required on your side. If you reconcile message counts against your own records, a small number of previously-missing inbound messages around this period will remain missing: they were never persisted and cannot be recovered. [Sending templates](https://docs.kirimdev.com/sending/send-templates/) [Webhook events](https://docs.kirimdev.com/webhooks/events/) --- # API reference readability improvements | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-09-10-api-reference-readability/#_top) 2026 API reference readability improvements ====================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-10-api-reference-readability%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-09-10-api-reference-readability%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** September 10, 2026 Clearer operation pages Changed ------------------------------- [Section titled “Clearer operation pages ”](https://docs.kirimdev.com/changelog/2026-09-10-api-reference-readability/#clearer-operation-pages-) Every Public API operation now includes a purpose-focused description. Path and query parameters show realistic examples and explain account scope, timestamp boundaries, filter behavior, and public resource IDs. Cursor-paginated endpoints now document the default page size of 25, the maximum of 100, and how to pass `next_cursor` into the next request. Every `POST` operation also displays the optional `Idempotency-Key` header and its 24-hour replay behavior. More useful examples Fixed -------------------------- [Section titled “More useful examples ”](https://docs.kirimdev.com/changelog/2026-09-10-api-reference-readability/#more-useful-examples-) The messages list reference now shows a complete response envelope instead of a partial generated object. Error responses use examples appropriate to their HTTP status, so authentication failures no longer look like validation errors. Reference URLs and API behavior are unchanged. [View List messages](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/) --- # Onboarding flow | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/onboarding-flow/#_top) Reference Onboarding flow =============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fonboarding-flow%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fonboarding-flow%2F%20and%20help%20me%20with%20the%20following%3A%20) The onboarding flow has **three actors** and **two server boundaries**. Understanding both makes it much easier to debug. Actors ------ [Section titled “Actors”](https://docs.kirimdev.com/platform/onboarding-flow/#actors) | Actor | Role | | --- | --- | | **Your platform** | The Kirimdev customer running the integration. Creates the customer, generates the link, listens for webhooks. | | **End-customer** | The tenant on your platform (e.g. an Acme Logistics branch). Opens the link and completes Meta Embedded Signup. | | **Kirimdev** | The server hosting `app.kirimdev.com/onboard/{token}` and the `/api/public/onboarding/*` endpoints. | Server boundaries ----------------- [Section titled “Server boundaries”](https://docs.kirimdev.com/platform/onboarding-flow/#server-boundaries) | Boundary | Auth | Purpose | | --- | --- | --- | | Public API (`/v1/customers/*`) | Bearer API key | Your platform creates / lists / patches / revokes setup links here. | | Public onboarding (`/api/public/onboarding/*`) | **No auth** — bearer token in body | End-customer’s browser hits these. Token is the credential. | The flow at a glance -------------------- [Section titled “The flow at a glance”](https://docs.kirimdev.com/platform/onboarding-flow/#the-flow-at-a-glance) Six phases, each independently testable. Skip to [What runs where](https://docs.kirimdev.com/platform/onboarding-flow/#what-runs-where) for the per-endpoint detail. | # | Phase | Trigger | Result | | --- | --- | --- | --- | | 1 | **Create customer** | `POST /v1/customers` from your platform | Customer row in `pending` status. Fires `customer.created`. | | 2 | **Generate link** | `POST /v1/customers/{id}/setup_links` from your platform | Setup link active. Plaintext token returned **once**. Fires `customer.setup_link.created`. | | 3 | **Deliver link** | Your platform emails / SMSs / DMs the `setup_url` to the tenant | Tenant has the URL. | | 4 | **Resolve** | Tenant opens the URL. Browser POSTs `/api/public/onboarding/resolve` | Token validated, CSRF nonce minted, Meta Facebook app config returned. | | 5 | **Meta Embedded Signup** | Browser runs `FB.login(config_id)` | Tenant authorises Kirimdev’s Facebook app, browser receives an OAuth `code`. | | 6 | **Callback** | Browser POSTs `/api/public/onboarding/callback` with `{ token, nonce, code }` | Meta token exchange, WhatsApp account inserted, link consumed, customer flips `pending → active`. Fires `customer.setup_link.consumed` + `customer.onboarded`. Browser redirected to `success_redirect_url`. | What runs where --------------- [Section titled “What runs where”](https://docs.kirimdev.com/platform/onboarding-flow/#what-runs-where) ### `/api/public/onboarding/resolve` [Section titled “/api/public/onboarding/resolve”](https://docs.kirimdev.com/platform/onboarding-flow/#apipubliconboardingresolve) Browser-driven. **Two side effects**: rate-limit increment and nonce mint. 1. Per-token-prefix rate limit (Redis `INCR` + `EXPIRE`). Reject 429 if over 30 calls / 60s. 2. Look up the token via `token_prefix` index, argon2-verify against `token_hash`. 3. If the link is revoked / consumed / expired → return 410 with the reason. 4. Mint a random 18-byte nonce, store in Redis under `customer-onboard-nonce:` with 10-minute TTL. 5. Return `{ customer: { id, name }, facebook: { appId, configId }, nonce, expires_at, success_redirect_url, failure_redirect_url }`. ### `/api/public/onboarding/callback` [Section titled “/api/public/onboarding/callback”](https://docs.kirimdev.com/platform/onboarding-flow/#apipubliconboardingcallback) Browser-driven. **Many side effects**: Meta calls, DB writes, webhook emits, queue enqueue. 1. Per-token-prefix rate limit (same bucket as `/resolve`). 2. Read the nonce from Redis and compare. Reject `400 invalid_nonce` if missing or mismatched. Delete the nonce on first use. 3. Resolve the token (same path as `/resolve`). 4. Exchange Meta’s `code` for an `access_token` via Graph API. 5. Resolve the WABA id (from `debug_token`) and the phone number (from `/{waba}/phone_numbers`). 6. Check the organization’s WhatsApp account capacity. If the quota is full, Kirimdev automatically attempts to buy one prorated **Extra WhatsApp Number** unit from the provider’s wallet. Insufficient balance returns 403 without charging anything. 7. Probe `checkCoexistenceStatus` to detect SMB / WhatsApp Business App pairing. 8. Under an organization-scoped lock, atomically purchase any required slot, insert `whatsapp_accounts` with `customer_id` set and status `connecting`, and flip the link from `active` to `consumed`. 9. When an automatic slot was purchased, create a provisional allocation with a 30-minute connection deadline. 10. Flip `customers.status` from `pending` to `active` if it was pending. 11. Publish `customer.setup_link.consumed` and `customer.onboarded` webhook events. 12. Enqueue the `onboarding` BullMQ job that subscribes the WABA to our app webhook and (if coexistence) kicks off the contact sync. Successful webhook subscription commits a provisional slot. If it never succeeds within 30 minutes, Kirimdev disconnects and hides the incomplete account, removes that add-on unit, and refunds the wallet automatically. The setup link remains consumed; create a new link to try again. 13. Build the `success_redirect_url` with appended query params and return `{ accountId, customerId, status: 'pending', redirect_url }`. The browser then `window.location.replace(redirect_url)` to bounce the tenant back to your own app. Why a sync handler instead of an async worker? ---------------------------------------------- [Section titled “Why a sync handler instead of an async worker?”](https://docs.kirimdev.com/platform/onboarding-flow/#why-a-sync-handler-instead-of-an-async-worker) The callback is synchronous from `/oauth/access_token` through the DB writes because: * The customer’s browser is waiting for the response — they need an immediate redirect. * Meta `access_token` is short-lived; we can’t park the work and pick it up later. * The orphan-cleanup compensation only works inside the same handler. The **slow** Meta calls (webhook subscription, contact sync, history sync) are handed off to the `onboarding` queue so the callback typically returns in 2-3 seconds. Webhook delivery timing ----------------------- [Section titled “Webhook delivery timing”](https://docs.kirimdev.com/platform/onboarding-flow/#webhook-delivery-timing) The two relevant events fire **after** the synchronous DB writes commit but **before** the slow worker job runs: | Event | Carries | Use it for | | --- | --- | --- | | `customer.setup_link.consumed` | `customer_id`, `setup_link`, `account_id` | Audit trail / link analytics | | `customer.onboarded` | `customer_id`, `account_id`, `phone_number_id`, `phone_number` | **Business signal.** Update your CRM, surface the new number in your UI, kick off welcome automation. | Both events deliver before the contact sync completes. The account is `status: 'connecting'` at the moment the webhook fires; it transitions to `connected` once the worker finishes (typically a few seconds later). If you’re sending immediately on receipt, retry with backoff until the account is connected. Registering a number for sending -------------------------------- [Section titled “Registering a number for sending”](https://docs.kirimdev.com/platform/onboarding-flow/#registering-a-number-for-sending) Most numbers onboarded through Embedded Signup are ready to send once the worker flips them to `connected`. Some, however, need an explicit **registration** step before Meta will accept sends — this is the case when Meta reports the number as not yet `CONNECTED`, or when a send later fails with a “number not registered” error and the account is marked `degraded`. You can complete this step from the Public API without opening the dashboard: `POST /v1/{phone_number_id}/register` with the number’s 6-digit two-step-verification PIN. ### 1\. Find numbers that need registration [Section titled “1. Find numbers that need registration”](https://docs.kirimdev.com/platform/onboarding-flow/#1-find-numbers-that-need-registration) `GET /v1/accounts?status=all` returns every account with two status fields: * `status` — Kirimdev’s lifecycle state (`connected`, `connecting`, `degraded`, …) * `meta_status` — Meta’s own phone-number status (`CONNECTED`, `PENDING`, `UNVERIFIED`, …), or `null` if never fetched A number likely needs registration when `status` is **not** `connected` **or** `meta_status` is **not** `CONNECTED`. ### 2\. Register with the PIN [Section titled “2. Register with the PIN”](https://docs.kirimdev.com/platform/onboarding-flow/#2-register-with-the-pin) curl -X POST https://api.kirimdev.com/v1/106540352242922/register \ -H "Authorization: Bearer $KIRIM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "pin": "123456" }' // SDKconst result = await kirim.phoneNumbers('106540352242922').register('123456')console.log(result.status, result.meta_status) // "connected" "CONNECTED" On success the number flips to `connected` and any queued messages that were stuck waiting on registration are re-sent automatically. A wrong PIN, a cooldown, or another Meta rejection returns `422 whatsapp_registration_failed` with a descriptive message (in the SDK, an `InvalidRequestError`). An unknown or cross-organization `phone_number_id` returns `404 resource_not_found`. Because a 6-digit PIN is guessable, the endpoint throttles abuse per number: * After **5 failed PIN attempts** within ~15 minutes the number is temporarily locked out — further calls return `429 too_many_registration_attempts` **before** contacting Meta, until the window elapses. A successful registration resets the counter. * Only one registration can be in flight per number at a time. A concurrent second call returns `409 registration_in_progress` — retry after a moment. Failure modes ------------- [Section titled “Failure modes”](https://docs.kirimdev.com/platform/onboarding-flow/#failure-modes) | Symptom | Cause | What we return | | --- | --- | --- | | 410 at `/resolve` | Token revoked / consumed / expired | `{ error: 'revoked' \| 'consumed' \| 'expired' }`. Browser shows inline error. No redirect. | | 400 `invalid_nonce` | Browser lost / never received nonce, or tried to replay | Inline error. No redirect. | | 400 `token_exchange_failed` | Meta rejected the OAuth code | `{ error, redirect_url? }`. Redirect to `failure_redirect_url` if configured. | | 400 `no_waba_found` / `phone_lookup_failed` / `no_phone_found` | The granted scope didn’t include a WABA, or the WABA has no phone numbers yet | Same shape. Often resolved by retrying Embedded Signup with the right scopes. | | 403 `account_limit_reached` | Your org has hit its WhatsApp account quota and its wallet cannot cover the prorated Extra WhatsApp Number unit (or the add-on is unavailable) | `{ error, current, limit, redirect_url? }`. Add wallet balance or buy/upgrade capacity manually, then use **Try again** on the still-active setup link. The page resolves a fresh one-time nonce before reopening Meta. | | 409 `link_already_consumed` | A parallel callback won the race | Orphan WA account is rolled back. Generate a new link. | On every error after the token resolves, the callback returns the `failure_redirect_url` (if configured) so the tenant doesn’t see a dead-end Kirimdev page. See [Redirect URLs](https://docs.kirimdev.com/platform/redirect-urls/) for the query param contract. Race conditions and idempotency ------------------------------- [Section titled “Race conditions and idempotency”](https://docs.kirimdev.com/platform/onboarding-flow/#race-conditions-and-idempotency) | Race | Outcome | | --- | --- | | Two browsers open the same link, both complete signup | First-committer wins. Loser sees `409 link_already_consumed`; the orphan WhatsApp account row is deleted. | | Browser retries `/callback` with the same `code` | Meta returns a fresh access token for the same code (within their grace window). The DB writes idempotency on link status, but the WhatsApp account insert is NOT idempotent — a re-run produces a second account row. Mitigation: clients should not retry; the spec is “exactly once”. | | `/resolve` called many times | Safe. Only side effects are the rate-limit increment and a new nonce overwriting the previous. | See also -------- [Section titled “See also”](https://docs.kirimdev.com/platform/onboarding-flow/#see-also) * **[Customers](https://docs.kirimdev.com/platform/customers/) ** — what gets created server-side. * **[Setup links](https://docs.kirimdev.com/platform/setup-links/) ** — token format and lifecycle. * **[Redirect URLs](https://docs.kirimdev.com/platform/redirect-urls/) ** — query param contract on the success/failure bounce. * **[Webhooks](https://docs.kirimdev.com/platform/webhooks/) ** — payload shapes for the two onboarding events. * **[Accounts API reference](https://docs.kirimdev.com/api/accounts/) ** — the `register` endpoint and the `status` / `meta_status` fields. --- # Customers | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/customers/#_top) Concepts Customers ========= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fcustomers%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fcustomers%2F%20and%20help%20me%20with%20the%20following%3A%20) A **Customer** represents one of your platform’s end-tenants. It is the rightful owner of zero or more WhatsApp accounts you operate on its behalf. cus_335T08RM0EAKN9DTE6RD5RWP7B | | | | --- | --- | | Resource type | `customer` | | Public id prefix | `cus_` | | Scope | Team (which belongs to your Organization) | | Soft-deleteable? | Yes (`archive` action; data preserved) | | Mutation events | `customer.created`, `customer.updated`, `customer.archived`, `customer.onboarded` | Fields ------ [Section titled “Fields”](https://docs.kirimdev.com/platform/customers/#fields) | Field | Type | Description | | --- | --- | --- | | `id` | string | Public id, `cus_…` | | `object` | literal | Always `'customer'` | | `name` | string | Display name (1-200 chars). Server-side sanitised — whitespace collapsed, no newlines. Surfaced in dashboard, onboarding page, audit logs. | | `email` | string \| null | Optional contact email. Free-form, not validated for existence. | | `status` | enum | One of `pending`, `active`, `suspended`, `archived`. See [status lifecycle](https://docs.kirimdev.com/platform/customers/#status-lifecycle)
below. | | `metadata` | object \| null | Free-form JSON. Capped at 64 keys and 16 KB serialised. Use for your own foreign keys (CRM id, segment, locale, …). | | `archived_at` | string \| null | ISO 8601. Set only when `status = 'archived'`. | | `team_id` | string | Internal team id this customer belongs to. Discoverable via `GET /v1/me`. | | `created_at` | string | ISO 8601. | | `updated_at` | string | ISO 8601. | When you fetch a single customer via `GET /v1/customers/{id}`, the response also includes: | Field | Type | Description | | --- | --- | --- | | `whatsapp_accounts` | array | Trimmed projection of every account currently assigned to this customer. Each entry carries `phone_number_id`, `phone_number`, `name`, `status`, `onboarded_at`. | Status lifecycle ---------------- [Section titled “Status lifecycle”](https://docs.kirimdev.com/platform/customers/#status-lifecycle) Four states. Most customers spend their whole life in `active` once onboarded. | Status | Meaning | | --- | --- | | `pending` | Created but no WhatsApp account connected yet. The default for any new customer. | | `active` | At least one WhatsApp account is onboarded. Set automatically the moment a setup link is consumed. | | `suspended` | Operator-initiated freeze. Dashboard composer is blocked; Public API sends still flow (use account-level controls if you need to fully stop). | | `archived` | Soft-deleted. WhatsApp accounts and message history are preserved; only the customer row is hidden from default list views. | ### Transitions [Section titled “Transitions”](https://docs.kirimdev.com/platform/customers/#transitions) | From | To | How | | --- | --- | --- | | `(new)` | `pending` | `POST /v1/customers` | | `pending` | `active` | Automatic on `customer.setup_link.consumed` | | `active` | `suspended` | `PATCH /v1/customers/{id}` with `status: 'suspended'` | | `suspended` | `active` | `PATCH /v1/customers/{id}` with `status: 'active'` | | any non-archived | `archived` | `DELETE /v1/customers/{id}` | | `archived` | `pending` | Dashboard “Restore” button (`POST /api/customers/{id}/restore`) | Multi-team resolution --------------------- [Section titled “Multi-team resolution”](https://docs.kirimdev.com/platform/customers/#multi-team-resolution) Customers live inside a specific Team. Most organisations have exactly one Team, so the SDK and API can pick automatically. Multi-team orgs must pass `team_id` explicitly: // Single-team org — worksawait kirim.customers.create({ name: 'Acme Logistics' }) // Multi-team org — requiredawait kirim.customers.create({ team_id: 't1_v477nbrhghbi', name: 'Acme Logistics',}) Behaviour matrix: | Org has | `team_id` omitted | `team_id` provided | | --- | --- | --- | | 1 team | Auto-selected | Validated; rejected if cross-org | | 2+ teams | `400 missing_required_field`, `param: team_id` | Validated; rejected if cross-org | | 0 teams | `400 invalid_field_value` | (same) | Look up your team ids via `GET /v1/me` — the response includes a `teams` array with `{ id, name, slug }` for every team under your organization: curl -sS https://api.kirimdev.com/v1/me \ -H 'Authorization: Bearer kdv_live_xxx' { "data": { "teams": [ { "id": "team_01H…", "object": "team", "name": "Default", "slug": "default" }, { "id": "team_01J…", "object": "team", "name": "Sales", "slug": "sales" } ] }} Relationship to WhatsApp accounts --------------------------------- [Section titled “Relationship to WhatsApp accounts”](https://docs.kirimdev.com/platform/customers/#relationship-to-whatsapp-accounts) A WhatsApp account has a nullable `customer_id`: * **`customer_id` set** → owned by a customer (multi-tenant). Surfaced in every response that embeds the account (conversation, contact, template, accounts list). * **`customer_id = null`** → direct-org account. Legacy behaviour, no customer attribution. Filter accounts by customer: curl -sS 'https://api.kirimdev.com/v1/accounts?customer_id=cus_335T08...' \ -H 'Authorization: Bearer kdv_live_xxx' A WhatsApp account can be assigned to **at most one** customer at a time. Reassignment is supported through dashboard “Assign / Unassign” actions; the Public API does not expose reassignment yet. ### Disconnecting an account [Section titled “Disconnecting an account”](https://docs.kirimdev.com/platform/customers/#disconnecting-an-account) To remove one of a customer’s WhatsApp accounts over the Public API, call `DELETE /v1/customers/{id}/whatsapp_accounts/{phone_number_id}`. Identify the account by the `phone_number_id` you get back from `GET /v1/customers/{id}` (the `whatsapp_accounts[].phone_number_id` field): await kirim.customers.disconnectWhatsappAccount( 'cus_335T08RM0EAKN9DTE6RD5RWP7B', '1111475158712095',)// → { phone_number_id: '1111475158712095', object: 'whatsapp_account', disconnected: true } This mirrors removing the account from the dashboard: the number is best-effort unsubscribed from Meta webhooks, the account is soft-deleted, and a full purge of its data is scheduled. The call is **scoped to the customer** — you can only disconnect an account the addressed customer owns — and **idempotent**: once the account is gone, a repeat call returns `404 resource_not_found`. Relationship to webhook events ------------------------------ [Section titled “Relationship to webhook events”](https://docs.kirimdev.com/platform/customers/#relationship-to-webhook-events) Six event types fire across a customer’s lifecycle. See [Webhooks](https://docs.kirimdev.com/platform/webhooks/) for the full payload shapes. | Trigger | Event | | --- | --- | | `POST /v1/customers` | `customer.created` | | `PATCH /v1/customers/{id}` | `customer.updated` | | `DELETE /v1/customers/{id}` | `customer.archived` | | End-customer completes Embedded Signup via a setup link | `customer.setup_link.consumed` + `customer.onboarded` | | `POST /v1/customers/{id}/setup_links` | `customer.setup_link.created` | Relationship to messages, conversations, contacts ------------------------------------------------- [Section titled “Relationship to messages, conversations, contacts”](https://docs.kirimdev.com/platform/customers/#relationship-to-messages-conversations-contacts) Once a customer’s WhatsApp account is connected, you address it the same way as any other account: const phoneNumberId = '1111475158712095' // from the customer detail or webhook const messages = await kirim .phoneNumbers(phoneNumberId) .messages.list() .page() There is **no special code path** for customer-owned accounts. The embedded `whatsapp_account` object in every conversation, contact, and template response carries the customer attribution so your application can route by tenant: "whatsapp_account": { "phone_number": "+62 857-2516-5424", "phone_number_id": "1111475158712095", "customer": { "id": "cus_335T08RM0EAKN9DTE6RD5RWP7B", "name": "Acme Logistics" }} When the account is direct-org, `customer` is `null`. Limits ------ [Section titled “Limits”](https://docs.kirimdev.com/platform/customers/#limits) | Limit | Value | Where enforced | | --- | --- | --- | | `name` length | 200 chars | Validation + sanitisation | | `email` length | 255 chars | Validation | | `metadata` keys | 64 max | Validation | | `metadata` serialised size | 16 KB max | Validation | | Setup links per customer (list) | 50 most recent | Service | | Setup link TTL | 1 hour to 30 days | Validation | Errors ------ [Section titled “Errors”](https://docs.kirimdev.com/platform/customers/#errors) Customer-related errors follow the standard `/v1` envelope. Codes you might see: | `error.code` | Status | When | | --- | --- | --- | | `resource_not_found` | 404 | Unknown `cus_…` id, or the customer belongs to a different org. | | `invalid_field_value` | 400 | Field length, URL shape, or enum violation. Check `error.param`. | | `missing_required_field` | 400 | Multi-team org called create without `team_id`. | | `subscription_inactive` | 402 | Org’s subscription expired; writes are blocked until upgrade. | See [Error catalogue](https://docs.kirimdev.com/concepts/errors/) for the full list. See also -------- [Section titled “See also”](https://docs.kirimdev.com/platform/customers/#see-also) Setup links [Read setup links](https://docs.kirimdev.com/platform/setup-links/) Onboarding flow [Read flow](https://docs.kirimdev.com/platform/onboarding-flow/) Webhooks [Read webhooks](https://docs.kirimdev.com/platform/webhooks/) --- # Redirect URLs | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/redirect-urls/#_top) Concepts Redirect URLs ============= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fredirect-urls%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fredirect-urls%2F%20and%20help%20me%20with%20the%20following%3A%20) When you generate a setup link you can optionally supply two URLs: * **`success_redirect_url`** — where the tenant lands after they complete Meta Embedded Signup. * **`failure_redirect_url`** — where they land if anything goes wrong (link expired, signup cancelled, Meta token exchange failed, etc.). This is the same pattern Stripe Connect, Calendly, and GitHub Apps use to hand control back to the operator’s own UI. Why bother ---------- [Section titled “Why bother”](https://docs.kirimdev.com/platform/redirect-urls/#why-bother) Without redirect URLs the tenant ends up on a generic Kirimdev success page. With them, you can: * **Catch the user back inside your own app**, your styling, your navigation. * **Read the `customer_id` query param** to surface customer-specific UI (“Acme Logistics is now connected ✓”). * **Read the `account_id` query param** to pre-select the new WhatsApp number in your operator’s dashboard. * **Trigger your own onboarding follow-ups** — a welcome modal, a setup checklist, a CSAT survey. Setting them ------------ [Section titled “Setting them”](https://docs.kirimdev.com/platform/redirect-urls/#setting-them) * [TypeScript](https://docs.kirimdev.com/platform/redirect-urls/#tab-panel-74) * [cURL](https://docs.kirimdev.com/platform/redirect-urls/#tab-panel-75) await kirim.customers.createSetupLink(customer.id, { expires_in_hours: 168, success_redirect_url: 'https://yourapp.com/whatsapp/connected', failure_redirect_url: 'https://yourapp.com/whatsapp/connect-failed',}) curl -sS https://api.kirimdev.com/v1/customers/cus_xxx/setup_links \ -H 'Authorization: Bearer kdv_live_xxx' \ -H 'Content-Type: application/json' \ -d '{ "success_redirect_url": "https://yourapp.com/whatsapp/connected", "failure_redirect_url": "https://yourapp.com/whatsapp/connect-failed" }' Both fields are optional and independent. You can set just success, just failure, both, or neither. Patching an active link ----------------------- [Section titled “Patching an active link”](https://docs.kirimdev.com/platform/redirect-urls/#patching-an-active-link) If you typo’d a URL, patch the link without rotating the token: await kirim.customers.updateSetupLink(customer.id, link.id, { success_redirect_url: 'https://yourapp.com/whatsapp/connected-v2', failure_redirect_url: null, // clears the redirect}) Pass `null` to clear a field. Patching is only allowed while `status: 'active'` — a consumed/expired/revoked link returns `409 conflict`. Validation ---------- [Section titled “Validation”](https://docs.kirimdev.com/platform/redirect-urls/#validation) Both fields go through the same guard at create time and patch time: | Rule | Detail | | --- | --- | | Parseable URL | Must be an absolute URL with a scheme. | | HTTPS only | `http://` is rejected **except** for `localhost` / `127.0.0.1` / `*.localhost` in development. | | No fragment | `#anchor` is rejected because we append query params and a fragment would silently swallow them in some browsers. | | Length ≤ 2048 chars | SMS / email-friendly. | | No private hosts | RFC 1918, loopback, link-local, multicast, `.local`, `.internal`, and DNS-rebinding patterns (`*.nip.io`, `*.sslip.io` with private-IP labels) are rejected unless `WEBHOOK_ALLOW_PRIVATE_HOSTS=true` is set (dev only). | The check runs **server-side** at every create/patch, so URL strings in the DB are pre-validated. A failing URL returns `400 invalid_field_value` with the field name in `error.param`: { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "must use https:// (http:// is only allowed for localhost dev)", "param": "success_redirect_url", "request_id": "req_…" }} Query param contract -------------------- [Section titled “Query param contract”](https://docs.kirimdev.com/platform/redirect-urls/#query-param-contract) When we redirect, we append our params to **whatever you already have** on the URL — we don’t clobber. Existing fragments are stripped (we rejected them at create time, so this is a defence-in-depth no-op). ### Success [Section titled “Success”](https://docs.kirimdev.com/platform/redirect-urls/#success) https://yourapp.com/whatsapp/connected ?customer_id=cus_335T08RM0EAKN9DTE6RD5RWP7B &account_id=internal_account_id_xxx &status=success | Param | What it is | | --- | --- | | `customer_id` | The public `cus_…` id. Match against your own database. | | `account_id` | The internal WhatsApp account id (NOT the Meta `phone_number_id`). Use it only to disambiguate; for sending, look up the `phone_number_id` from the `customer.onboarded` webhook or `GET /v1/accounts`. | | `status` | Always `success` on this URL. | ### Failure [Section titled “Failure”](https://docs.kirimdev.com/platform/redirect-urls/#failure) https://yourapp.com/whatsapp/connect-failed ?customer_id=cus_335T08RM0EAKN9DTE6RD5RWP7B &status=failed &reason=signup_cancelled | Param | What it is | | --- | --- | | `customer_id` | The public `cus_…` id, when we know it. | | `status` | Always `failed` on this URL. | | `reason` | Stable code naming the failure. See [reason codes](https://docs.kirimdev.com/platform/redirect-urls/#failure-reason-codes)
below. | Failure reason codes -------------------- [Section titled “Failure reason codes”](https://docs.kirimdev.com/platform/redirect-urls/#failure-reason-codes) | `reason` | When it fires | | --- | --- | | `signup_cancelled` | The tenant closed the Meta Embedded Signup popup without completing. | | `token_exchange_failed` | Meta rejected the OAuth `code`. Often expired or already used. | | `token_info_failed` | The follow-up `debug_token` call failed. | | `no_waba_found` | The granted scope didn’t include a WhatsApp Business Account. | | `phone_lookup_failed` | `GET /{waba}/phone_numbers` failed. | | `no_phone_found` | The WABA has no phone numbers attached yet. | | `account_limit_reached` | Your org has hit its WhatsApp account quota and automatic Extra WhatsApp Number purchase could not be completed (usually insufficient wallet balance). | | `embedded_signup_disabled` | Your Kirimdev deployment is missing Facebook app config. | | `link_already_consumed` | A parallel callback raced and won. | | `account_create_failed` | Internal: the WhatsApp account insert returned no rows. | `reason` values are stable strings. New ones can be added; existing ones won’t be renamed. Branch defensively in your handler. What the tenant sees -------------------- [Section titled “What the tenant sees”](https://docs.kirimdev.com/platform/redirect-urls/#what-the-tenant-sees) The Kirimdev onboarding page handles the bounce client-side: 1. After a successful `callback`, it flashes “Connected! Returning you to _yourapp.com_…” for 1.5 seconds, then `window.location.replace(success_url)`. 2. After a failure with `failure_redirect_url` set, it flashes the friendly reason (“You cancelled the Meta authorisation popup…”) for 2.5 seconds, then redirects. 3. If no redirect URL is configured, it shows the inline status indefinitely and tells the tenant “you can close this tab”. Both flash screens include an `
` fallback for the redirect URL in case `window.location.replace` is blocked (some webviews): Returning you to yourapp.com… Click here if you're not redirected Common UX patterns ------------------ [Section titled “Common UX patterns”](https://docs.kirimdev.com/platform/redirect-urls/#common-ux-patterns) ### Pattern 1: separate success/failure pages [Section titled “Pattern 1: separate success/failure pages”](https://docs.kirimdev.com/platform/redirect-urls/#pattern-1-separate-successfailure-pages) { success_redirect_url: 'https://yourapp.com/onboarding/success', failure_redirect_url: 'https://yourapp.com/onboarding/failure',} Easiest. Each page reads `customer_id` (and `reason` on failure) and renders independently. ### Pattern 2: one page, branch on `status` [Section titled “Pattern 2: one page, branch on status”](https://docs.kirimdev.com/platform/redirect-urls/#pattern-2-one-page-branch-on-status) { success_redirect_url: 'https://yourapp.com/onboarding/result', failure_redirect_url: 'https://yourapp.com/onboarding/result',} Same component handles both. Branch in your React/Vue/etc: function OnboardingResult() { const { status, reason, customer_id } = useQueryParams() if (status === 'success') return return } ### Pattern 3: redirect into the customer’s tenant page [Section titled “Pattern 3: redirect into the customer’s tenant page”](https://docs.kirimdev.com/platform/redirect-urls/#pattern-3-redirect-into-the-customers-tenant-page) { success_redirect_url: `https://yourapp.com/tenants/${customer.id}/whatsapp`,} Skip the intermediate result page entirely. The tenant lands directly on the surface that uses the new WhatsApp account. ### Pattern 4: pass your own tracking params [Section titled “Pattern 4: pass your own tracking params”](https://docs.kirimdev.com/platform/redirect-urls/#pattern-4-pass-your-own-tracking-params) { success_redirect_url: `https://yourapp.com/onboarded?campaign=q3_signup_drive&internal_ref=${customer.email}`,} We preserve your existing query string and append our own. You’ll see all of them on the redirected URL. Localhost development --------------------- [Section titled “Localhost development”](https://docs.kirimdev.com/platform/redirect-urls/#localhost-development) `http://localhost:3000/onboarded` is accepted even though it’s `http`. Set `WEBHOOK_ALLOW_PRIVATE_HOSTS=true` in your local `.env` if you need to use other private IPs (`192.168.x.x` for a phone on the same LAN, for instance). Never set this in production. See also -------- [Section titled “See also”](https://docs.kirimdev.com/platform/redirect-urls/#see-also) * **[Setup links](https://docs.kirimdev.com/platform/setup-links/) ** — where you configure the redirect URLs. * **[Onboarding flow](https://docs.kirimdev.com/platform/onboarding-flow/) ** — when in the flow the redirect happens. * **[Errors](https://docs.kirimdev.com/concepts/errors/) ** — the standard error envelope shape. --- # media_upload_failed names the real cause, WebP uploads are rejected early, and the failed-sends error tables are corrected | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-04-media-upload-failed-message-and-code-corrections/#_top) media\_upload\_failed names the real cause, WebP uploads are rejected early, and the failed-sends error tables are corrected ============================================================================================================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-04-media-upload-failed-message-and-code-corrections%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-04-media-upload-failed-message-and-code-corrections%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 4, 2026 `media_upload_failed` explains what actually went wrong Changed --------------------------------------------------------------- [Section titled “media\_upload\_failed explains what actually went wrong ”](https://docs.kirimdev.com/changelog/2026-08-04-media-upload-failed-message-and-code-corrections/#media_upload_failed-explains-what-actually-went-wrong-) Sending media by URL failed with this: { "status": "failed", "error": { "code": "media_upload_failed", "message": "WhatsApp could not retrieve or process the media URL.", "provider_code": 131053 }} “Could not retrieve” reads as a connectivity problem, so the natural next step was to check whether the URL was reachable. It almost always was. Meta’s own media reference documents 131053 as a **mismatched MIME type**, and that is what it usually is. The message now says so: { "status": "failed", "error": { "code": "media_upload_failed", "message": "WhatsApp could not fetch or process the media. Check that the URL is publicly reachable and returns a supported Content-Type: images must be image/jpeg or image/png (WebP is accepted for stickers only). CDNs that auto-negotiate format can silently return WebP and trigger this error.", "provider_code": 131053 }} The code and the HTTP status are unchanged. Only the message text moved, so nothing that branches on `error.code` is affected. ### The trap worth knowing about [Section titled “The trap worth knowing about”](https://docs.kirimdev.com/changelog/2026-08-04-media-upload-failed-message-and-code-corrections/#the-trap-worth-knowing-about) WhatsApp accepts `image/jpeg` and `image/png` for image messages. WebP is valid for stickers only. That matters more than it sounds, because a URL can serve a different format to WhatsApp than it serves to you. Image CDNs built on imgix and similar services perform content negotiation: an `auto=format` parameter makes them return WebP to any client that advertises support for it. The URL opens correctly in your browser, returns `200`, and still fails here. If you pass third-party image URLs through `image.link`, pin the format explicitly rather than relying on the CDN default. Five error codes in the failed-sends guide never existed Fixed -------------------------------------------------------------- [Section titled “Five error codes in the failed-sends guide never existed ”](https://docs.kirimdev.com/changelog/2026-08-04-media-upload-failed-message-and-code-corrections/#five-error-codes-in-the-failed-sends-guide-never-existed-) The [Handling failed sends](https://docs.kirimdev.com/guides/failed-sends/) guide documented five `error.code` values that no Kirimdev endpoint has ever returned. They appeared in the code tables and in the copy-pasteable TypeScript and Python handlers, so anyone who followed the guide wrote `switch` branches that could never match — and the failure was silent, because an unmatched code simply fell through to the default arm. | Documented (wrong) | Actually returned | | --- | --- | | `template_not_approved` | `template_not_found` | | `template_params_mismatch` | `template_param_mismatch` | | `media_invalid` | `media_upload_failed` | | `provider_error` | `upstream_error` | | `degraded` | `account_in_maintenance` | `degraded` was the subtlest of the five: it is a real value, but it is an **account status**, not an error code. It never appears in `error.code`. Two further corrections in the same guide: * **`quota_exceeded` was listed as an async send-failure code.** It isn’t one — it is a synchronous `402` returned when your Kirimdev plan quota is exhausted, and it never appears as the `error.code` of a failed message. It has been removed from the async tables and handlers. (When a plan’s monthly message allowance runs out, the failed _message_ carries `invalid_request` with a quota message, and that allowance resets at the start of the next calendar month.) * **`template_param_format_mismatch` was missing entirely.** A wrong parameter _count_ and a wrong parameter _value format_ are separate codes with separate fixes, and only the first was documented. The synchronous **HTTP error table** was wrong too. Four of its rows named codes and even statuses the API does not use: | Documented (wrong) | Actually returned | | --- | --- | | `400 invalid_request` | `400 invalid_field_value` | | `403 phone_number_forbidden` | `404 resource_not_found` | | `409 idempotency_conflict` | `422 idempotency_key_reuse` | | `422 account_not_connected` | `422 whatsapp_number_not_verified` | The `403 → 404` correction matters for a subtle reason: an id belonging to another organization returns `404`, identical to an id that does not exist, so a caller cannot probe for other tenants’ phone-number ids. A documented `403` would have advertised the opposite. If you built error handling from this guide, check your branches against the corrected tables. **No API behavior changed — only the documentation was wrong.** WebP image uploads are now rejected before they fail at Meta Fixed ------------------------------------------------------------------ [Section titled “WebP image uploads are now rejected before they fail at Meta ”](https://docs.kirimdev.com/changelog/2026-08-04-media-upload-failed-message-and-code-corrections/#webp-image-uploads-are-now-rejected-before-they-fail-at-meta-) WhatsApp accepts WebP for **sticker** messages only. An `image` message with a WebP body is rejected by Meta with the same `131053` above. Our upload validation nonetheless accepted `image/webp` for images, in the composer, the media library, and the connector mapping editors. Because nothing in the pipeline transcodes WebP to PNG, the file was sent to Meta unchanged and failed there — a silent `131053` well after the upload appeared to succeed. WebP is now rejected at upload time for image messages, with an immediate, actionable error instead of a delayed send failure. JPEG and PNG are unaffected. (Broadcast/template image headers already rejected WebP; this brings the chat and media-library paths in line.) [Handling failed sends](https://docs.kirimdev.com/guides/failed-sends/) [Error envelope reference](https://docs.kirimdev.com/concepts/errors/) --- # Media card carousel templates (create + send) | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-30-media-card-carousel-templates/#_top) Media card carousel templates (create + send) ============================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-30-media-card-carousel-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-30-media-card-carousel-templates%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 30, 2026 Templates Added --------------- [Section titled “Templates ”](https://docs.kirimdev.com/changelog/2026-08-30-media-card-carousel-templates/#templates-) You can now **create** and **send** WhatsApp **media card carousel** templates. A carousel is a single **marketing** template message accompanied by **2–10 swipeable product cards** — each card has its own image or video header, an optional body text, and up to two buttons (quick reply, URL, or phone number). ### Creating a carousel [Section titled “Creating a carousel”](https://docs.kirimdev.com/changelog/2026-08-30-media-card-carousel-templates/#creating-a-carousel) Add a `CAROUSEL` component alongside the message `BODY`. Every card must share the **same structure** (same header format, same button types in the same order), and if any card has body text then all cards must. curl -X POST "https://api.kirimdev.com/v1/106540352242922/templates" \ -H "Authorization: Bearer $KIRIM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "rare_succulents_carousel", "language": "en_US", "category": "MARKETING", "components": [ { "type": "BODY", "text": "Rare succulents for sale!" }, { "type": "CAROUSEL", "cards": [ { "components": [ { "type": "HEADER", "format": "IMAGE", "example": { "header_url": ["https://cdn.example.com/aloe.jpg"] } }, { "type": "BUTTONS", "buttons": [ { "type": "QUICK_REPLY", "text": "Send more like this" }, { "type": "URL", "text": "Shop", "url": "https://shop.example.com/aloe" } ] } ] }, { "components": [ { "type": "HEADER", "format": "IMAGE", "example": { "header_url": ["https://cdn.example.com/echeveria.jpg"] } }, { "type": "BUTTONS", "buttons": [ { "type": "QUICK_REPLY", "text": "Send more like this" }, { "type": "URL", "text": "Shop", "url": "https://shop.example.com/echeveria" } ] } ] } ] } ] }' Provide each card header as `example.header_url` (a public `https://` image/video URL) — Kirimdev uploads the sample to Meta for you and retains the URL so the template stays sendable. Carousels are **MARKETING-only** and cannot carry a top-level `HEADER` / `FOOTER` / `BUTTONS` (put those on the cards). ### Sending a carousel [Section titled “Sending a carousel”](https://docs.kirimdev.com/changelog/2026-08-30-media-card-carousel-templates/#sending-a-carousel) Send an approved carousel with a `carousel` component whose `cards` supply each card’s header asset (`id` or `link`) and any per-button values, keyed by `card_index`: curl -X POST "https://api.kirimdev.com/v1/106540352242922/messages" \ -H "Authorization: Bearer $KIRIM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messaging_product": "whatsapp", "to": "+16505551234", "type": "template", "template": { "name": "rare_succulents_carousel", "language": { "code": "en_US" }, "components": [ { "type": "carousel", "cards": [ { "card_index": 0, "components": [ { "type": "header", "parameters": [{ "type": "image", "image": { "id": "1558081531584829" } }] }, { "type": "button", "sub_type": "quick_reply", "index": 0, "parameters": [{ "type": "payload", "payload": "more-aloes" }] } ] }, { "card_index": 1, "components": [ { "type": "header", "parameters": [{ "type": "image", "image": { "link": "https://cdn.example.com/echeveria.jpg" } }] }, { "type": "button", "sub_type": "quick_reply", "index": 0, "parameters": [{ "type": "payload", "payload": "more-echeverias" }] } ] } ] } ] } }' SDK Added --------- [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-08-30-media-card-carousel-templates/#sdk-) Both flows go through the existing `templates.create()` and `messages.send()` methods — the carousel shapes are now part of their types. await kirim.phoneNumbers('106540352242922').templates.create({ name: 'rare_succulents_carousel', category: 'MARKETING', language: 'en_US', components: [ { type: 'BODY', text: 'Rare succulents for sale!' }, { type: 'CAROUSEL', cards: [ { components: [ { type: 'HEADER', format: 'IMAGE', example: { header_url: ['https://cdn.example.com/aloe.jpg'] } }, { type: 'BUTTONS', buttons: [{ type: 'QUICK_REPLY', text: 'Send more like this' }] }, ] }, { components: [ { type: 'HEADER', format: 'IMAGE', example: { header_url: ['https://cdn.example.com/echeveria.jpg'] } }, { type: 'BUTTONS', buttons: [{ type: 'QUICK_REPLY', text: 'Send more like this' }] }, ] }, ], }, ],}) MCP Added --------- [Section titled “MCP ”](https://docs.kirimdev.com/changelog/2026-08-30-media-card-carousel-templates/#mcp-) The `create_template` and `send_message` MCP tools accept the same carousel shapes automatically — no new tools were added. [Create templates](https://docs.kirimdev.com/sending/create-templates/) [Send templates](https://docs.kirimdev.com/sending/send-templates/) --- # Header and footer on interactive CTA URL messages | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-07-03-cta-url-header-footer/#_top) Header and footer on interactive CTA URL messages ================================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-03-cta-url-header-footer%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-03-cta-url-header-footer%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** July 3, 2026 Public API Fixed ---------------- [Section titled “Public API ”](https://docs.kirimdev.com/changelog/2026-07-03-cta-url-header-footer/#public-api-) The `interactive.type=cta_url` variant on `POST /v1/{phone_number_id}/messages` previously accepted only `body` + `action`. Any `header` or `footer` field was silently stripped by validation, even though [Meta’s own documentation](https://developers.facebook.com/docs/whatsapp/cloud-api/messages/interactive-cta-url-messages/) lists both as supported and the dashboard chat composer has been sending them for months. Both fields are now accepted on the public API. Shape matches Meta 1:1 — and matches the existing `reply_buttons` variant so the two interactive surfaces share the same header union: { "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "cta_url", "header": { "type": "image", "image": { "link": "https://cdn.example.com/order-banner.png" } }, "body": { "text": "Pesananmu siap diambil." }, "footer": { "text": "Pickup sebelum 20:00 WIB" }, "action": { "name": "cta_url", "parameters": { "display_text": "Lihat detail", "url": "https://example.com/orders/42" } } }} Both fields stay optional — payloads that omit them keep working unchanged. Header variants: `text` (≤60 chars), `image`, `video`, `document` (each via a public HTTPS `link`). Footer text is capped at 60 characters. Same limits Meta enforces upstream. TypeScript SDK Changed ---------------------- [Section titled “TypeScript SDK ”](https://docs.kirimdev.com/changelog/2026-07-03-cta-url-header-footer/#typescript-sdk-) `@kirimdev/sdk` picks up the new fields via the refreshed `openapi.json` snapshot. `phone.messages.send(...)` accepts `header` and `footer` on the `cta_url` variant automatically — the SDK derives its types from the same OpenAPI spec that powers the API reference. No new method is required. await phone.messages.send({ messaging_product: 'whatsapp', to: '+628123456789', type: 'interactive', interactive: { type: 'cta_url', header: { type: 'image', image: { link: 'https://cdn.example.com/order-banner.png' }, }, body: { text: 'Pesananmu siap diambil.' }, footer: { text: 'Pickup sebelum 20:00 WIB' }, action: { name: 'cta_url', parameters: { display_text: 'Lihat detail', url: 'https://example.com/orders/42', }, }, },}) MCP server Changed ------------------ [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-07-03-cta-url-header-footer/#mcp-server-) The existing `send_message` MCP tool inherits the same schema update — Claude, ChatGPT, and other MCP-aware clients can now pass `header` / `footer` on `cta_url` sends without tripping the validator. [Read the send guide](https://docs.kirimdev.com/sending/send-buttons/) [API Reference](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Panduan FAQ jendela 24 jam & template | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-15-24h-window-templates-faq/#_top) Panduan FAQ jendela 24 jam & template ===================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-24h-window-templates-faq%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-15-24h-window-templates-faq%2F%20and%20help%20me%20with%20the%20following%3A%20) **Dirilis:** 15 Juni 2026 Dokumentasi Added ----------------- [Section titled “Dokumentasi ”](https://docs.kirimdev.com/changelog/2026-06-15-24h-window-templates-faq/#dokumentasi-) Menambahkan **[Jendela 24 jam & template (FAQ)](https://docs.kirimdev.com/guides/24h-window-and-templates/) ** — satu halaman (Bahasa Indonesia) yang bisa dibagikan ke rekan atau pelanggan yang sering bertanya: * Apa itu jendela 24 jam dan hubungannya dengan `last_inbound_at` * Apa yang boleh dikirim saat jendela terbuka vs tertutup * Mengapa template ada dan bagaimana proses approval * Skenario umum (kontak pertama, setelah kirim template, marketing vs utility) * Cheat sheet kode error (`outside_24h_window`, mismatch template) Cross-link dari [Kirim teks](https://docs.kirimdev.com/sending/send-text/) , [Kirim template](https://docs.kirimdev.com/sending/send-templates/) , dan [Menangani kiriman gagal](https://docs.kirimdev.com/guides/failed-sends/) . --- # Revoke/edit webhook events and unsupported sub-kind hint | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-07-11-message-revoked-edited-and-unsupported-hint/#_top) Revoke/edit webhook events and unsupported sub-kind hint ======================================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-11-message-revoked-edited-and-unsupported-hint%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-11-message-revoked-edited-and-unsupported-hint%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** July 11, 2026 Two new webhook events cover message deletions and edits from **Coexistence** WhatsApp numbers, and every `message.received` delivery for a Meta-downgraded message now carries a sub-kind hint so you can tell “the contact edited a message” from “Meta doesn’t know what this is”. `message.revoked` webhook event Added ------------------------------------- [Section titled “message.revoked webhook event ”](https://docs.kirimdev.com/changelog/2026-07-11-message-revoked-edited-and-unsupported-hint/#messagerevoked-webhook-event-) When a WhatsApp contact deletes (“delete for everyone”) a message they previously sent to your number, Meta delivers a `revoke` webhook carrying the original message’s wamid. Kirimdev now forwards that as a first-class `message.revoked` event: { "id": "evt_01HXYZABCDEFGHJKMNPQRSTVWX", "type": "message.revoked", "created_at": "2026-07-11T15:34:10.000Z", "data": { "message_id": "msg_01HXYZABCDEFGHJKMNPQRSTVXY", "provider_id": "wamid.HBgLMTY1MDM4Nzk0MzkV...", "conversation_id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWZ", "contact_id": "ctc_01HXYZABCDEFGHJKMNPQRSTVW0", "contact_phone_number": "+6285887130408", "phone_number_id": "890836697444150", "display_phone_number": "6281295648580", "revoked_at": "2026-07-11T15:34:10.000Z" }} Subscribe on create or update: curl -X POST https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/kirim", "events": ["message.received", "message.revoked"] }' `message.edited` webhook event Added ------------------------------------ [Section titled “message.edited webhook event ”](https://docs.kirimdev.com/changelog/2026-07-11-message-revoked-edited-and-unsupported-hint/#messageedited-webhook-event-) When a contact edits a previously sent message AND Meta forwards the new body, we fan out a `message.edited` event with both the new and original content: { "id": "evt_...", "type": "message.edited", "created_at": "2026-07-11T15:33:22.000Z", "data": { "message_id": "msg_01HXYZABCDEFGHJKMNPQRSTVXY", "provider_id": "wamid.HBgLMTY1MDM4Nzk0MzkV...", "conversation_id": "cnv_...", "contact_id": "ctc_...", "contact_phone_number": "+6285887130408", "phone_number_id": "890836697444150", "display_phone_number": "6281295648580", "new_content": "Halooee", "original_content": "Halo", "edited_at": "2026-07-11T15:33:22.000Z", "edit_history": [ { "content": "Halo", "edited_at": "2026-07-11T15:33:15.000Z" } ] }} `original_content` is the FIRST version of the message, never overwritten by subsequent edits. `edit_history` is the chronological revision log (Meta allows edits within 15 minutes of the original send). Also Coexistence-only. `unsupported.type` hint on `message.received` Added --------------------------------------------------- [Section titled “unsupported.type hint on message.received ”](https://docs.kirimdev.com/changelog/2026-07-11-message-revoked-edited-and-unsupported-hint/#unsupportedtype-hint-on-messagereceived-) For every inbound message where `type === "unsupported"`, the API response and outbound webhook payloads now include an `unsupported` block distinguishing the sub-kind Meta reported: * `"edit"` — the contact edited a previous message; Meta refused to forward the new body (see the advisory above). * `"unknown"` — a message type Meta itself cannot classify (typically a new WhatsApp product not yet in the Cloud API contract). Example inbound webhook body (unchanged Meta-passthrough envelope with the new field inside the messages array): { "object": "whatsapp_business_account", "entry": [{ "id": "1880077689245224", "changes": [{ "field": "messages", "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "6281295648580", "phone_number_id": "890836697444150" }, "contacts": [{ "profile": { "name": "Ori" }, "wa_id": "6285887130408" }], "messages": [{ "from": "6285887130408", "id": "wamid.HBgN...", "timestamp": "1783760270", "type": "unsupported", "unsupported": { "type": "edit" } }] } }] }]} Same hint on `GET /v1/{phone_number_id}/messages` and `GET /v1/{phone_number_id}/messages/{id}`: { "id": "msg_...", "object": "message", "type": "unsupported", "content": null, "unsupported": { "type": "edit" }, "status": "delivered", ...} The `unsupported` field is only present when populated; older rows ingested before this feature omit it. Kept open-string because Meta may introduce further sub-kinds (`view_once`, `poll`, …) without prior notice. SDK Changed ----------- [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-07-11-message-revoked-edited-and-unsupported-hint/#sdk-) `@kirimdev/sdk` `3.13.0` picks up the new events and hint via the fresh `openapi.json` snapshot. Type-safe subscription: await kirim.webhookSubscriptions.create({ url: 'https://your-app.example.com/webhooks/kirim', events: ['message.received', 'message.revoked', 'message.edited'],}) New payload types exported from `@kirimdev/sdk/webhooks`: `MessageRevokedEvent`, `MessageEditedEvent` (with their `MessageRevokedPayload` / `MessageEditedPayload` data shapes). import { verifyWebhookSignature, type KirimNativeWebhookEvent } from '@kirimdev/sdk/webhooks' const event = (await verifyWebhookSignature({ rawBody, signatureHeader, secrets,})) as KirimNativeWebhookEvent if (event.type === 'message.revoked') { // event.data.message_id, event.data.revoked_at, ...} For the inbound sub-kind hint, retrieve response types now include the optional `unsupported` field: const msg = await kirim.messages.retrieve(id, phoneNumberId)if (msg.type === 'unsupported' && msg.unsupported?.type === 'edit') { // Contact edited an earlier message; Meta didn't share the new body.} Dashboard Added --------------- [Section titled “Dashboard ”](https://docs.kirimdev.com/changelog/2026-07-11-message-revoked-edited-and-unsupported-hint/#dashboard-) Message bubbles for Meta-downgraded messages now distinguish the sub-kind instead of showing a single generic placeholder: * `edit` → _“Kontak mengedit pesan sebelumnya. Buka WhatsApp di HP untuk melihat isi terbaru.”_ * `unknown` → _“Tipe pesan belum didukung — cek langsung di HP.”_ * fallback → _“Pesan tidak didukung — cek langsung di HP.”_ [Webhook event reference →](https://docs.kirimdev.com/webhooks/events/) --- # Interactive reply buttons | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-01-interactive-reply-buttons/#_top) 2026 Interactive reply buttons ========================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-01-interactive-reply-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-01-interactive-reply-buttons%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 1, 2026 Public API Added ---------------- [Section titled “Public API ”](https://docs.kirimdev.com/changelog/2026-06-01-interactive-reply-buttons/#public-api-) Reply buttons (Meta’s `interactive.type=button` surface) are now supported on `POST /v1/{phone_number_id}/messages` as a new `interactive` subtype: { "messaging_product": "whatsapp", "to": "+628123456789", "type": "interactive", "interactive": { "type": "reply_buttons", "body": { "text": "Konfirmasi jadwal workshop besok jam 9?" }, "action": { "buttons": [ { "type": "reply", "reply": { "id": "confirm", "title": "Confirm" } }, { "type": "reply", "reply": { "id": "reschedule", "title": "Reschedule" } }, { "type": "reply", "reply": { "id": "cancel", "title": "Cancel" } } ] } }} Recipients tap one of the buttons; their choice arrives on your webhook as an inbound `message.received` event carrying a `button_reply` discriminator with the `id` you set. Use it for confirmations, branching menus, and short multiple-choice questions where each option is a single short label (≤20 chars). Distinct from the existing [CTA URL button](https://docs.kirimdev.com/sending/send-buttons/) — that opens a link in the browser; reply buttons stay inside WhatsApp and route back to your webhook. Validation enforced before the request reaches Meta: * 1–3 buttons per message * Each `id` ≤ 256 chars; each `title` ≤ 20 chars * Both `id` and `title` must be **unique** across the button set * Body ≤ 1024 chars (required); optional header (text / image / video / document via `link`) ≤ 60 chars; optional footer ≤ 60 chars * Subject to the 24-hour customer-service window — same as every free-form send See the new [Send reply buttons guide](https://docs.kirimdev.com/sending/send-reply-buttons/) for the full payload, the webhook shape, and end-to-end examples in cURL and the TypeScript SDK. TypeScript SDK Added -------------------- [Section titled “TypeScript SDK ”](https://docs.kirimdev.com/changelog/2026-06-01-interactive-reply-buttons/#typescript-sdk-) `@kirimdev/sdk` accepts the new `reply_buttons` variant on `phone.messages.send(...)` automatically — the SDK derives its types from the same OpenAPI spec that powers the API reference. No new SDK method is required; the variant appears as a tab inside the existing `type: 'interactive'` discriminator. MCP server Added ---------------- [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-06-01-interactive-reply-buttons/#mcp-server-) The existing `send_message` MCP tool now accepts `reply_buttons` payloads — Claude, ChatGPT, and other MCP-aware clients can drive the new surface immediately. No new tool registration is needed. n8n node Added -------------- [Section titled “n8n node ”](https://docs.kirimdev.com/changelog/2026-06-01-interactive-reply-buttons/#n8n-node-) The Kirim n8n community node ships a new **Send Interactive Reply Buttons** operation alongside the existing CTA URL action. The form exposes optional header / body / footer and a dynamic 1–3-row buttons collection (id + title). Validation is performed locally with clear errors before any HTTP request fires. Dashboard Added --------------- [Section titled “Dashboard ”](https://docs.kirimdev.com/changelog/2026-06-01-interactive-reply-buttons/#dashboard-) The chat composer has a new **Tombol balasan** menu item between the URL-button and list-message actions. Operators can compose a reply-buttons message inline, see the same 1–3 button preview the recipient will tap, and review inbound `button_reply` events directly in the thread. [Read the send guide](https://docs.kirimdev.com/sending/send-reply-buttons/) [API Reference](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) --- # Initial release | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-05-26-initial-release/#_top) 2026 Initial release =============== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-05-26-initial-release%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-05-26-initial-release%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** May 26, 2026 The Kirimdev platform is now generally available to developers. This first cut covers everything you need to send WhatsApp messages from your backend, subscribe to inbound events, and automate your inbox through an LLM. Public API Added ---------------- [Section titled “Public API ”](https://docs.kirimdev.com/changelog/2026-05-26-initial-release/#public-api-) All paths are under `https://api.kirimdev.com/v1`. Phone-number-scoped routes take Meta’s `phone_number_id` as the first path segment. * **Messages.** `POST /v1/{phone_number_id}/messages` to send text, interactive, media, and approved template messages, plus `read_receipt` to mark inbound as read. `GET` listing, retrieve, and `GET …/messages/{id}/media` for media download (302 to a signed CDN URL). * **Conversations.** `GET /v1/{phone_number_id}/conversations`, retrieve, `PATCH`, plus label attach/detach. * **Contacts.** `GET /v1/{phone_number_id}/contacts`, `POST`, retrieve, `PATCH`, label attach/detach, and bulk label operations. * **Templates.** `GET /v1/{phone_number_id}/templates` and retrieve by name. * **Labels.** Org-scoped `GET /v1/labels` (full CRUD). * **Webhook subscriptions.** Org-scoped `POST /v1/webhook_subscriptions` (full CRUD) plus per-subscription secret rotation, single `POST /v1/webhook_deliveries/{id}/replay`, and `POST /v1/webhook_deliveries/bulk_replay` (capped at 1000 per call). * **Account discovery.** `GET /v1/me`, `GET /v1/accounts`. * Bearer-token authentication with org-scoped live keys (`kdv_live_…` — only key format issued today). * Idempotency on all `POST` endpoints via the `Idempotency-Key` header (24-hour replay window). Replays carry `Idempotent-Replayed: true`. * Stable error envelope (`type`, `code`, `message`, `param`, `request_id`) with seven `type` categories. See the [API Reference](https://docs.kirimdev.com/api/) for the full operation list. TypeScript SDK Added -------------------- [Section titled “TypeScript SDK ”](https://docs.kirimdev.com/changelog/2026-05-26-initial-release/#typescript-sdk-) * `@kirimdev/sdk` published to npm — fully typed wrapper around `/v1`, generated from the same OpenAPI spec that powers this documentation. * Built-in retry with jittered exponential backoff on `429` and retryable `5xx` responses. * Stripe-style webhook verifier (`verifyWebhookSignature`) supporting multi-secret rotation and a configurable timestamp tolerance. * Cursor-based pagination helpers (`for await` iteration). * Typed error hierarchy: `InvalidRequestError`, `AuthenticationError`, `PermissionError`, `NotFoundError`, `ConflictError`, `RateLimitError`, `ApiServerError`, `ConnectionError`. See the [SDK Quickstart](https://docs.kirimdev.com/sdks/typescript/quickstart/) to get started. MCP server Added ---------------- [Section titled “MCP server ”](https://docs.kirimdev.com/changelog/2026-05-26-initial-release/#mcp-server-) * Streamable-HTTP Model Context Protocol server at `POST https://api.kirimdev.com/mcp` lets Claude, ChatGPT, and other MCP-aware clients drive your WhatsApp number with natural language. * Tools: `list_phone_numbers`, `send_message`, `list_conversations`, `get_conversation`, `search_contacts`, `list_templates` — scoped by the same API keys you use for HTTP. See the [MCP Setup guide](https://docs.kirimdev.com/tools/mcp/setup/) for the one-click install flow. Webhooks Added -------------- [Section titled “Webhooks ”](https://docs.kirimdev.com/changelog/2026-05-26-initial-release/#webhooks-) * **Meta passthrough events** (`X-Kirim-Source: meta`): `message.received`, `message.status` — body is the exact JSON Meta sent. * **Kirimdev-native events** (`X-Kirim-Source: kirim`): `conversation.assigned`, `conversation.closed`, `contact.created`, `contact.updated` — wrapped in the standard envelope `{ id, type, created_at, data }`. * HMAC-SHA256 signatures in the Stripe-style header `X-Kirim-Signature: t=,v1=[,v1=…]` with per-subscription rotating secrets and a 5-minute default tolerance window. * 8-attempt exponential-backoff retry pipeline spread over ~24 hours with ±20% jitter. Subscriptions auto-disable after 20 consecutive failed deliveries. See the [Webhooks overview](https://docs.kirimdev.com/webhooks/overview/) for the full event catalog and payload schemas. Documentation Added ------------------- [Section titled “Documentation ”](https://docs.kirimdev.com/changelog/2026-05-26-initial-release/#documentation-) * Quickstart, authentication, and core concepts pages. * Per-message-type send guides under **Sending & receiving**. * End-to-end recipes: order notifications, support bot with n8n, broadcast campaign. [Start the Quickstart](https://docs.kirimdev.com/quickstart/) [Browse the API Reference](https://docs.kirimdev.com/api/) --- # Per-account filter for webhook subscriptions | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/#_top) Per-account filter for webhook subscriptions ============================================ Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-03-webhook-per-account-filter%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-03-webhook-per-account-filter%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** July 3, 2026 Per-account filter on webhook subscriptions Added ------------------------------------------------- [Section titled “Per-account filter on webhook subscriptions ”](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/#per-account-filter-on-webhook-subscriptions-) Webhook subscriptions used to fire for every WhatsApp account in the organisation — one subscription, all numbers. That was fine for a single-number org, but customers running a “Sales” number and a “Support” number on the same organisation had no way to route their events to different endpoints without filtering server-side. You can now scope a subscription to a whitelist of Meta `business_phone_number_id` values on create or update: curl -X POST https://api.kirimdev.com/v1/webhook_subscriptions \ -H "Authorization: Bearer $KIRIM_KEY" \ -H "Content-Type: application/json" \ -d '{ "url": "https://your-app.example.com/webhooks/sales", "events": ["message.received", "message.status"], "phone_number_ids": ["106540352242922"] }' * Omit `phone_number_ids` (or send `null` on update) to keep the current behaviour — the subscription fires for every account in the org. * Send an array to whitelist specific numbers. Discover the ids via `GET /v1/accounts` (`phone_number_id` column on each row). * Send `null` on PATCH to clear an existing filter and go back to “all accounts”. Every existing subscription keeps working unchanged — the field defaults to unrestricted, so no migration is required on your side. ### Which events the filter applies to [Section titled “Which events the filter applies to”](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/#which-events-the-filter-applies-to) The filter only affects events that originate from a specific WhatsApp account: * `message.received`, `message.status`, `message.sent` * `conversation.assigned`, `conversation.closed` * `contact.created`, `contact.updated`, `contact.identity_updated` Organisation-level events (`customer.created`, `customer.updated`, `customer.archived`, `customer.onboarded`, `customer.setup_link.*`) ignore the filter and fire for every subscription regardless. Those events aren’t tied to a phone number, so scoping them by phone number wouldn’t be meaningful. ### Response shape [Section titled “Response shape”](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/#response-shape) Every webhook subscription response now includes a `phone_number_ids` field: { "id": "wbs_...", "object": "webhook_subscription", "url": "https://your-app.example.com/webhooks/sales", "events": ["message.received"], "phone_number_ids": ["106540352242922"], "status": "active", ...} `null` = unrestricted (fires for every account). An array = the whitelist, in insertion order. ### Validation [Section titled “Validation”](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/#validation) * Each value must match `^\d{6,20}$` (Meta’s `business_phone_number_id` shape). * Up to 50 ids per subscription. * Every id must resolve to an account in the calling organisation — otherwise the request fails with `invalid_field_value` (HTTP 422). SDK Changed ----------- [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/#sdk-) `@kirimdev/sdk` picks up the new field via the fresh `openapi.json` snapshot. `webhookSubscriptions.create()` and `webhookSubscriptions.update()` accept `phone_number_ids`; the response object exposes it too. Zero migration for existing callers that don’t set the field. // Scope on createawait kirim.webhookSubscriptions.create({ url: 'https://your-app.example.com/webhooks/sales', events: ['message.received', 'message.status'], phone_number_ids: ['106540352242922'],}) // Clear the filter on an existing subscriptionawait kirim.webhookSubscriptions.update('wbs_...', { phone_number_ids: null,}) Dashboard Added --------------- [Section titled “Dashboard ”](https://docs.kirimdev.com/changelog/2026-07-03-webhook-per-account-filter/#dashboard-) Developers → Webhooks now includes a multi-select for WhatsApp accounts on the create dialog. Leave it empty to receive events from every connected account (the current behaviour). The subscription detail drawer shows the active filter; changing it currently means recreating the subscription — inline edit is planned but not shipped in this release. [Read the webhooks overview →](https://docs.kirimdev.com/webhooks/overview/) --- # Webhooks | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/webhooks/#_top) Reference Webhooks ======== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fwebhooks%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fwebhooks%2F%20and%20help%20me%20with%20the%20following%3A%20) Six event types fire across the customer lifecycle. Each follows the standard Kirimdev-native event envelope: { "id": "evt_…", "type": "customer.…", "created_at": "2026-06-04T11:14:55Z", "data": { … }} | Event | Source | Fires when | | --- | --- | --- | | [`customer.created`](https://docs.kirimdev.com/platform/webhooks/#customercreated) | `kirim` | `POST /v1/customers` succeeds. | | [`customer.updated`](https://docs.kirimdev.com/platform/webhooks/#customerupdated) | `kirim` | `PATCH /v1/customers/{id}` changes any field. | | [`customer.archived`](https://docs.kirimdev.com/platform/webhooks/#customerarchived) | `kirim` | `DELETE /v1/customers/{id}` soft-deletes the row. | | [`customer.onboarded`](https://docs.kirimdev.com/platform/webhooks/#customeronboarded) | `kirim` | End-customer completes Embedded Signup via a setup link. The business signal you usually want. | | [`customer.setup_link.created`](https://docs.kirimdev.com/platform/webhooks/#customersetup_linkcreated) | `kirim` | A setup link is generated. | | [`customer.setup_link.consumed`](https://docs.kirimdev.com/platform/webhooks/#customersetup_linkconsumed) | `kirim` | A setup link is successfully used (paired with `customer.onboarded`). | Subscribing ----------- [Section titled “Subscribing”](https://docs.kirimdev.com/platform/webhooks/#subscribing) await kirim.webhookSubscriptions.create({ url: 'https://yourapp.com/webhooks/kirim', events: [ 'customer.created', 'customer.updated', 'customer.archived', 'customer.onboarded', 'customer.setup_link.created', 'customer.setup_link.consumed', ],}) You can subscribe to any subset. Most platforms want at minimum `customer.onboarded` (when a tenant completes signup) and `customer.archived` (to update local UI). Every delivery carries a signed `X-Kirim-Signature-256` header. Verify it before trusting the payload — see [Signing](https://docs.kirimdev.com/webhooks/signing/) . * * * `customer.created` ------------------ [Section titled “customer.created”](https://docs.kirimdev.com/platform/webhooks/#customercreated) Fires immediately after a successful `POST /v1/customers` (or dashboard create, or MCP `create_customer`). ### Payload [Section titled “Payload”](https://docs.kirimdev.com/platform/webhooks/#payload) { "id": "evt_01HXYZABCDEFGHJKMNPQRSTVWX", "type": "customer.created", "created_at": "2026-06-04T10:00:00.000Z", "data": { "customer": { "id": "cus_335T08RM0EAKN9DTE6RD5RWP7B", "object": "customer", "name": "Acme Logistics", "email": "admin@acme.io", "status": "pending", "metadata": { "crm_id": "C-1234", "branch": "Jakarta" }, "archived_at": null, "team_id": "team_internal_id", "created_at": "2026-06-04T10:00:00.000Z", "updated_at": "2026-06-04T10:00:00.000Z" } }} ### Use it for [Section titled “Use it for”](https://docs.kirimdev.com/platform/webhooks/#use-it-for) * Mirroring the new customer into your CRM. * Surfacing an “Acme Logistics is now on the platform” toast in your operator dashboard. The customer starts in `status: 'pending'`. Wait for [`customer.onboarded`](https://docs.kirimdev.com/platform/webhooks/#customeronboarded) before assuming they can send messages. * * * `customer.updated` ------------------ [Section titled “customer.updated”](https://docs.kirimdev.com/platform/webhooks/#customerupdated) Fires when any of `name`, `email`, `metadata`, or `status` changes via `PATCH /v1/customers/{id}`. **Excludes archive** — that gets its own event. ### Payload [Section titled “Payload”](https://docs.kirimdev.com/platform/webhooks/#payload-1) { "id": "evt_01HXYZ…", "type": "customer.updated", "created_at": "2026-06-04T10:30:00.000Z", "data": { "customer": { "id": "cus_335T08…", "object": "customer", "name": "Acme Logistics", "email": "ops@acme.io", "status": "active", "metadata": { "crm_id": "C-1234", "branch": "Jakarta", "segment": "premium" }, "archived_at": null, "team_id": "team_internal_id", "created_at": "2026-06-04T10:00:00.000Z", "updated_at": "2026-06-04T10:30:00.000Z" } }} ### Use it for [Section titled “Use it for”](https://docs.kirimdev.com/platform/webhooks/#use-it-for-1) * Re-syncing metadata into your CRM. * Reacting to `status: 'suspended'` transitions (your platform might pause automations until restoration). * * * `customer.archived` ------------------- [Section titled “customer.archived”](https://docs.kirimdev.com/platform/webhooks/#customerarchived) Fires when a customer is soft-archived via `DELETE /v1/customers/{id}` or the dashboard “Archive” action. ### Payload [Section titled “Payload”](https://docs.kirimdev.com/platform/webhooks/#payload-2) { "id": "evt_01HXYZ…", "type": "customer.archived", "created_at": "2026-06-04T11:00:00.000Z", "data": { "customer": { "id": "cus_335T08…", "object": "customer", "name": "Acme Logistics", "email": "admin@acme.io", "status": "archived", "metadata": { "crm_id": "C-1234" }, "archived_at": "2026-06-04T11:00:00.000Z", "team_id": "team_internal_id", "created_at": "2026-06-04T10:00:00.000Z", "updated_at": "2026-06-04T11:00:00.000Z" } }} ### Use it for [Section titled “Use it for”](https://docs.kirimdev.com/platform/webhooks/#use-it-for-2) * Marking the customer as inactive in your own database. * Hiding their UI affordances in your operator dashboard. * * * `customer.onboarded` -------------------- [Section titled “customer.onboarded”](https://docs.kirimdev.com/platform/webhooks/#customeronboarded) The **business signal** for most platform integrations. Fires when an end-customer completes Meta Embedded Signup through a setup link and the WhatsApp account is attached. ### Payload [Section titled “Payload”](https://docs.kirimdev.com/platform/webhooks/#payload-3) { "id": "evt_01HXYZ…", "type": "customer.onboarded", "created_at": "2026-06-04T11:14:55.000Z", "data": { "customer_id": "cus_335T08RM0EAKN9DTE6RD5RWP7B", "account_id": "internal_wa_account_id_xxx", "phone_number_id": "1111475158712095", "phone_number": "+62 857-2516-5424" }} ### Field reference [Section titled “Field reference”](https://docs.kirimdev.com/platform/webhooks/#field-reference) | Field | What it is | | --- | --- | | `customer_id` | The public `cus_…` id. Match against your DB. | | `account_id` | Internal Kirimdev id for the WhatsApp account row. Use to disambiguate; not used for sending. | | `phone_number_id` | **Meta’s `business_phone_number_id`**. This is the value you plug into `POST /v1/{phone_number_id}/messages` to send on the new account. | | `phone_number` | Display-formatted phone (`+62 857-…`). | ### Use it for [Section titled “Use it for”](https://docs.kirimdev.com/platform/webhooks/#use-it-for-3) * Updating your CRM with the customer’s WhatsApp number. * Triggering a “Welcome — your WhatsApp is connected” automation. * Surfacing the new number in your operator dashboard. * * * `customer.setup_link.created` ----------------------------- [Section titled “customer.setup\_link.created”](https://docs.kirimdev.com/platform/webhooks/#customersetup_linkcreated) Fires immediately after a successful `POST /v1/customers/{id}/setup_links`. ### Payload [Section titled “Payload”](https://docs.kirimdev.com/platform/webhooks/#payload-4) { "id": "evt_01HXYZ…", "type": "customer.setup_link.created", "created_at": "2026-06-04T10:05:00.000Z", "data": { "customer_id": "cus_335T08…", "setup_link": { "id": "csl_GW4TD55B35VNGXG8SCV3P4Q9JB", "object": "customer_setup_link", "customer_id": "internal_cus_id", "status": "active", "token_last4": "Wvqb", "expires_at": "2026-06-11T10:05:00.000Z", "consumed_at": null, "success_redirect_url": "https://yourapp.com/onboarded", "failure_redirect_url": "https://yourapp.com/onboard-failed", "created_at": "2026-06-04T10:05:00.000Z" } }} ### Use it for [Section titled “Use it for”](https://docs.kirimdev.com/platform/webhooks/#use-it-for-4) * Audit logging of link generation events. * Surfacing link analytics in your platform’s UI (“3 links generated this week”). * * * `customer.setup_link.consumed` ------------------------------ [Section titled “customer.setup\_link.consumed”](https://docs.kirimdev.com/platform/webhooks/#customersetup_linkconsumed) Fires when an end-customer successfully completes Embedded Signup through a setup link. Always paired with [`customer.onboarded`](https://docs.kirimdev.com/platform/webhooks/#customeronboarded) — the two events fire within the same handler. ### Payload [Section titled “Payload”](https://docs.kirimdev.com/platform/webhooks/#payload-5) { "id": "evt_01HXYZ…", "type": "customer.setup_link.consumed", "created_at": "2026-06-04T11:14:55.000Z", "data": { "customer_id": "cus_335T08…", "setup_link": { "id": "csl_GW4TD…", "object": "customer_setup_link", "customer_id": "internal_cus_id", "status": "consumed", "token_last4": "Wvqb", "expires_at": "2026-06-11T10:05:00.000Z", "consumed_at": "2026-06-04T11:14:55.000Z", "success_redirect_url": "https://yourapp.com/onboarded", "failure_redirect_url": "https://yourapp.com/onboard-failed", "created_at": "2026-06-04T10:05:00.000Z" }, "account_id": "internal_wa_account_id_xxx" }} ### Use it for [Section titled “Use it for”](https://docs.kirimdev.com/platform/webhooks/#use-it-for-5) * Marking the link as used in your own database. * Closing the audit trail on a tenant’s onboarding journey (“Link created → emailed → consumed at 11:14 UTC”). For the _business_ signal of “the tenant is connected”, prefer [`customer.onboarded`](https://docs.kirimdev.com/platform/webhooks/#customeronboarded) — it carries the `phone_number_id` you need to send messages. * * * Pairing and ordering -------------------- [Section titled “Pairing and ordering”](https://docs.kirimdev.com/platform/webhooks/#pairing-and-ordering) `customer.setup_link.consumed` and `customer.onboarded` fire in quick succession (same handler, sequential publishes). They share the same `customer_id` and `account_id` values, so your handler can join them if needed. Webhook delivery order between events is **not guaranteed** at the HTTP layer — they may arrive in either order at your endpoint. Branch on `type` and store both before reconciling. `customer.created` always fires before any setup link events for that customer. `customer.archived` always fires after. Suppressed cases ---------------- [Section titled “Suppressed cases”](https://docs.kirimdev.com/platform/webhooks/#suppressed-cases) | Scenario | Event fires? | | --- | --- | | `customer.updated` with no changed fields | No | | Re-creating an already-archived customer | No (archive is reversible via dashboard; the restore action emits `customer.updated`) | | Setup link `revoked` | No dedicated event; the underlying `customer_setup_links` row state transition is observable via the link list endpoint. | | Setup link `expired` (lazy flip on read) | No dedicated event; same as above. | Failure modes ------------- [Section titled “Failure modes”](https://docs.kirimdev.com/platform/webhooks/#failure-modes) Webhook delivery follows the standard Kirimdev rules: * Subscriptions auto-pause after consecutive failures. See [Retries](https://docs.kirimdev.com/webhooks/retry/) . * HMAC signature on every delivery. See [Signing](https://docs.kirimdev.com/webhooks/signing/) . * Idempotent on `event_id` — retries carry the same `evt_…` id. Dedupe on your side. See also -------- [Section titled “See also”](https://docs.kirimdev.com/platform/webhooks/#see-also) * **[Customers](https://docs.kirimdev.com/platform/customers/) ** — the lifecycle that triggers these events. * **[Onboarding flow](https://docs.kirimdev.com/platform/onboarding-flow/) ** — where in the sequence each event fires. * **[Message correlation](https://docs.kirimdev.com/platform/message-correlation/) ** — route message webhooks to a tenant and link `msg_…` sends to their `wamid` status updates. * **[Webhooks / Overview](https://docs.kirimdev.com/webhooks/overview/) ** — subscription model, fan-out semantics. --- # Template responses now include category | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-08-10-template-category-in-responses/#_top) Template responses now include category ======================================= Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-10-template-category-in-responses%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-08-10-template-category-in-responses%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** August 10, 2026 `category` is now returned on template reads Added -------------------------------------------------- [Section titled “category is now returned on template reads ”](https://docs.kirimdev.com/changelog/2026-08-10-template-category-in-responses/#category-is-now-returned-on-template-reads-) You could always **submit** a `category` when creating a template (`POST /v1/{phone_number_id}/templates`), but the value was not returned when you read templates back — an asymmetry that made it impossible to tell a template’s category from the API alone. Both read endpoints now include a `category` field: * **`GET /v1/{phone_number_id}/templates`** * **`GET /v1/{phone_number_id}/templates/{name}`** { "id": "tmpl_01HXYZ…", "object": "template", "name": "order_update", "language": "id", "status": "approved", "category": "UTILITY", "content": "Pesanan {{1}} sedang diproses.", "…": "…"} The value is one of `MARKETING`, `UTILITY`, or `AUTHENTICATION`. The TypeScript SDK surfaces the same field on `Template` and template list items — upgrade to the latest version to read `template.category`. [API reference — List templates →](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/) [Create templates](https://docs.kirimdev.com/sending/create-templates/) --- # Message correlation & tenant routing | Kirimdev [Skip to content](https://docs.kirimdev.com/platform/message-correlation/#_top) Reference Message correlation & tenant routing ==================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fmessage-correlation%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fplatform%2Fmessage-correlation%2F%20and%20help%20me%20with%20the%20following%3A%20) If you run a multi-tenant SaaS on platform mode — one integration, many end-customers, each with their own WhatsApp number — you have two correlation problems to solve on your side: 1. **Tenant routing.** A `message.status` webhook arrives on your single webhook URL. Which end-customer does it belong to? 2. **Message correlation.** You sent a message and got back a `msg_…` id. The delivery-status webhooks (`sent` → `delivered` → `read` / `failed`) identify the message by Meta’s `wamid.…`. How do you link the two? Both are deterministic. This page is the end-to-end recipe. You never need to fall back on the destination number, timestamp, message body, or send order to correlate. The one identifier that ties it together: `phone_number_id` ----------------------------------------------------------- [Section titled “The one identifier that ties it together: phone\_number\_id”](https://docs.kirimdev.com/platform/message-correlation/#the-one-identifier-that-ties-it-together-phone_number_id) Every end-customer connects exactly one WhatsApp number, and that number has a stable **`phone_number_id`** (Meta’s `business_phone_number_id`). This is the join key between a tenant and every event about their messages. You learn a customer’s `phone_number_id` the moment they finish onboarding, from the [`customer.onboarded`](https://docs.kirimdev.com/platform/webhooks/#customeronboarded) event: { "type": "customer.onboarded", "data": { "customer_id": "cus_335T08RM0EAKN9DTE6RD5RWP7B", "account_id": "…", "phone_number_id": "1111475158712095", "phone_number": "+62 857-2516-5424" }} Persist `phone_number_id → customer_id` in your own database on receipt. That map is the backbone of every routing decision below. Routing a message webhook to a tenant ------------------------------------- [Section titled “Routing a message webhook to a tenant”](https://docs.kirimdev.com/platform/message-correlation/#routing-a-message-webhook-to-a-tenant) Message-level events — `message.received`, `message.sent`, and `message.status` — **do not carry a `cus_…` id in their payload**. They carry `phone_number_id`, and you resolve the tenant from your own map. There are two ways to consume them, and you can mix them: ### Option A — one webhook URL, route by `phone_number_id` [Section titled “Option A — one webhook URL, route by phone\_number\_id”](https://docs.kirimdev.com/platform/message-correlation/#option-a--one-webhook-url-route-by-phone_number_id) Subscribe once at the org level and read `phone_number_id` off each event: | Event | Where `phone_number_id` lives | | --- | --- | | `message.sent` | `data.meta.phone_number_id` (also `data.session`, an alias) | | `message.status` | `entry[0].changes[0].value.metadata.phone_number_id` | | `message.received` | `entry[0].changes[0].value.metadata.phone_number_id` | Look the value up in your `phone_number_id → customer_id` map. That is the tenant. This is the simplest setup and scales to any number of customers on a single endpoint. ### Option B — one subscription per customer, scoped by number [Section titled “Option B — one subscription per customer, scoped by number”](https://docs.kirimdev.com/platform/message-correlation/#option-b--one-subscription-per-customer-scoped-by-number) A webhook subscription can be **scoped to specific numbers** via `phone_number_ids`. Events for other numbers never reach that subscription, so the subscription that received the event _is_ the tenant discriminator: await kirim.webhookSubscriptions.create({ url: 'https://edupiere.example.com/webhooks/school-a', events: ['message.sent', 'message.status', 'message.received'], phone_number_ids: ['1111475158712095'], // School A's number only}) Use this when you want hard per-tenant isolation at the delivery layer (separate URLs, separate secrets, separate failure handling). See [Webhooks / Overview](https://docs.kirimdev.com/webhooks/overview/) for the full subscription and per-account filter model. Correlating `msg_…` with `wamid.…` ---------------------------------- [Section titled “Correlating msg\_… with wamid.…”](https://docs.kirimdev.com/platform/message-correlation/#correlating-msg_-with-wamid) Within one tenant, you still need to link a specific send to its status updates. The send gives you a `msg_…` id; the status webhooks speak `wamid.…`. The [`message.sent`](https://docs.kirimdev.com/webhooks/events/#messagesent) event is where the two meet. 1. **Send.** `POST /v1/{phone_number_id}/messages` returns `{ "id": "msg_…", "status": "pending", … }`. There is **no `wamid` yet** — the message is queued and Meta hasn’t accepted it. 2. **`message.sent` arrives.** It carries both ids together: { "type": "message.sent", "data": { "message": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "provider_id": "wamid.HBgN…" }, "meta": { "phone_number_id": "1111475158712095" } }} Store the pair `msg_… ↔ wamid.…` (scoped to the tenant you resolved from `phone_number_id`). 3. **`message.status` arrives** (one per transition: `sent`, `delivered`, `read`, `failed`). It identifies the message by `wamid` only: { "statuses": [{ "id": "wamid.HBgN…", "status": "delivered" }] } Join `statuses[0].id` back to your `msg_…` via the pair from step 2. ### Ordering is not guaranteed [Section titled “Ordering is not guaranteed”](https://docs.kirimdev.com/platform/message-correlation/#ordering-is-not-guaranteed) `message.status` can arrive **before** `message.sent` for the same message — they travel independent paths and webhook delivery order is not guaranteed. Design for it: * Key your status buffer on **`wamid`**, not on `msg_…`. * If a status arrives for a `wamid` you haven’t mapped yet, store it and reconcile when the matching `message.sent` lands. Statuses for a single message can also arrive out of order among themselves (a `read` before a `delivered`). Treat status as a state machine, not a sequence. ### Failed sends [Section titled “Failed sends”](https://docs.kirimdev.com/platform/message-correlation/#failed-sends) Failures split into two cases, and the identifier tells you which: | Case | `statuses[0].id` | How to correlate | | --- | --- | --- | | Failed **after** Meta accepted it | `wamid.…` | Join via the `message.sent` map, same as any status. | | Failed **before** Meta accepted it (validation, quota, compliance, transient outage) | `msg_…` | No `wamid` ever existed. The id equals the `id` from your send response — correlate directly. | For the pre-Meta case, `errors[0].code` is Meta’s integer code when the failure came back from Meta, or the sentinel `-1` for a Kirimdev-side refusal. Map either via the [error catalogue](https://docs.kirimdev.com/concepts/errors/) . Treat `statuses[0].id` as an opaque string that may start with `wamid.` **or** `msg_` and you handle both cases with one branch. See [pre-delivery failures](https://docs.kirimdev.com/webhooks/events/#messagestatus) for the full shape. Retention --------- [Section titled “Retention”](https://docs.kirimdev.com/platform/message-correlation/#retention) The `msg_… ↔ wamid.…` mapping lives on the message record. Once a message passes an organization’s retention window and is deleted, that mapping is **no longer available for lookup** through the API. Persist your own `msg_… ↔ wamid.…` map when `message.sent` fires and treat it as the system of record for correlation — don’t rely on the platform to reconstruct it later. See [Message retention](https://docs.kirimdev.com/concepts/message-retention/) . End-to-end checklist -------------------- [Section titled “End-to-end checklist”](https://docs.kirimdev.com/platform/message-correlation/#end-to-end-checklist) 1. On `customer.onboarded`, persist `phone_number_id → customer_id`. 2. Send via `POST /v1/{phone_number_id}/messages`; store the returned `msg_…` against the tenant. 3. On `message.sent`, store `msg_… ↔ wamid.…` (routed to the tenant via `phone_number_id` / `data.session`). 4. On `message.status`, resolve the tenant via `phone_number_id`, then join `statuses[0].id` to your `msg_…` — directly if it’s a `msg_…` (pre-Meta failure), or via the map if it’s a `wamid.…`. 5. Buffer any status that outruns its `message.sent` and reconcile on arrival. See also -------- [Section titled “See also”](https://docs.kirimdev.com/platform/message-correlation/#see-also) * **[Onboarding flow](https://docs.kirimdev.com/platform/onboarding-flow/) ** — where `customer.onboarded` and its `phone_number_id` come from. * **[Platform → Webhooks](https://docs.kirimdev.com/platform/webhooks/) ** — the six `customer.*` lifecycle events. * **[Event Catalogue](https://docs.kirimdev.com/webhooks/events/) ** — `message.sent`, `message.status`, and pre-Meta failures in full. * **[Payload examples](https://docs.kirimdev.com/webhooks/payloads/) ** — copy-paste fixtures for your handler tests. * **[Message retention](https://docs.kirimdev.com/concepts/message-retention/) ** — what deletion removes. --- # Register a WhatsApp number via API and SDK | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-07-21-register-phone-number/#_top) Register a WhatsApp number via API and SDK ========================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-21-register-phone-number%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-07-21-register-phone-number%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** July 21, 2026 Registration Added ------------------ [Section titled “Registration ”](https://docs.kirimdev.com/changelog/2026-07-21-register-phone-number/#registration-) You can now **register** a WhatsApp number for Cloud API sending directly from the Public API — the same “Register” action that was previously dashboard-only. Use it to finish onboarding a number that Meta reports as not yet `CONNECTED`, or to recover a number that a send degraded with a “number not registered” error. The account must already exist (onboard it through a [setup link](https://docs.kirimdev.com/platform/onboarding-flow/) first). Then find its `phone_number_id` and register it with the number’s 6-digit two-step-verification PIN. ### REST [Section titled “REST”](https://docs.kirimdev.com/changelog/2026-07-21-register-phone-number/#rest) curl -X POST https://api.kirimdev.com/v1/106540352242922/register \ -H "Authorization: Bearer $KIRIM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "pin": "123456" }' **PIN semantics mirror Meta.** If the number already has two-step verification, the PIN must **match** the existing one; if it does not, the PIN you send **becomes** the number’s permanent PIN. A wrong PIN, cooldown, or other Meta rejection returns `422 whatsapp_registration_failed` with a descriptive message; an unknown or cross-org `phone_number_id` returns `404 resource_not_found`. Since a 6-digit PIN is guessable, the endpoint is throttled per number: 5 failed attempts within ~15 minutes lock the number out with `429 too_many_registration_attempts` (before Meta is contacted), and a concurrent second call returns `409 registration_in_progress`. Unlike the other `/v1/{phone_number_id}/*` endpoints, `register` deliberately accepts numbers that are **not** yet connected — that is the whole point of the call. ### SDK Added [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-07-21-register-phone-number/#sdk-) const result = await kirim.phoneNumbers('106540352242922').register('123456')console.log(result.status, result.meta_status) // "connected" "CONNECTED" Accounts now expose `meta_status` Added --------------------------------------- [Section titled “Accounts now expose meta\_status ”](https://docs.kirimdev.com/changelog/2026-07-21-register-phone-number/#accounts-now-expose-meta_status-) `GET /v1/accounts` rows gain a `meta_status` field — Meta’s own phone-number status (`CONNECTED`, `PENDING`, `UNVERIFIED`, …), or `null` if never fetched. It sits alongside the existing `status` (Kirimdev’s lifecycle state) so you can tell which numbers need registration: > A number likely needs `register` when `status` is not `connected` **or** `meta_status` is not `CONNECTED`. Pass `?status=all` to include numbers still finishing onboarding. [Onboarding flow](https://docs.kirimdev.com/platform/onboarding-flow/) [Accounts API reference](https://docs.kirimdev.com/api/accounts/) --- # Create message templates via API, SDK, and MCP | Kirimdev [Skip to content](https://docs.kirimdev.com/changelog/2026-06-14-create-template/#_top) Create message templates via API, SDK, and MCP ============================================== Copy page [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-14-create-template%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fchangelog%2F2026-06-14-create-template%2F%20and%20help%20me%20with%20the%20following%3A%20) **Released:** June 14, 2026 Templates Added --------------- [Section titled “Templates ”](https://docs.kirimdev.com/changelog/2026-06-14-create-template/#templates-) You can now **create** WhatsApp message templates programmatically — previously the API surface was list / get / sync only, and authoring a template meant using the dashboard or Meta Business Manager. The request body is **components-only**: it mirrors Meta’s `message_templates` create shape (the same philosophy as `send_message` mirroring the Cloud API send body). Provide a `name`, a `category`, a `language`, and a `components` array with exactly one `BODY` component (plus optional `HEADER` / `FOOTER` / `BUTTONS`). For **IMAGE / VIDEO / DOCUMENT** headers, supply `example.header_url` with a public HTTPS sample — see [Create templates](https://docs.kirimdev.com/sending/create-templates/) . On success the template is submitted to Meta and persisted locally with `status: "pending"`. Meta reviews asynchronously, so poll `GET /v1/{phone_number_id}/templates/{name}` (or re-run `POST .../templates/sync`) for the eventual `approved` / `rejected` transition. ### REST [Section titled “REST”](https://docs.kirimdev.com/changelog/2026-06-14-create-template/#rest) curl -X POST https://api.kirimdev.com/v1/106540352242922/templates \ -H "Authorization: Bearer $KIRIM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "order_update", "category": "UTILITY", "language": "id", "components": [ { "type": "BODY", "text": "Pesanan {{1}} sedang diproses.", "example": { "body_text": [["A123"]] } } ] }' A `name` + `language` pair that already exists on the account returns `409 template_already_exists` (`param: "name"`) **before** any Meta call, so a retry loop never burns Meta’s template-create rate limit on a known conflict. In the SDK this surfaces as a `ConflictError`. ### SDK Added [Section titled “SDK ”](https://docs.kirimdev.com/changelog/2026-06-14-create-template/#sdk-) const template = await kirim .phoneNumbers('106540352242922') .templates.create({ name: 'order_update', category: 'UTILITY', language: 'id', components: [ { type: 'BODY', text: 'Pesanan {{1}} sedang diproses.', example: { body_text: [['A123']] }, }, ], }) console.log(template.status) // "pending" ### MCP Added [Section titled “MCP ”](https://docs.kirimdev.com/changelog/2026-06-14-create-template/#mcp-) The MCP server gains a `create_template` tool wrapping the same endpoint, so AI assistants can author templates end-to-end and then `sync_templates` to surface the review outcome. [Templates API reference](https://docs.kirimdev.com/api/templates/) [MCP tools](https://docs.kirimdev.com/tools/mcp/tools/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/templates/#_top) Templates Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Ftemplates%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Ftemplates%2F%20and%20help%20me%20with%20the%20following%3A%20) Templates --------- [Section titled “Templates”](https://docs.kirimdev.com/api/operations/tags/templates/#overview) List, create, and inspect WhatsApp message templates for a connected phone number. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/templates/#operations) GET [/{phone\_number\_id}/templates](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/) POST [/{phone\_number\_id}/templates](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/post/) GET [/{phone\_number\_id}/templates/{name}](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/) PATCH [/{phone\_number\_id}/templates/{name}](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/patch/) POST [/{phone\_number\_id}/templates/sync](https://docs.kirimdev.com/api/operations/phone_number_idtemplatessync/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/accounts/#_top) Accounts Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Faccounts%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Faccounts%2F%20and%20help%20me%20with%20the%20following%3A%20) Accounts -------- [Section titled “Accounts”](https://docs.kirimdev.com/api/operations/tags/accounts/#overview) Inspect the WhatsApp accounts connected to your organization. Each account exposes its Meta `business_phone_number_id` — the value used in `/{phone_number_id}/...` paths to address it (Meta-style). Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/accounts/#operations) GET [/accounts](https://docs.kirimdev.com/api/operations/accounts/) POST [/{phone\_number\_id}/register](https://docs.kirimdev.com/api/operations/phone_number_idregister/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/contacts/#_top) Contacts Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fcontacts%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fcontacts%2F%20and%20help%20me%20with%20the%20following%3A%20) Contacts -------- [Section titled “Contacts”](https://docs.kirimdev.com/api/operations/tags/contacts/#overview) CRUD over the people you exchange messages with, plus label attach + bulk-tag. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/contacts/#operations) GET [/{phone\_number\_id}/contacts](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/) POST [/{phone\_number\_id}/contacts](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/) GET [/{phone\_number\_id}/contacts/{id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/) DELETE [/{phone\_number\_id}/contacts/{id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/) PATCH [/{phone\_number\_id}/contacts/{id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/) POST [/{phone\_number\_id}/contacts/{id}/labels](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabels/) DELETE [/{phone\_number\_id}/contacts/{id}/labels/{label\_id}](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/) POST [/{phone\_number\_id}/contacts/bulk\_label](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/customers/#_top) Customers Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fcustomers%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fcustomers%2F%20and%20help%20me%20with%20the%20following%3A%20) Customers --------- [Section titled “Customers”](https://docs.kirimdev.com/api/operations/tags/customers/#overview) End-customers (tenant-of-tenant) — your platform’s own clients. Each Customer can connect their own WhatsApp accounts via setup links and you send messages on their behalf. Distinct from `Contacts`. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/customers/#operations) GET [/customers](https://docs.kirimdev.com/api/operations/customers/get/) POST [/customers](https://docs.kirimdev.com/api/operations/customers/post/) GET [/customers/{id}](https://docs.kirimdev.com/api/operations/customersid/get/) DELETE [/customers/{id}](https://docs.kirimdev.com/api/operations/customersid/delete/) PATCH [/customers/{id}](https://docs.kirimdev.com/api/operations/customersid/patch/) GET [/customers/{id}/setup\_links](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/) POST [/customers/{id}/setup\_links](https://docs.kirimdev.com/api/operations/customersidsetup_links/post/) DELETE [/customers/{id}/setup\_links/{link\_id}](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/) PATCH [/customers/{id}/setup\_links/{link\_id}](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/) DELETE [/customers/{id}/whatsapp\_accounts/{phone\_number\_id}](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/meta/#_top) Meta Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fmeta%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fmeta%2F%20and%20help%20me%20with%20the%20following%3A%20) Meta ---- [Section titled “Meta”](https://docs.kirimdev.com/api/operations/tags/meta/#overview) Liveness probe and API-key introspection. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/meta/#operations) GET [/health](https://docs.kirimdev.com/api/operations/health/) GET [/me](https://docs.kirimdev.com/api/operations/me/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/labels/#_top) Labels Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Flabels%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Flabels%2F%20and%20help%20me%20with%20the%20following%3A%20) Labels ------ [Section titled “Labels”](https://docs.kirimdev.com/api/operations/tags/labels/#overview) Coloured tags for contacts and conversations. Team-scoped per Kirimdev’s internal model. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/labels/#operations) GET [/labels](https://docs.kirimdev.com/api/operations/labels/get/) POST [/labels](https://docs.kirimdev.com/api/operations/labels/post/) GET [/labels/{id}](https://docs.kirimdev.com/api/operations/labelsid/get/) DELETE [/labels/{id}](https://docs.kirimdev.com/api/operations/labelsid/delete/) PATCH [/labels/{id}](https://docs.kirimdev.com/api/operations/labelsid/patch/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/conversations/#_top) Conversations Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fconversations%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fconversations%2F%20and%20help%20me%20with%20the%20following%3A%20) Conversations ------------- [Section titled “Conversations”](https://docs.kirimdev.com/api/operations/tags/conversations/#overview) Inspect chats, change assignment and status, attach labels. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/conversations/#operations) GET [/{phone\_number\_id}/conversations](https://docs.kirimdev.com/api/operations/phone_number_idconversations/) GET [/{phone\_number\_id}/conversations/{id}](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/) PATCH [/{phone\_number\_id}/conversations/{id}](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/) POST [/{phone\_number\_id}/conversations/{id}/labels](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/) DELETE [/{phone\_number\_id}/conversations/{id}/labels/{label\_id}](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/webhook-deliveries/#_top) Webhook Deliveries Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fwebhook-deliveries%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fwebhook-deliveries%2F%20and%20help%20me%20with%20the%20following%3A%20) Webhook Deliveries ------------------ [Section titled “Webhook Deliveries”](https://docs.kirimdev.com/api/operations/tags/webhook-deliveries/#overview) Dead-letter queue + replay surface for outbound webhook failures. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/webhook-deliveries/#operations) GET [/webhook\_deliveries](https://docs.kirimdev.com/api/operations/webhook_deliveries/) GET [/webhook\_deliveries/{id}](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/) POST [/webhook\_deliveries/{id}/replay](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/) POST [/webhook\_deliveries/bulk\_replay](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/) --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/webhook-subscriptions/#_top) Webhook Subscriptions Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fwebhook-subscriptions%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fwebhook-subscriptions%2F%20and%20help%20me%20with%20the%20following%3A%20) Webhook Subscriptions --------------------- [Section titled “Webhook Subscriptions”](https://docs.kirimdev.com/api/operations/tags/webhook-subscriptions/#overview) Subscribe to events, rotate signing secrets, pause/resume delivery. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/webhook-subscriptions/#operations) GET [/webhook\_subscriptions](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/) POST [/webhook\_subscriptions](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/) GET [/webhook\_subscriptions/{id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/) DELETE [/webhook\_subscriptions/{id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/) PATCH [/webhook\_subscriptions/{id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/) POST [/webhook\_subscriptions/{id}/secrets](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/) DELETE [/webhook\_subscriptions/{id}/secrets/{secret\_id}](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/) --- # Introspect the calling API key | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/me/#_top) Meta Introspect the calling API key ============================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fme%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fme%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /me Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/me" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/me';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/me"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/me \ --header 'Authorization: Bearer ' * Production Returns the organization, API key, rate-limit tier, and the list of teams under the organization associated with the bearer token. Use to verify key validity from automation scripts and to discover the `team_id` values required by team-scoped writes (e.g. `POST /v1/customers` on multi-team orgs). Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/me/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/me/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/me/#200) API key context Media type application/json object **data** required The requested resource. object **organization** required object **id** required string **object** required string Allowed values: organization **name** required string **api\_key** required object **id** required string **object** required string Allowed values: api\_key **label** required string **last4** required string **rate\_limits** required object **tier** required string **write\_per\_minute** required integer **read\_per\_minute** required integer **teams** required Teams under the organization, ordered by creation time (oldest first). For single-team orgs, `team_id` is auto-selected on writes; for multi-team orgs you must pass one of these ids explicitly. Array object **id** required Internal team id — pass this as `team_id` on team-scoped writes (e.g. `POST /v1/customers`). string **object** required string Allowed values: team **name** required string **slug** required string **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "organization": { "id": "org_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "organization" }, "api_key": { "id": "key_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "api_key" }, "teams": [ { "object": "team" } ] }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/me/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/me/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/me/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Delete a label | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/labelsid/delete/#_top) Labels Delete a label ============== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabelsid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabelsid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /labels/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Hard-deletes the label and cascades to every contact and conversation it was attached to (the row in the join table goes away, the parent resources stay). Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#path-parameters) **id** required Public Kirimdev label ID. string /^lbl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example lbl_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev label ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#200) Deleted Media type application/json object **data** required The requested resource. object **id** required string **object** required string Allowed values: label **deleted** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "label", "deleted": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/labelsid/delete/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Fetch a label by id | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/labelsid/get/#_top) Labels Fetch a label by id =================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabelsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabelsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /labels/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Fetch one organization label by its public `lbl_` identifier, including its team scope and dashboard color preset. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/labelsid/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/labelsid/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/labelsid/get/#path-parameters) **id** required Public Kirimdev label ID. string /^lbl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example lbl_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev label ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/labelsid/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/labelsid/get/#200) Label resource Media type application/json object **data** required object **id** required string **object** required string Allowed values: label **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "label", "color": "gray" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/labelsid/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/labelsid/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/labelsid/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/labelsid/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/labelsid/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Delete a webhook subscription | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#_top) Webhook Subscriptions Delete a webhook subscription ============================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /webhook\_subscriptions/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Permanently deletes a webhook subscription, stops future deliveries, and deletes its existing delivery history via cascade. Retrying after success returns not found. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#path-parameters) **id** required Public Kirimdev webhook-subscription ID. string /^wbs\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbs_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev webhook-subscription ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#200) Deleted Media type application/json object **data** required The requested resource. object **id** required string **deleted** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "deleted": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/delete/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List connected WhatsApp accounts | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/accounts/#_top) Accounts List connected WhatsApp accounts ================================ Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Faccounts%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Faccounts%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /accounts Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/accounts?status=connected&customer_id=cus_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/accounts?status=connected&customer_id=cus_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/accounts"; let querystring = [ ("status", "connected"), ("customer_id", "cus_01HXYZABCDEFGHJKMNPQRSTVWX"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/accounts?status=connected&customer_id=cus_01HXYZABCDEFGHJKMNPQRSTVWX' \ --header 'Authorization: Bearer ' * Production List the WhatsApp accounts attached to the calling organization. The returned `business_phone_number_id` is the value to use in `/{phone_number_id}/...` path-based endpoints (Meta-style — sender comes from the URL, not the body). Defaults to `status=connected` because that’s the only state in which sends are accepted; pass `status=all` to inspect onboarding-in-progress or disconnected accounts. Response is intentionally not paginated. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/accounts/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/accounts/#parameters) ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/accounts/#query-parameters) **status** Account lifecycle filter. Omit for connected accounts; use `all` to include onboarding and disconnected accounts. string default: connected Allowed values: connected all ##### Example connected Account lifecycle filter. Omit for connected accounts; use `all` to include onboarding and disconnected accounts. **customer\_id** Return accounts owned by this end-customer. Unknown or cross-organization IDs produce an empty list. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Return accounts owned by this end-customer. Unknown or cross-organization IDs produce an empty list. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/accounts/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/accounts/#200) Account list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **object** required string Allowed values: account **phone\_number\_id** required Meta WhatsApp Business `phone_number_id`. Use as the `{phone_number_id}` path parameter in `/v1/{phone_number_id}/...` endpoints. Nullable while onboarding is in flight. string | null **phone\_number** required string | null **name** required string | null **status** required Lifecycle state of the account (e.g. `connected`, `disconnected`, `degraded`, `onboarding`). string **meta\_status** required Meta’s own phone-number status (`CONNECTED`, `PENDING`, `UNVERIFIED`, `DISCONNECTED`, …), or `null` if never fetched. Distinct from `status`: a value other than `CONNECTED` — or a `status` other than `connected` — means the number likely needs registration via `POST /v1/{phone_number_id}/register`. string | null **customer\_id** required Public id of the end-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. Filter the list endpoint via `?customer_id=cus_...`. string | null **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "object": "account", "phone_number_id": "106540352242922", "phone_number": "+628111222333", "name": "Customer Support", "status": "connected", "meta_status": "CONNECTED", "customer_id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/accounts/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/accounts/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/accounts/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/accounts/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Update a customer | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customersid/patch/#_top) Customers Update a customer ================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) PATCH /customers/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX" payload := strings.NewReader("{ \"name\": \"example\", \"email\": \"hello@example.com\", \"metadata\": \"example\", \"status\": \"pending\" }") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX';const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"name":"example","email":"hello@example.com","metadata":"example","status":"pending"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX"; let payload = json!({ "name": "example", "email": "hello@example.com", "metadata": "example", "status": "pending" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request PATCH \ --url https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "email": "hello@example.com", "metadata": "example", "status": "pending" }' * Production Update customer profile fields or lifecycle status. Send at least one field; use `null` to clear nullable fields. Every request updates `updated_at` and publishes a `customer.updated` event, so retrying can publish duplicate events. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customersid/patch/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customersid/patch/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/customersid/patch/#path-parameters) **id** required Public Kirimdev end-customer ID. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev end-customer ID. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/customersid/patch/#request-body) Media type application/json object **name** string \>= 1 characters <= 200 characters **email** string | null format: email <= 255 characters **metadata** object | null **status** string Allowed values: pending active suspended Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customersid/patch/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customersid/patch/#200) Updated customer Media type application/json object **data** required object **id** required string **object** required string Allowed values: customer **name** required string **email** required string | null **status** required string Allowed values: pending active suspended archived **metadata** required object | null **archived\_at** required string | null format: date-time **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "customer", "status": "pending" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customersid/patch/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customersid/patch/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customersid/patch/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your trial has ended or subscription is inactive. Upgrade to continue. { "error": { "type": "permission_error", "code": "subscription_inactive", "message": "Your trial has ended or subscription is inactive. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/customersid/patch/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customersid/patch/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customersid/patch/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Archive a customer | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customersid/delete/#_top) Customers Archive a customer ================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /customers/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Soft-archives the customer. WhatsApp accounts previously assigned remain in the database with `customer_id` unchanged — message history is never destroyed. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customersid/delete/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customersid/delete/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/customersid/delete/#path-parameters) **id** required Public Kirimdev end-customer ID. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev end-customer ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customersid/delete/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customersid/delete/#200) Archived Media type application/json object **data** required The requested resource. object **id** required string **object** required string Allowed values: customer **archived** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "customer", "archived": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customersid/delete/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customersid/delete/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customersid/delete/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your trial has ended or subscription is inactive. Upgrade to continue. { "error": { "type": "permission_error", "code": "subscription_inactive", "message": "Your trial has ended or subscription is inactive. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/customersid/delete/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customersid/delete/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customersid/delete/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Create a label | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/labels/post/#_top) Labels Create a label ============== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabels%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabels%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /labels Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/labels" payload := strings.NewReader("{ \"team_id\": \"example\", \"name\": \"example\", \"color\": \"gray\" }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/labels';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"team_id":"example","name":"example","color":"gray"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/labels"; let payload = json!({ "team_id": "example", "name": "example", "color": "gray" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/labels \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "team_id": "example", "name": "example", "color": "gray" }' * Production Create a label. Single-team orgs auto-resolve `team_id`; multi-team orgs MUST pass it. Names are unique per team — duplicates return `invalid_field_value`. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/labels/post/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/labels/post/#parameters) ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/labels/post/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/labels/post/#request-body) Media type application/json object **team\_id** string \>= 1 characters <= 64 characters **name** required string \>= 1 characters <= 50 characters **color** string default: gray Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/labels/post/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/labels/post/#200) Label created Media type application/json object **data** required object **id** required string **object** required string Allowed values: label **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "label", "color": "gray" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/labels/post/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/labels/post/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/labels/post/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/labels/post/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Idempotency-Key was reused with a different request body. { "error": { "type": "invalid_request_error", "code": "idempotency_key_reuse", "message": "Idempotency-Key was reused with a different request body.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/labels/post/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/labels/post/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Fetch a contact by id | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#_top) Contacts Fetch a contact by id ===================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/contacts/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Fetch one contact belonging to this WhatsApp account. Phone number, BSUID, and username fields may be null depending on which identity Meta has shared. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev contact ID. string /^ctc\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example ctc_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev contact ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#200) Contact resource Media type application/json object **data** required object **id** required string **object** required string Allowed values: contact **phone\_number** required Phone number in E.164. NULL when the contact was created via BSUID (username-adopted user with no shared phone number). See docs/meta-docs/bsuid.md. string | null **bsuid** required Business-Scoped User ID. Populated by inbound webhooks or when the contact was created via BSUID. Format: `{ISO alpha-2 country}.{alphanumeric ≤128}`. string | null **parent\_bsuid** required Parent BSUID (managed businesses only). Format: `{ISO alpha-2 country}.ENT.{alphanumeric ≤128}`. string | null **username** required WhatsApp username of the contact, if the user has adopted the username feature. Case-insensitive when comparing per Meta rules; `.` and `_` are significant. string | null **name** required string | null **email** required string | null **metadata** required object | null **labels** required Labels currently attached to this contact. Array object **id** required string **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "contact", "phone_number": "+628123456789", "bsuid": "US.13491208655302741918", "parent_bsuid": "US.ENT.11815799212886844830", "username": "pablomorales", "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "gray" } ], "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } } }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Fetch a conversation by id | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#_top) Conversations Fetch a conversation by id ========================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/conversations/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Fetch one inbox conversation belonging to this WhatsApp account, including contact, assignee, unread count, lifecycle status, and activity timestamps. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev conversation ID. string /^cnv\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cnv_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev conversation ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#200) Conversation resource Media type application/json object **data** required object **id** required string **object** required string Allowed values: conversation **status** required string Allowed values: open resolved pending **contact** required object **id** required string **phone\_number** required string | null **name** required string | null **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **assignee** required object **id** required string **name** required string | null **email** required string | null **labels** required Labels currently attached to this conversation. Array object **id** required string **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **unread\_count** required integer **last\_message\_at** required string | null format: date-time **last\_inbound\_at** required string | null format: date-time **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "conversation", "status": "open", "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } }, "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "gray" } ] }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Overview | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/tags/messages/#_top) Messages Overview ======== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fmessages%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Ftags%2Fmessages%2F%20and%20help%20me%20with%20the%20following%3A%20) Messages -------- [Section titled “Messages”](https://docs.kirimdev.com/api/operations/tags/messages/#overview) Send and read WhatsApp messages across every supported content type. Operations ---------- [Section titled “ Operations ”](https://docs.kirimdev.com/api/operations/tags/messages/#operations) GET [/{phone\_number\_id}/messages](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/) POST [/{phone\_number\_id}/messages](https://docs.kirimdev.com/api/operations/phone_number_idmessages/post/) GET [/{phone\_number\_id}/messages/{id}](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/) GET [/{phone\_number\_id}/messages/{id}/media](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/) --- # Detach a label from a contact | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#_top) Contacts Detach a label from a contact ============================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsidlabelslabel_id%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsidlabelslabel_id%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /{phone\_number\_id}/contacts/{id}/labels/{label\_id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Detach a label from a contact. The operation is idempotent: retrying after the label is already absent returns the same detached result. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev contact ID. string /^ctc\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example ctc_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev contact ID. **label\_id** required Public Kirimdev label ID to attach or detach. string /^lbl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example lbl_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev label ID to attach or detach. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#200) Detached Media type application/json object **data** required The requested resource. object **contact\_id** required string **label\_id** required string **attached** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "attached": false }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsidlabelslabel_id/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Redirect to the media asset for a message | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#_top) Messages Redirect to the media asset for a message ========================================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idmessagesidmedia%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idmessagesidmedia%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/messages/{id}/media Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX/media" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX/media';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX/media"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX/media \ --header 'Authorization: Bearer ' * Production Returns a 302 redirect to the underlying CDN URL when the message has media (image, document, video, audio). Returns 404 if the message has no media or if media download is still in flight. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev message ID returned by send, list, and webhook operations. string /^msg\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example msg_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev message ID returned by send, list, and webhook operations. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#responses) ### 302 [Section titled “302 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#302) Redirect to the media URL #### Headers [Section titled “Headers ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#headers) **Location** string Public CDN URL for the asset ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesidmedia/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Detach a label from a conversation | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#_top) Conversations Detach a label from a conversation ================================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsidlabelslabel_id%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsidlabelslabel_id%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /{phone\_number\_id}/conversations/{id}/labels/{label\_id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Detach a label from an inbox conversation. The operation is idempotent: retrying after the label is already absent returns the same detached result. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev conversation ID. string /^cnv\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cnv_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev conversation ID. **label\_id** required Public Kirimdev label ID to attach or detach. string /^lbl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example lbl_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev label ID to attach or detach. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#200) Detached Media type application/json object **data** required The requested resource. object **conversation\_id** required string **label\_id** required string **attached** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "attached": false }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabelslabel_id/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Delete a contact | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#_top) Contacts Delete a contact ================ Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsid%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /{phone\_number\_id}/contacts/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Hard-deletes the contact and cascades to its conversations, messages, and label attachments. Irreversible. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev contact ID. string /^ctc\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example ctc_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev contact ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#200) Deleted Media type application/json object **data** required The requested resource. object **id** required string **object** required string Allowed values: contact **deleted** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "contact", "deleted": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/delete/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List customers | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customers/get/#_top) Customers List customers ============== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomers%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomers%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /customers Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers?status=pending&search=Acme&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers?status=pending&search=Acme&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers"; let querystring = [ ("status", "pending"), ("search", "Acme"), ("limit", "25"), ("cursor", "eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/customers?status=pending&search=Acme&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ' \ --header 'Authorization: Bearer ' * Production List end-customers (tenant-of-tenant) attached to the organization. Each customer can own one or more WhatsApp accounts via setup links. NOTE: a customer here is NOT a WhatsApp contact — see the `/{phone_number_id}/contacts` resource for those. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customers/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customers/get/#parameters) ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/customers/get/#query-parameters) **status** Filter customers by lifecycle state. string Allowed values: pending active suspended archived ##### Example active Filter customers by lifecycle state. **search** Case-insensitive pattern search across customer name and email. `%` matches any sequence of characters and `_` matches one character. string \>= 1 characters <= 200 characters ##### Example Acme Case-insensitive pattern search across customer name and email. `%` matches any sequence of characters and `_` matches one character. **limit** Number of items to return. Defaults to 25; minimum 1 and maximum 100. string default: 25 /^\\d+$/ ##### Example 25 Number of items to return. Defaults to 25; minimum 1 and maximum 100. **cursor** Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. string \>= 1 characters ##### Example eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customers/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customers/get/#200) Customer list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: customer **name** required string **email** required string | null **status** required string Allowed values: pending active suspended archived **metadata** required object | null **archived\_at** required string | null format: date-time **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "customer", "status": "pending" } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customers/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customers/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customers/get/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your current plan does not include this feature. Upgrade to continue. { "error": { "type": "permission_error", "code": "feature_not_entitled", "message": "Your current plan does not include this feature. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customers/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customers/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Liveness probe | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/health/#_top) Meta Liveness probe ============== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fhealth%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fhealth%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /health Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/health" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/health';const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/health"; let client = reqwest::Client::new(); let response = client.get(url) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/health * Production Unauthenticated health check. Returns 200 if the API is up. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/health/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/health/#200) API is healthy Media type application/json object **data** required object **status** required string Allowed values: ok **request\_id** required string ##### Example { "data": { "status": "ok" }} --- # Fetch a sent message by id | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#_top) Messages Fetch a sent message by id ========================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idmessagesid%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idmessagesid%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/messages/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/106540352242922/messages/msg_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Retrieve a single message by `msg_*` id. Supports short-lived server-side caching for high-frequency status polling, and `ETag`/`If-None-Match` for unchanged responses. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev message ID returned by send, list, and webhook operations. string /^msg\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example msg_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev message ID returned by send, list, and webhook operations. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#200) Message resource Media type application/json object **data** required object **id** required string **object** required string Allowed values: message **to** Recipient’s phone number in E.164 (with leading `+`). NULL when the message targeted a Business-Scoped User ID (BSUID) recipient and the contact has no known phone number. See docs/meta-docs/bsuid.md. string | null **bsuid** Recipient contact’s Business-Scoped User ID. Present when the contact has been enriched with a BSUID from a Meta webhook (or from a BSUID-first send). NULL for phone-only contacts. string | null **parent\_bsuid** Parent BSUID for managed businesses with linked business portfolios. NULL for regular accounts. string | null **username** Recipient contact’s WhatsApp username (case-insensitive comparison; case-preserving in storage). NULL when the contact has not adopted the WhatsApp username feature. string | null **type** string **status** required string Allowed values: queued pending sent delivered read failed **created\_at** string format: date-time **played\_at** ISO-8601 timestamp when the recipient first played an outbound voice note. Populated from Meta’s `played` status webhook; omitted on non-voice messages and until playback occurs. string format: date-time **conversation\_id** string **message\_id** string **reaction** object **message\_id** required Target Meta WhatsApp message id (wamid). string **emoji** required Reaction emoji. An empty string removes the existing business reaction. string <= 16 characters **error** object **code** required Stable Kirim error code. Known values include `outside_24h_window`, `marketing_opted_out`, `marketing_blocked_by_user`, `recipient_unavailable`, `unsupported_message_type`, `account_restricted`, `account_locked`, `consent_required`, `customer_suspended`, `contact_blocked`, `permission_revoked`, `auth_expired`, `app_rate_limited`, `account_rate_limited`, `template_not_found`, `template_paused`, `template_policy_violation`, `flow_blocked`, `media_upload_failed`, `media_download_failed`, `undeliverable`, `policy_violation`, `subscription_inactive`, `upstream_error`. string **message** required string **provider\_code** required number | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "to": "+628123456789", "bsuid": "US.13491208655302741918", "parent_bsuid": "US.ENT.11815799212886844830", "username": "pablomorales", "status": "queued", "reaction": { "message_id": "wamid.HBgN...", "emoji": "👍" } }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} #### Headers [Section titled “Headers ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#headers) **ETag** string Weak entity tag derived from `status` and error fields. Send as `If-None-Match` on the next poll — unchanged messages return `304`. ### 304 [Section titled “304 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#304) Not modified — request carried a matching `If-None-Match` ETag. #### Headers [Section titled “Headers ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#headers) **ETag** string Same weak entity tag as the cached representation. ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessagesid/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Attach or detach a label across many contacts | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#_top) Contacts Attach or detach a label across many contacts ============================================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsbulk_label%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsbulk_label%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /{phone\_number\_id}/contacts/bulk\_label Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/contacts/bulk_label" payload := strings.NewReader("{ \"contact_ids\": [ \"example\" ], \"label_id\": \"example\", \"operation\": \"attach\" }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/contacts/bulk_label';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"contact_ids":["example"],"label_id":"example","operation":"attach"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/contacts/bulk_label"; let payload = json!({ "contact_ids": ("example"), "label_id": "example", "operation": "attach" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/106540352242922/contacts/bulk_label \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "contact_ids": [ "example" ], "label_id": "example", "operation": "attach" }' * Production Apply or remove a label from up to 1000 contacts in a single transaction. Contacts not owned by the path-scoped account are silently skipped and counted under `skipped_cross_org`. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#request-body) Media type application/json object **contact\_ids** required Array \>= 1 items <= 1000 items **label\_id** required string /^lbl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ **operation** required string Allowed values: attach detach Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#200) Bulk operation result Media type application/json object **data** required The requested resource. object **applied** required integer **skipped\_cross\_org** required integer **skipped\_team\_mismatch** required integer **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsbulk_label/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List messages | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#_top) Messages List messages ============= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idmessages%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idmessages%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/messages Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/messages?conversation_id=cnv_01HXYZABCDEFGHJKMNPQRSTVWX&direction=inbound&status=pending&created_after=2026-09-10T00%3A00%3A00.000Z&created_before=2026-09-11T00%3A00%3A00.000Z&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/messages?conversation_id=cnv_01HXYZABCDEFGHJKMNPQRSTVWX&direction=inbound&status=pending&created_after=2026-09-10T00%3A00%3A00.000Z&created_before=2026-09-11T00%3A00%3A00.000Z&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/messages"; let querystring = [ ("conversation_id", "cnv_01HXYZABCDEFGHJKMNPQRSTVWX"), ("direction", "inbound"), ("status", "pending"), ("created_after", "2026-09-10T00:00:00.000Z"), ("created_before", "2026-09-11T00:00:00.000Z"), ("limit", "25"), ("cursor", "eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/106540352242922/messages?conversation_id=cnv_01HXYZABCDEFGHJKMNPQRSTVWX&direction=inbound&status=pending&created_after=2026-09-10T00%3A00%3A00.000Z&created_before=2026-09-11T00%3A00%3A00.000Z&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ' \ --header 'Authorization: Bearer ' * Production List messages for the WhatsApp account identified by `phone_number_id`. Filter by `conversation_id`, `direction`, `status`, or a `created_after`/`created_before` window. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#query-parameters) **conversation\_id** Return messages from one public inbox conversation. Unknown or cross-account IDs produce an empty list. string /^cnv\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cnv_01HXYZABCDEFGHJKMNPQRSTVWX Return messages from one public inbox conversation. Unknown or cross-account IDs produce an empty list. **direction** Filter messages received from contacts (`inbound`) or sent by your business (`outbound`). string Allowed values: inbound outbound ##### Example inbound Filter messages received from contacts (`inbound`) or sent by your business (`outbound`). **status** Filter by the latest persisted delivery state. string Allowed values: pending sent delivered read failed ##### Example delivered Filter by the latest persisted delivery state. **created\_after** Return messages created strictly after this ISO 8601 instant. string format: date-time ##### Example 2026-09-10T00:00:00.000Z Return messages created strictly after this ISO 8601 instant. **created\_before** Return messages created strictly before this ISO 8601 instant. string format: date-time ##### Example 2026-09-11T00:00:00.000Z Return messages created strictly before this ISO 8601 instant. **limit** Number of items to return. Defaults to 25; minimum 1 and maximum 100. string default: 25 /^\\d+$/ ##### Example 25 Number of items to return. Defaults to 25; minimum 1 and maximum 100. **cursor** Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. string \>= 1 characters ##### Example eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#200) Message list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: message **conversation\_id** required string **to** required string | null **direction** required string Allowed values: inbound outbound **type** required string **content** required string | null **media\_url** required string | null **status** required string Allowed values: pending sent delivered read failed **created\_at** required string format: date-time **unsupported** object **type** required Meta-reported sub-kind. Current values include `edit` (contact edited a message; Meta refused to forward the new body) and `unknown` (message type Meta itself cannot classify). Kept open-string because Meta may introduce new values (`view_once`, `poll`, …). string **error** object **code** required Stable Kirim error code. Known values include `outside_24h_window`, `marketing_opted_out`, `marketing_blocked_by_user`, `recipient_unavailable`, `unsupported_message_type`, `account_restricted`, `account_locked`, `consent_required`, `customer_suspended`, `contact_blocked`, `permission_revoked`, `auth_expired`, `app_rate_limited`, `account_rate_limited`, `template_not_found`, `template_paused`, `template_policy_violation`, `flow_blocked`, `media_upload_failed`, `media_download_failed`, `undeliverable`, `policy_violation`, `subscription_inactive`, `upstream_error`. string **message** required string **provider\_code** required number | null **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example success Most recent inbox messages { "data": [ { "id": "msg_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "message", "conversation_id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWX", "to": "+628123456789", "bsuid": null, "parent_bsuid": null, "username": null, "direction": "inbound", "type": "text", "content": "Halo, apakah pesanan saya sudah dikirim?", "media_url": null, "status": "delivered", "created_at": "2026-09-10T09:00:00.000Z" } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idmessages/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Update redirect URLs on an active setup link | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#_top) Customers Update redirect URLs on an active setup link ============================================ Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidsetup_linkslink_id%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidsetup_linkslink_id%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) PATCH /customers/{id}/setup\_links/{link\_id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX" payload := strings.NewReader("{ \"success_redirect_url\": \"https://example.com\", \"failure_redirect_url\": \"https://example.com\" }") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX';const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"success_redirect_url":"https://example.com","failure_redirect_url":"https://example.com"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX"; let payload = json!({ "success_redirect_url": "https://example.com", "failure_redirect_url": "https://example.com" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request PATCH \ --url https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "success_redirect_url": "https://example.com", "failure_redirect_url": "https://example.com" }' * Production Recover from a typo in `success_redirect_url` / `failure_redirect_url` without revoking and regenerating the link. Only works while `status = active`; pass `null` to clear a redirect. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#path-parameters) **id** required Public Kirimdev end-customer ID. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev end-customer ID. **link\_id** required Public setup-link ID belonging to this customer. string /^csl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example csl_01HXYZABCDEFGHJKMNPQRSTVWX Public setup-link ID belonging to this customer. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#request-body) Media type application/json object **success\_redirect\_url** Any of: * [string](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#tab-panel-30) * [null](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#tab-panel-31) string format: uri <= 2048 characters null **failure\_redirect\_url** Any of: * [string](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#tab-panel-32) * [null](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#tab-panel-33) string format: uri <= 2048 characters null ##### Example generated { "success_redirect_url": "https://example.com", "failure_redirect_url": "https://example.com"} Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#200) Updated setup link Media type application/json object **data** required object **id** required string **object** required string Allowed values: customer\_setup\_link **customer\_id** required string **status** required string Allowed values: active consumed expired revoked **token\_last4** required string **expires\_at** required string format: date-time **consumed\_at** required string | null format: date-time **success\_redirect\_url** required Where the tenant is redirected after successful Embedded Signup. We append `?customer_id=&account_id=&status=success` on the redirect. string | null format: uri **failure\_redirect\_url** required Where the tenant is redirected on failure (link error, Meta signup cancelled, etc.). We append `?customer_id=&status=failed&reason=`. string | null format: uri **created\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "csl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "customer_setup_link", "status": "active" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your trial has ended or subscription is inactive. Upgrade to continue. { "error": { "type": "permission_error", "code": "subscription_inactive", "message": "Your trial has ended or subscription is inactive. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Setup link is no longer active and cannot be modified. { "error": { "type": "conflict", "code": "setup_link_inactive", "message": "Setup link is no longer active and cannot be modified.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/patch/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Register a phone number | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idregister/#_top) Accounts Register a phone number ======================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idregister%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idregister%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /{phone\_number\_id}/register Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/register" payload := strings.NewReader("{ \"pin\": \"123456\" }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/register';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"pin":"123456"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/register"; let payload = json!({"pin": "123456"}); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/106540352242922/register \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "pin": "123456" }' * Production Register a WhatsApp Business number for Cloud API sending using its 6-digit two-step-verification PIN. This is the API equivalent of the dashboard’s “Register” action — use it to finish onboarding a number that Meta reports as not yet `CONNECTED`, or to recover a number degraded with a “not registered” error. The account row must already exist: connect the number first via a customer setup link / embedded signup, then find its `phone_number_id` from `GET /v1/accounts` (rows whose `status` isn’t `connected` or whose `meta_status` isn’t `CONNECTED` are the ones that need this call). PIN semantics mirror Meta: if the number already has two-step verification the PIN must match the existing one; if it doesn’t, the PIN you send becomes the number’s permanent PIN. A wrong PIN, cooldown, or other Meta business error returns `422 whatsapp_registration_failed` with a descriptive message. Unlike the other per-account endpoints, this one accepts numbers in any (non-connected) state — that’s the whole point. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#request-body) Media type application/json _Register phone number_ object **pin** required The WhatsApp number’s 6-digit two-step-verification PIN. Must match the existing PIN if one is set; otherwise it becomes the number’s permanent PIN. string /^\\d{6}$/ ##### Example 123456 Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#200) Number registered — it can send now. Media type application/json object **data** required The requested resource. object **object** required string Allowed values: phone\_number\_registration **phone\_number\_id** required string **registered** required boolean **status** required Kirim lifecycle status after registration (typically `connected`). string **meta\_status** required Meta’s phone-number status after registration. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "phone_number_registration", "phone_number_id": "106540352242922", "registered": true, "status": "connected", "meta_status": "CONNECTED" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A registration for this WhatsApp number is already in progress. Retry in a moment. { "error": { "type": "conflict", "code": "registration_in_progress", "message": "A registration for this WhatsApp number is already in progress. Retry in a moment.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default WhatsApp number registration failed. Check the two-step-verification PIN and try again. { "error": { "type": "invalid_request_error", "code": "whatsapp_registration_failed", "message": "WhatsApp number registration failed. Check the two-step-verification PIN and try again.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 502 [Section titled “502 ”](https://docs.kirimdev.com/api/operations/phone_number_idregister/#502) Upstream WhatsApp error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Upstream WhatsApp API failed; please retry. { "error": { "type": "api_error", "code": "whatsapp_upstream_error", "message": "Upstream WhatsApp API failed; please retry.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List webhook deliveries | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_deliveries/#_top) Webhook Deliveries List webhook deliveries ======================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveries%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveries%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /webhook\_deliveries Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_deliveries?subscription_id=wbs_01HXYZABCDEFGHJKMNPQRSTVWX&status=pending&event_type=message.received&created_after=2026-09-10T00%3A00%3A00.000Z&created_before=2026-09-11T00%3A00%3A00.000Z&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_deliveries?subscription_id=wbs_01HXYZABCDEFGHJKMNPQRSTVWX&status=pending&event_type=message.received&created_after=2026-09-10T00%3A00%3A00.000Z&created_before=2026-09-11T00%3A00%3A00.000Z&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_deliveries"; let querystring = [ ("subscription_id", "wbs_01HXYZABCDEFGHJKMNPQRSTVWX"), ("status", "pending"), ("event_type", "message.received"), ("created_after", "2026-09-10T00:00:00.000Z"), ("created_before", "2026-09-11T00:00:00.000Z"), ("limit", "25"), ("cursor", "eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/webhook_deliveries?subscription_id=wbs_01HXYZABCDEFGHJKMNPQRSTVWX&status=pending&event_type=message.received&created_after=2026-09-10T00%3A00%3A00.000Z&created_before=2026-09-11T00%3A00%3A00.000Z&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ' \ --header 'Authorization: Bearer ' * Production List webhook delivery attempts newest first. Combine subscription, event, status, and timestamp filters to inspect failures, then use the returned opaque cursor for the next page. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#parameters) ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#query-parameters) **subscription\_id** Return deliveries for one webhook subscription. string /^wbs\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbs_01HXYZABCDEFGHJKMNPQRSTVWX Return deliveries for one webhook subscription. **status** Filter by the latest delivery state. string Allowed values: pending succeeded failed dead ##### Example dead Filter by the latest delivery state. **event\_type** Filter by exact webhook event type. string \>= 1 characters <= 64 characters ##### Example message.received Filter by exact webhook event type. **created\_after** Return deliveries created strictly after this ISO 8601 instant. string format: date-time ##### Example 2026-09-10T00:00:00.000Z Return deliveries created strictly after this ISO 8601 instant. **created\_before** Return deliveries created strictly before this ISO 8601 instant. string format: date-time ##### Example 2026-09-11T00:00:00.000Z Return deliveries created strictly before this ISO 8601 instant. **limit** Number of items to return. Defaults to 25; minimum 1 and maximum 100. string default: 25 /^\\d+$/ ##### Example 25 Number of items to return. Defaults to 25; minimum 1 and maximum 100. **cursor** Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. string \>= 1 characters ##### Example eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#200) Delivery list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: webhook\_delivery **subscription\_id** required string **event\_type** required string **event\_id** required string **status** required string Allowed values: pending succeeded failed dead **attempt\_count** required integer **last\_attempt\_at** required string | null format: date-time **next\_attempt\_at** required string | null format: date-time **response\_status** required integer | null **response\_body\_snippet** required Body returned by YOUR endpoint, truncated. Null when the endpoint sent no body or was never reached — check `error_code` in that case. string | null **duration\_ms** required integer | null **error\_code** required Why the last attempt failed. Null on success. `http_error` means your endpoint answered with a non-2xx status. `timeout` and `connection_error` mean it never answered. The remaining values mean we declined to send. string | null Allowed values: timeout connection\_error http\_error subscription\_inactive subscription\_deleted ssrf\_blocked no\_signing\_secret **error\_message** required Human-readable detail for `error_code`, truncated to 200 characters. string | null **replayed\_from** required string | null **payload** **created\_at** required string format: date-time **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "id": "wbd_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_delivery", "status": "pending", "error_code": "timeout" } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_deliveries/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List setup links for a customer | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#_top) Customers List setup links for a customer =============================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidsetup_links%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidsetup_links%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /customers/{id}/setup\_links Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links?status=active" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links?status=active';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links"; let querystring = [ ("status", "active"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links?status=active' \ --header 'Authorization: Bearer ' * Production Returns up to the 50 most-recent setup links — token plaintext is NEVER returned here (only at create time). Optional `status` query filters to `active` / `consumed` / `expired` / `revoked`. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#path-parameters) **id** required Public Kirimdev end-customer ID. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev end-customer ID. ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#query-parameters) **status** Filter setup links by lifecycle state. string Allowed values: active consumed expired revoked ##### Example active Filter setup links by lifecycle state. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#200) Setup link list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: customer\_setup\_link **customer\_id** required string **status** required string Allowed values: active consumed expired revoked **token\_last4** required string **expires\_at** required string format: date-time **consumed\_at** required string | null format: date-time **success\_redirect\_url** required Where the tenant is redirected after successful Embedded Signup. We append `?customer_id=&account_id=&status=success` on the redirect. string | null format: uri **failure\_redirect\_url** required Where the tenant is redirected on failure (link error, Meta signup cancelled, etc.). We append `?customer_id=&status=failed&reason=`. string | null format: uri **created\_at** required string format: date-time **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "id": "csl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "customer_setup_link", "status": "active" } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your current plan does not include this feature. Upgrade to continue. { "error": { "type": "permission_error", "code": "feature_not_entitled", "message": "Your current plan does not include this feature. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customersidsetup_links/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Update a label | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/labelsid/patch/#_top) Labels Update a label ============== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabelsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabelsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) PATCH /labels/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX" payload := strings.NewReader("{ \"name\": \"example\", \"color\": \"gray\" }") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX';const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"name":"example","color":"gray"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX"; let payload = json!({ "name": "example", "color": "gray" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request PATCH \ --url https://api.kirimdev.com/v1/labels/lbl_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "color": "gray" }' * Production Update a label name, color, or both. Send at least one field; omitted fields remain unchanged. Retrying the same body is safe. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#path-parameters) **id** required Public Kirimdev label ID. string /^lbl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example lbl_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev label ID. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#request-body) Media type application/json object **name** string \>= 1 characters <= 50 characters **color** string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#200) Updated label Media type application/json object **data** required object **id** required string **object** required string Allowed values: label **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "label", "color": "gray" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/labelsid/patch/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Replay deliveries in bulk (DLQ) | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#_top) Webhook Deliveries Replay deliveries in bulk (DLQ) =============================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveriesbulk_replay%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveriesbulk_replay%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /webhook\_deliveries/bulk\_replay Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_deliveries/bulk_replay" payload := strings.NewReader("{ \"subscription_id\": \"example\", \"status\": \"failed\", \"event_type\": \"example\", \"created_after\": \"2026-04-15T12:00:00Z\", \"created_before\": \"2026-04-15T12:00:00Z\" }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_deliveries/bulk_replay';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"subscription_id":"example","status":"failed","event_type":"example","created_after":"2026-04-15T12:00:00Z","created_before":"2026-04-15T12:00:00Z"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_deliveries/bulk_replay"; let payload = json!({ "subscription_id": "example", "status": "failed", "event_type": "example", "created_after": "2026-04-15T12:00:00Z", "created_before": "2026-04-15T12:00:00Z" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/webhook_deliveries/bulk_replay \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "subscription_id": "example", "status": "failed", "event_type": "example", "created_after": "2026-04-15T12:00:00Z", "created_before": "2026-04-15T12:00:00Z" }' * Production Replay every delivery for a subscription matching the filter, capped at 1000 per request. Paginate via `created_after` / `created_before` for larger backfills. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#parameters) ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#request-body) Media type application/json object **subscription\_id** required string /^wbs\_\[0-9A-HJKMNP-TV-Z\]{26}$/ **status** string default: dead Allowed values: failed dead **event\_type** string \>= 1 characters <= 64 characters **created\_after** string format: date-time **created\_before** string format: date-time Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#200) Bulk replay enqueued Media type application/json object **data** required The requested resource. object **enqueued** required integer **capped** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Idempotency-Key was reused with a different request body. { "error": { "type": "invalid_request_error", "code": "idempotency_key_reuse", "message": "Idempotency-Key was reused with a different request body.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesbulk_replay/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Fetch a customer by id | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customersid/get/#_top) Customers Fetch a customer by id ====================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /customers/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Fetch one end-customer in platform mode, including lifecycle status, metadata, owning team, and timestamps. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customersid/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customersid/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/customersid/get/#path-parameters) **id** required Public Kirimdev end-customer ID. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev end-customer ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customersid/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customersid/get/#200) Customer resource (includes attached WhatsApp accounts) Media type application/json object **data** required The requested resource. object **id** required string **object** required string Allowed values: customer **name** required string **email** required string | null **status** required string Allowed values: pending active suspended archived **metadata** required object | null **archived\_at** required string | null format: date-time **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **whatsapp\_accounts** required WhatsApp accounts currently assigned to this customer. Array object **phone\_number\_id** required string | null **phone\_number** required string | null **name** required string | null **status** required string **onboarded\_at** required string | null format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "customer", "status": "pending" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customersid/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customersid/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customersid/get/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your current plan does not include this feature. Upgrade to continue. { "error": { "type": "permission_error", "code": "feature_not_entitled", "message": "Your current plan does not include this feature. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/customersid/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customersid/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customersid/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Update a webhook subscription | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#_top) Webhook Subscriptions Update a webhook subscription ============================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) PATCH /webhook\_subscriptions/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX" payload := strings.NewReader("{ \"url\": \"https://example.com\", \"description\": \"example\", \"events\": [ \"message.received\" ], \"status\": \"active\", \"phone_number_ids\": [ \"example\" ] }") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX';const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com","description":"example","events":["message.received"],"status":"active","phone_number_ids":["example"]}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX"; let payload = json!({ "url": "https://example.com", "description": "example", "events": ("message.received"), "status": "active", "phone_number_ids": ("example") }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request PATCH \ --url https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com", "description": "example", "events": [ "message.received" ], "status": "active", "phone_number_ids": [ "example" ] }' * Production Toggle status (active/paused), update URL/events/description. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#path-parameters) **id** required Public Kirimdev webhook-subscription ID. string /^wbs\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbs_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev webhook-subscription ID. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#request-body) Media type application/json object **url** string format: uri **description** string | null <= 200 characters **events** Array \>= 1 items Allowed values: message.received message.status message.sent message.revoked message.edited conversation.assigned conversation.closed contact.created contact.updated contact.identity\_updated customer.created customer.updated customer.archived customer.onboarded customer.setup\_link.created customer.setup\_link.consumed **status** string Allowed values: active paused **phone\_number\_ids** Array | null <= 50 items Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#200) Updated subscription Media type application/json object **data** required object **id** required string **object** required string Allowed values: webhook\_subscription **url** required string format: uri **description** required string | null **events** required Array **phone\_number\_ids** required Optional whitelist of Meta `business_phone_number_id` values. When `null` (default), the subscription fires for events from every WhatsApp account in the organization. When an array, only for events originating from these accounts. Org-level events (e.g. `customer.*`) IGNORE this filter and always fire. Array | null **status** required string Allowed values: active paused disabled **disabled\_reason** required Why the subscription is CURRENTLY disabled. Cleared when you re-enable it. string | null **last\_disabled\_at** required When the subscription last entered the disabled state. Never cleared, so it still reports a past auto-disable after you have re-enabled. string | null format: date-time **last\_disabled\_reason** required string | null **consecutive\_failures** required integer **secrets** required Array object **id** required string **created\_at** required string format: date-time **expires\_at** required string | null format: date-time **created\_at** required string format: date-time **updated\_at** required string format: date-time **initial\_secret** string **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "wbs_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_subscription", "phone_number_ids": [ "1234567890" ], "status": "active", "secrets": [ { "id": "sec_01HXYZABCDEFGHJKMNPQRSTVWX" } ] }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/patch/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List templates | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#_top) Templates List templates ============== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idtemplates%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idtemplates%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/templates Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/templates?status=approved&language=id&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/templates?status=approved&language=id&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/templates"; let querystring = [ ("status", "approved"), ("language", "id"), ("limit", "25"), ("cursor", "eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/106540352242922/templates?status=approved&language=id&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ' \ --header 'Authorization: Bearer ' * Production List templates synced from Meta for the WhatsApp account identified by `phone_number_id`. Default filter is `status=approved`. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#query-parameters) **status** Template review-state filter. Defaults to approved templates; use `all` to include every state. string default: approved Allowed values: approved pending rejected all ##### Example approved Template review-state filter. Defaults to approved templates; use `all` to include every state. **language** Filter by Meta template language code. string \>= 2 characters <= 15 characters ##### Example id Filter by Meta template language code. **limit** Number of items to return. Defaults to 25; minimum 1 and maximum 100. string default: 25 /^\\d+$/ ##### Example 25 Number of items to return. Defaults to 25; minimum 1 and maximum 100. **cursor** Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. string \>= 1 characters ##### Example eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#200) Template list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: template **name** required string **language** required string **status** required string Allowed values: pending approved rejected **category** required Meta template category. `null` for templates synced before this field was recorded — a subsequent sync backfills it from Meta. string | null Allowed values: MARKETING UTILITY AUTHENTICATION **content** required string **variables** required Array **components** **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **provider\_template\_id** required string | null **created\_at** required string format: date-time **updated\_at** required string format: date-time **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "id": "tmpl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "template", "status": "pending", "category": "MARKETING", "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } } } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplates/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Update a contact | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#_top) Contacts Update a contact ================ Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontactsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) PATCH /{phone\_number\_id}/contacts/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX" payload := strings.NewReader("{ \"name\": \"example\", \"username\": \"example\", \"email\": \"\", \"metadata\": \"example\" }") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX';const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"name":"example","username":"example","email":"","metadata":"example"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX"; let payload = json!({ "name": "example", "username": "example", "email": "", "metadata": "example" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request PATCH \ --url https://api.kirimdev.com/v1/106540352242922/contacts/ctc_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "username": "example", "email": "", "metadata": "example" }' * Production Patch name, email, or metadata. Phone number is the identity column and cannot be changed via the API. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev contact ID. string /^ctc\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example ctc_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev contact ID. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#request-body) Media type application/json object **name** string | null \>= 1 characters <= 200 characters **username** string | null \>= 1 characters <= 100 characters **email** Any of: * [string](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#tab-panel-27) * [string](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#tab-panel-28) * [null](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#tab-panel-29) string format: email <= 255 characters string Allowed values: "" null **metadata** object | null Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#200) Updated contact Media type application/json object **data** required object **id** required string **object** required string Allowed values: contact **phone\_number** required Phone number in E.164. NULL when the contact was created via BSUID (username-adopted user with no shared phone number). See docs/meta-docs/bsuid.md. string | null **bsuid** required Business-Scoped User ID. Populated by inbound webhooks or when the contact was created via BSUID. Format: `{ISO alpha-2 country}.{alphanumeric ≤128}`. string | null **parent\_bsuid** required Parent BSUID (managed businesses only). Format: `{ISO alpha-2 country}.ENT.{alphanumeric ≤128}`. string | null **username** required WhatsApp username of the contact, if the user has adopted the username feature. Case-insensitive when comparing per Meta rules; `.` and `_` are significant. string | null **name** required string | null **email** required string | null **metadata** required object | null **labels** required Labels currently attached to this contact. Array object **id** required string **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "contact", "phone_number": "+628123456789", "bsuid": "US.13491208655302741918", "parent_bsuid": "US.ENT.11815799212886844830", "username": "pablomorales", "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "gray" } ], "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } } }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontactsid/patch/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Create a webhook subscription | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#_top) Webhook Subscriptions Create a webhook subscription ============================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptions%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptions%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /webhook\_subscriptions Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_subscriptions" payload := strings.NewReader("{ \"url\": \"https://example.com\", \"description\": \"example\", \"events\": [ \"message.received\" ], \"phone_number_ids\": [ \"example\" ] }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_subscriptions';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"url":"https://example.com","description":"example","events":["message.received"],"phone_number_ids":["example"]}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions"; let payload = json!({ "url": "https://example.com", "description": "example", "events": ("message.received"), "phone_number_ids": ("example") }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/webhook_subscriptions \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "url": "https://example.com", "description": "example", "events": [ "message.received" ], "phone_number_ids": [ "example" ] }' * Production Create a webhook subscription. Store `initial_secret` server-side immediately. It is returned in the initial response and replayed for 24 hours when the same POST is retried with the same Idempotency-Key; outside that replay, Kirimdev cannot show it again. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#parameters) ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#request-body) Media type application/json object **url** required string format: uri **description** string <= 200 characters **events** required Array \>= 1 items Allowed values: message.received message.status message.sent message.revoked message.edited conversation.assigned conversation.closed contact.created contact.updated contact.identity\_updated customer.created customer.updated customer.archived customer.onboarded customer.setup\_link.created customer.setup\_link.consumed **phone\_number\_ids** Array <= 50 items Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#200) Created Media type application/json object **data** required object **id** required string **object** required string Allowed values: webhook\_subscription **url** required string format: uri **description** required string | null **events** required Array **phone\_number\_ids** required Optional whitelist of Meta `business_phone_number_id` values. When `null` (default), the subscription fires for events from every WhatsApp account in the organization. When an array, only for events originating from these accounts. Org-level events (e.g. `customer.*`) IGNORE this filter and always fire. Array | null **status** required string Allowed values: active paused disabled **disabled\_reason** required Why the subscription is CURRENTLY disabled. Cleared when you re-enable it. string | null **last\_disabled\_at** required When the subscription last entered the disabled state. Never cleared, so it still reports a past auto-disable after you have re-enabled. string | null format: date-time **last\_disabled\_reason** required string | null **consecutive\_failures** required integer **secrets** required Array object **id** required string **created\_at** required string format: date-time **expires\_at** required string | null format: date-time **created\_at** required string format: date-time **updated\_at** required string format: date-time **initial\_secret** string **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "wbs_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_subscription", "phone_number_ids": [ "1234567890" ], "status": "active", "secrets": [ { "id": "sec_01HXYZABCDEFGHJKMNPQRSTVWX" } ] }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Idempotency-Key was reused with a different request body. { "error": { "type": "invalid_request_error", "code": "idempotency_key_reuse", "message": "Idempotency-Key was reused with a different request body.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 503 [Section titled “503 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/post/#503) Service unavailable Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Service temporarily unavailable. { "error": { "type": "api_error", "code": "service_unavailable", "message": "Service temporarily unavailable.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Attach a label to a conversation | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#_top) Conversations Attach a label to a conversation ================================ Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsidlabels%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsidlabels%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /{phone\_number\_id}/conversations/{id}/labels Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels" payload := strings.NewReader("{ \"label_id\": \"example\" }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"label_id":"example"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels"; let payload = json!({"label_id": "example"}); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX/labels \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "label_id": "example" }' * Production Attach an organization label to an inbox conversation. The label and conversation must belong to compatible team scope; duplicate attachment is idempotent. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev conversation ID. string /^cnv\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cnv_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev conversation ID. ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#request-body) Media type application/json object **label\_id** required string /^lbl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example generated { "label_id": "example"} Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#200) Attached Media type application/json object **data** required The requested resource. object **conversation\_id** required string **label\_id** required string **attached** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "attached": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsidlabels/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Disconnect a WhatsApp account from a customer | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#_top) Customers Disconnect a WhatsApp account from a customer ============================================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidwhatsapp_accountsphone_number_id%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidwhatsapp_accountsphone_number_id%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /customers/{id}/whatsapp\_accounts/{phone\_number\_id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/whatsapp_accounts/106540352242922" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/whatsapp_accounts/106540352242922';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/whatsapp_accounts/106540352242922"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/whatsapp_accounts/106540352242922 \ --header 'Authorization: Bearer ' * Production Disconnects a customer’s WhatsApp account by its Meta business phone-number id (the `phone_number_id` returned in `GET /customers/{id}`). Best-effort unsubscribes the number from Meta webhooks, then soft-deletes and schedules a full purge of the account’s data. Idempotent — repeating the call after the account is gone returns `404`. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#path-parameters) **id** required Public Kirimdev end-customer ID. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev end-customer ID. **phone\_number\_id** required Meta WhatsApp Business phone-number ID connected to this customer. string /^\\d{1,32}$/ ##### Example 106540352242922 Meta WhatsApp Business phone-number ID connected to this customer. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#200) Disconnected Media type application/json object **data** required The requested resource. object **phone\_number\_id** required string **object** required string Allowed values: whatsapp\_account **disconnected** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "whatsapp_account", "disconnected": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your trial has ended or subscription is inactive. Upgrade to continue. { "error": { "type": "permission_error", "code": "subscription_inactive", "message": "Your trial has ended or subscription is inactive. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customersidwhatsapp_accountsphone_number_id/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Create a customer | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customers/post/#_top) Customers Create a customer ================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomers%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomers%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /customers Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers" payload := strings.NewReader("{ \"team_id\": \"example\", \"name\": \"example\", \"email\": \"hello@example.com\", \"metadata\": { \"additionalProperty\": \"example\" } }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"team_id":"example","name":"example","email":"hello@example.com","metadata":{"additionalProperty":"example"}}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers"; let payload = json!({ "team_id": "example", "name": "example", "email": "hello@example.com", "metadata": json!({"additionalProperty": "example"}) }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/customers \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "team_id": "example", "name": "example", "email": "hello@example.com", "metadata": { "additionalProperty": "example" } }' * Production Create a new end-customer. Starts in `pending` status; transitions to `active` when the first WhatsApp account is connected via a setup link. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customers/post/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customers/post/#parameters) ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/customers/post/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/customers/post/#request-body) Media type application/json object **team\_id** string \>= 1 characters <= 64 characters **name** required string \>= 1 characters <= 200 characters **email** string format: email <= 255 characters **metadata** object **_key_** additional properties ##### Example generated { "team_id": "example", "name": "example", "email": "hello@example.com", "metadata": { "additionalProperty": "example" }} Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customers/post/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customers/post/#200) Customer created Media type application/json object **data** required object **id** required string **object** required string Allowed values: customer **name** required string **email** required string | null **status** required string Allowed values: pending active suspended archived **metadata** required object | null **archived\_at** required string | null format: date-time **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "customer", "status": "pending" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customers/post/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customers/post/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customers/post/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your trial has ended or subscription is inactive. Upgrade to continue. { "error": { "type": "permission_error", "code": "subscription_inactive", "message": "Your trial has ended or subscription is inactive. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/customers/post/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/customers/post/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Idempotency-Key was reused with a different request body. { "error": { "type": "invalid_request_error", "code": "idempotency_key_reuse", "message": "Idempotency-Key was reused with a different request body.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customers/post/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customers/post/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Add a new signing secret (rotation) | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#_top) Webhook Subscriptions Add a new signing secret (rotation) =================================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsidsecrets%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsidsecrets%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /webhook\_subscriptions/{id}/secrets Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets" payload := strings.NewReader("{ \"expires_in_hours\": 1 }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"expires_in_hours":1}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets"; let payload = json!({"expires_in_hours": 1}); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "expires_in_hours": 1 }' * Production Issue a new signing secret with the given expiry. The plaintext secret is returned in the initial response and replayed for 24 hours when the same POST is retried with the same Idempotency-Key. During the overlap window every active secret is used to sign outbound deliveries; subscribers verify against any of them. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#path-parameters) **id** required Public Kirimdev webhook-subscription ID. string /^wbs\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbs_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev webhook-subscription ID. ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#request-body) Media type application/json object **expires\_in\_hours** integer \>= 1 <= 336 ##### Example generated { "expires_in_hours": 1} Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#200) New secret created Media type application/json object **data** required The requested resource. object **id** required string **object** required string Allowed values: webhook\_secret **secret** required string **created\_at** required string format: date-time **expires\_at** required string | null format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "webhook_secret" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Idempotency-Key was reused with a different request body. { "error": { "type": "invalid_request_error", "code": "idempotency_key_reuse", "message": "Idempotency-Key was reused with a different request body.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 503 [Section titled “503 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecrets/#503) Service unavailable Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Service temporarily unavailable. { "error": { "type": "api_error", "code": "service_unavailable", "message": "Service temporarily unavailable.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Fetch one webhook subscription | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#_top) Webhook Subscriptions Fetch one webhook subscription ============================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsid%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /webhook\_subscriptions/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Fetch a webhook subscription and its signing-secret metadata. Plaintext signing secrets are never returned after creation or rotation. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#path-parameters) **id** required Public Kirimdev webhook-subscription ID. string /^wbs\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbs_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev webhook-subscription ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#200) Subscription resource Media type application/json object **data** required object **id** required string **object** required string Allowed values: webhook\_subscription **url** required string format: uri **description** required string | null **events** required Array **phone\_number\_ids** required Optional whitelist of Meta `business_phone_number_id` values. When `null` (default), the subscription fires for events from every WhatsApp account in the organization. When an array, only for events originating from these accounts. Org-level events (e.g. `customer.*`) IGNORE this filter and always fire. Array | null **status** required string Allowed values: active paused disabled **disabled\_reason** required Why the subscription is CURRENTLY disabled. Cleared when you re-enable it. string | null **last\_disabled\_at** required When the subscription last entered the disabled state. Never cleared, so it still reports a past auto-disable after you have re-enabled. string | null format: date-time **last\_disabled\_reason** required string | null **consecutive\_failures** required integer **secrets** required Array object **id** required string **created\_at** required string format: date-time **expires\_at** required string | null format: date-time **created\_at** required string format: date-time **updated\_at** required string format: date-time **initial\_secret** string **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "wbs_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_subscription", "phone_number_ids": [ "1234567890" ], "status": "active", "secrets": [ { "id": "sec_01HXYZABCDEFGHJKMNPQRSTVWX" } ] }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsid/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Fetch a single template by name | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#_top) Templates Fetch a single template by name =============================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idtemplatesname%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idtemplatesname%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/templates/{name} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/templates/order_confirmation?language=id" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/templates/order_confirmation?language=id';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/templates/order_confirmation"; let querystring = [ ("language", "id"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/106540352242922/templates/order_confirmation?language=id' \ --header 'Authorization: Bearer ' * Production Fetch one message template owned by this WhatsApp account. Template names are not globally unique, so pass `language` when the account has multiple language variants with the same name. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **name** required Meta template name, unique within an account and language variant. string \>= 1 characters <= 512 characters ##### Example order_confirmation Meta template name, unique within an account and language variant. ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#query-parameters) **language** Select a specific language variant when several templates share the same name. string \>= 2 characters <= 15 characters ##### Example id Select a specific language variant when several templates share the same name. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#200) Template resource Media type application/json object **data** required object **id** required string **object** required string Allowed values: template **name** required string **language** required string **status** required string Allowed values: pending approved rejected **category** required Meta template category. `null` for templates synced before this field was recorded — a subsequent sync backfills it from Meta. string | null Allowed values: MARKETING UTILITY AUTHENTICATION **content** required string **variables** required Array **components** **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **provider\_template\_id** required string | null **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "tmpl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "template", "status": "pending", "category": "MARKETING", "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } } }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idtemplatesname/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Revoke a signing secret | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#_top) Webhook Subscriptions Revoke a signing secret ======================= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsidsecretssecret_id%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptionsidsecretssecret_id%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /webhook\_subscriptions/{id}/secrets/{secret\_id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Immediately revoke one signing secret on the subscription. Deliveries stop using it at once; keep at least one active secret to avoid delivery failures. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#path-parameters) **id** required Public Kirimdev webhook-subscription ID. string /^wbs\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbs_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev webhook-subscription ID. **secret\_id** required Signing-secret metadata ID returned by the subscription resource. string /^sec\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example sec_01HXYZABCDEFGHJKMNPQRSTVWX Signing-secret metadata ID returned by the subscription resource. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#200) Secret revoked Media type application/json object **data** required The requested resource. object **id** required string **deleted** required boolean **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "deleted": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Cannot revoke the only signing secret on this subscription. Add a new secret first, then revoke the old one. { "error": { "type": "invalid_request_error", "code": "cannot_revoke_last_secret", "message": "Cannot revoke the only signing secret on this subscription. Add a new secret first, then revoke the old one.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptionsidsecretssecret_id/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Create a contact | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#_top) Contacts Create a contact ================ Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontacts%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontacts%2Fpost%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /{phone\_number\_id}/contacts Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/contacts" payload := strings.NewReader("{ \"phone_number\": \"example\", \"bsuid\": \"example\", \"username\": \"example\", \"name\": \"example\", \"email\": \"hello@example.com\", \"metadata\": { \"additionalProperty\": \"example\" } }") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/contacts';const options = { method: 'POST', headers: { 'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer ', 'Content-Type': 'application/json' }, body: '{"phone_number":"example","bsuid":"example","username":"example","name":"example","email":"hello@example.com","metadata":{"additionalProperty":"example"}}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/contacts"; let payload = json!({ "phone_number": "example", "bsuid": "example", "username": "example", "name": "example", "email": "hello@example.com", "metadata": json!({"additionalProperty": "example"}) }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/106540352242922/contacts \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: order-20260910-0001' \ --data '{ "phone_number": "example", "bsuid": "example", "username": "example", "name": "example", "email": "hello@example.com", "metadata": { "additionalProperty": "example" } }' * Production Create a contact attached to the WhatsApp account identified by `phone_number_id` in the URL path. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#request-body) Media type application/json object **phone\_number** string **bsuid** string /^\[A-Z\]{2}\\.(ENT\\.)?\[A-Za-z0-9\]{1,128}$/ **username** string \>= 1 characters <= 100 characters **name** string \>= 1 characters <= 200 characters **email** string | null format: email <= 255 characters **metadata** object **_key_** additional properties ##### Example generated { "phone_number": "example", "bsuid": "example", "username": "example", "name": "example", "email": "hello@example.com", "metadata": { "additionalProperty": "example" }} Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#200) Contact created Media type application/json object **data** required object **id** required string **object** required string Allowed values: contact **phone\_number** required Phone number in E.164. NULL when the contact was created via BSUID (username-adopted user with no shared phone number). See docs/meta-docs/bsuid.md. string | null **bsuid** required Business-Scoped User ID. Populated by inbound webhooks or when the contact was created via BSUID. Format: `{ISO alpha-2 country}.{alphanumeric ≤128}`. string | null **parent\_bsuid** required Parent BSUID (managed businesses only). Format: `{ISO alpha-2 country}.ENT.{alphanumeric ≤128}`. string | null **username** required WhatsApp username of the contact, if the user has adopted the username feature. Case-insensitive when comparing per Meta rules; `.` and `_` are significant. string | null **name** required string | null **email** required string | null **metadata** required object | null **labels** required Labels currently attached to this contact. Array object **id** required string **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "contact", "phone_number": "+628123456789", "bsuid": "US.13491208655302741918", "parent_bsuid": "US.ENT.11815799212886844830", "username": "pablomorales", "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "gray" } ], "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } } }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/post/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Update a conversation | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#_top) Conversations Update a conversation ===================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idconversationsid%2Fpatch%2F%20and%20help%20me%20with%20the%20following%3A%20) PATCH /{phone\_number\_id}/conversations/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "strings" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX" payload := strings.NewReader("{ \"status\": \"open\", \"assigned_to\": \"example\" }") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX';const options = { method: 'PATCH', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"status":"open","assigned_to":"example"}'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use serde_json::json;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX"; let payload = json!({ "status": "open", "assigned_to": "example" }); let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url) .headers(headers) .json(&payload) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request PATCH \ --url https://api.kirimdev.com/v1/106540352242922/conversations/cnv_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data '{ "status": "open", "assigned_to": "example" }' * Production Update status (`open` / `resolved` / `pending`) and/or `assigned_to` (user id, or `null` to clear). At least one field must be present. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). **id** required Public Kirimdev conversation ID. string /^cnv\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cnv_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev conversation ID. Request Body ------------ [Section titled “Request Body ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#request-body) Media type application/json object **status** string Allowed values: open resolved pending **assigned\_to** string | null \>= 1 characters <= 64 characters Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#200) Updated conversation Media type application/json object **data** required object **id** required string **object** required string Allowed values: conversation **status** required string Allowed values: open resolved pending **contact** required object **id** required string **phone\_number** required string | null **name** required string | null **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **assignee** required object **id** required string **name** required string | null **email** required string | null **labels** required Labels currently attached to this conversation. Array object **id** required string **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **unread\_count** required integer **last\_message\_at** required string | null format: date-time **last\_inbound\_at** required string | null format: date-time **created\_at** required string format: date-time **updated\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "cnv_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "conversation", "status": "open", "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } }, "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "gray" } ] }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idconversationsid/patch/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Revoke a setup link | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#_top) Customers Revoke a setup link =================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidsetup_linkslink_id%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fcustomersidsetup_linkslink_id%2Fdelete%2F%20and%20help%20me%20with%20the%20following%3A%20) DELETE /customers/{id}/setup\_links/{link\_id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use std::str::FromStr;use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request DELETE \ --url https://api.kirimdev.com/v1/customers/cus_01HXYZABCDEFGHJKMNPQRSTVWX/setup_links/csl_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Revoke a still-active link. Already-consumed or already-revoked links return `409`. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#path-parameters) **id** required Public Kirimdev end-customer ID. string /^cus\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example cus_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev end-customer ID. **link\_id** required Public setup-link ID belonging to this customer. string /^csl\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example csl_01HXYZABCDEFGHJKMNPQRSTVWX Public setup-link ID belonging to this customer. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#200) Revoked Media type application/json object **data** required The requested resource. object **id** required string **object** required string Allowed values: customer\_setup\_link **revoked** required boolean **status** required string Allowed values: active consumed expired revoked **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "customer_setup_link", "revoked": true, "status": "active" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 402 [Section titled “402 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#402) Billing / entitlement gate — subscription inactive, quota exceeded, or plan tier missing a feature (feature\_not\_entitled). Upgrade to continue. Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Your trial has ended or subscription is inactive. Upgrade to continue. { "error": { "type": "permission_error", "code": "subscription_inactive", "message": "Your trial has ended or subscription is inactive. Upgrade to continue.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Setup link is no longer active and cannot be modified. { "error": { "type": "conflict", "code": "setup_link_inactive", "message": "Setup link is no longer active and cannot be modified.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/customersidsetup_linkslink_id/delete/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Replay a single delivery | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#_top) Webhook Deliveries Replay a single delivery ======================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveriesidreplay%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveriesidreplay%2F%20and%20help%20me%20with%20the%20following%3A%20) POST /webhook\_deliveries/{id}/replay Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX/replay" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("Idempotency-Key", "order-20260910-0001") req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX/replay';const options = { method: 'POST', headers: {'Idempotency-Key': 'order-20260910-0001', Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX/replay"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Idempotency-Key", "order-20260910-0001".parse().unwrap()); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request POST \ --url https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX/replay \ --header 'Authorization: Bearer ' \ --header 'Idempotency-Key: order-20260910-0001' * Production Re-fire a single delivery against the original subscription URL. Creates a fresh delivery row; the original stays for audit. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#path-parameters) **id** required Public Kirimdev webhook-delivery ID. string /^wbd\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbd_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev webhook-delivery ID. ### Header Parameters [Section titled “Header Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#header-parameters) **Idempotency-Key** Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. string ##### Example order-20260910-0001 Optional retry key. Reusing the same key with the same method, path, and body within 24 hours returns the original response; reusing it for a different request returns 422. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#200) Replay enqueued Media type application/json object **data** required The requested resource. object **id** required string **object** required string Allowed values: webhook\_delivery **replayed\_from** required string **status** required string Allowed values: pending **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "object": "webhook_delivery", "status": "pending" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 409 [Section titled “409 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#409) Conflict (e.g. template already exists, webhook subscription disabled, setup link inactive) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An identical request is still being processed. Retry later. { "error": { "type": "conflict", "code": "idempotency_in_progress", "message": "An identical request is still being processed. Retry later.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Idempotency-Key was reused with a different request body. { "error": { "type": "invalid_request_error", "code": "idempotency_key_reuse", "message": "Idempotency-Key was reused with a different request body.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesidreplay/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List contacts | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#_top) Contacts List contacts ============= Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontacts%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fphone_number_idcontacts%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /{phone\_number\_id}/contacts Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/106540352242922/contacts?phone=%2B628123456789&bsuid=US.13491208655302741918&username=pablomorales&search=Budi&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/106540352242922/contacts?phone=%2B628123456789&bsuid=US.13491208655302741918&username=pablomorales&search=Budi&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/106540352242922/contacts"; let querystring = [ ("phone", "+628123456789"), ("bsuid", "US.13491208655302741918"), ("username", "pablomorales"), ("search", "Budi"), ("limit", "25"), ("cursor", "eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/106540352242922/contacts?phone=%2B628123456789&bsuid=US.13491208655302741918&username=pablomorales&search=Budi&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ' \ --header 'Authorization: Bearer ' * Production List contacts attached to the WhatsApp account identified by `phone_number_id`. Filter by exact `phone` (E.164) or partial `search` (matches name and email). Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#path-parameters) **phone\_number\_id** required Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). string /^\\d{6,20}$/ ##### Example 106540352242922 Meta WhatsApp Business `phone_number_id` of the connected account that should send / own this resource. Discoverable via `GET /v1/accounts` (returned as `phone_number_id` on each row). ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#query-parameters) **phone** Exact phone-number match. Common E.164 formatting is accepted and normalized. string ##### Example +628123456789 Exact phone-number match. Common E.164 formatting is accepted and normalized. **bsuid** Exact Meta Business-Scoped User ID match. string /^\[A-Z\]{2}\\.(ENT\\.)?\[A-Za-z0-9\]{1,128}$/ ##### Example US.13491208655302741918 Exact Meta Business-Scoped User ID match. **username** Exact WhatsApp username match, compared case-insensitively. string \>= 1 characters <= 100 characters ##### Example pablomorales Exact WhatsApp username match, compared case-insensitively. **search** Case-insensitive substring search across contact name and email. string \>= 1 characters <= 200 characters ##### Example Budi Case-insensitive substring search across contact name and email. **limit** Number of items to return. Defaults to 25; minimum 1 and maximum 100. string default: 25 /^\\d+$/ ##### Example 25 Number of items to return. Defaults to 25; minimum 1 and maximum 100. **cursor** Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. string \>= 1 characters ##### Example eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#200) Contact list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: contact **phone\_number** required Phone number in E.164. NULL when the contact was created via BSUID (username-adopted user with no shared phone number). See docs/meta-docs/bsuid.md. string | null **bsuid** required Business-Scoped User ID. Populated by inbound webhooks or when the contact was created via BSUID. Format: `{ISO alpha-2 country}.{alphanumeric ≤128}`. string | null **parent\_bsuid** required Parent BSUID (managed businesses only). Format: `{ISO alpha-2 country}.ENT.{alphanumeric ≤128}`. string | null **username** required WhatsApp username of the contact, if the user has adopted the username feature. Case-insensitive when comparing per Meta rules; `.` and `_` are significant. string | null **name** required string | null **email** required string | null **metadata** required object | null **labels** required Labels currently attached to this contact. Array object **id** required string **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **whatsapp\_account** required object **phone\_number** required string | null **phone\_number\_id** required Meta `business_phone_number_id` — use as the `{phone_number_id}` path segment in `/v1/{phone_number_id}/...` endpoints. string | null **customer** required End-customer (multi-tenant platform mode) that owns this account. NULL for direct-org accounts. object **id** required string **name** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "id": "ctc_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "contact", "phone_number": "+628123456789", "bsuid": "US.13491208655302741918", "parent_bsuid": "US.ENT.11815799212886844830", "username": "pablomorales", "labels": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "name": "VIP", "color": "gray" } ], "whatsapp_account": { "phone_number_id": "106540352242922", "customer": { "id": "cus_01HXYZABCDEFGHJKMNPQRSTVWX" } } } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 422 [Section titled “422 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#422) Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found) Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The WhatsApp number is not verified for this organization. { "error": { "type": "invalid_request_error", "code": "whatsapp_number_not_verified", "message": "The WhatsApp number is not verified for this organization.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/phone_number_idcontacts/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List webhook subscriptions | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#_top) Webhook Subscriptions List webhook subscriptions ========================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptions%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_subscriptions%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /webhook\_subscriptions Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_subscriptions?status=active&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_subscriptions?status=active&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions"; let querystring = [ ("status", "active"), ("limit", "25"), ("cursor", "eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/webhook_subscriptions?status=active&limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ' \ --header 'Authorization: Bearer ' * Production List webhook subscriptions in this organization, newest first. Omit `status` to return all states, or filter to one lifecycle state; paginate with the opaque cursor returned by the previous page. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#parameters) ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#query-parameters) **status** Filter by subscription lifecycle state. Omit to return all states. string Allowed values: active paused disabled all ##### Example active Filter by subscription lifecycle state. Omit to return all states. **limit** Number of items to return. Defaults to 25; minimum 1 and maximum 100. string default: 25 /^\\d+$/ ##### Example 25 Number of items to return. Defaults to 25; minimum 1 and maximum 100. **cursor** Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. string \>= 1 characters ##### Example eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#200) Subscription list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: webhook\_subscription **url** required string format: uri **description** required string | null **events** required Array **phone\_number\_ids** required Optional whitelist of Meta `business_phone_number_id` values. When `null` (default), the subscription fires for events from every WhatsApp account in the organization. When an array, only for events originating from these accounts. Org-level events (e.g. `customer.*`) IGNORE this filter and always fire. Array | null **status** required string Allowed values: active paused disabled **disabled\_reason** required Why the subscription is CURRENTLY disabled. Cleared when you re-enable it. string | null **last\_disabled\_at** required When the subscription last entered the disabled state. Never cleared, so it still reports a past auto-disable after you have re-enabled. string | null format: date-time **last\_disabled\_reason** required string | null **consecutive\_failures** required integer **secrets** required Array object **id** required string **created\_at** required string format: date-time **expires\_at** required string | null format: date-time **created\_at** required string format: date-time **updated\_at** required string format: date-time **initial\_secret** string **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "id": "wbs_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_subscription", "phone_number_ids": [ "1234567890" ], "status": "active", "secrets": [ { "id": "sec_01HXYZABCDEFGHJKMNPQRSTVWX" } ] } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_subscriptions/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # Fetch one delivery (with full payload) | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#_top) Webhook Deliveries Fetch one delivery (with full payload) ====================================== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveriesid%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Fwebhook_deliveriesid%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /webhook\_deliveries/{id} Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX"; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url https://api.kirimdev.com/v1/webhook_deliveries/wbd_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer ' * Production Fetch one webhook delivery, including the event payload, attempt state, endpoint response snippet, and failure details used for troubleshooting. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#parameters) ### Path Parameters [Section titled “Path Parameters ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#path-parameters) **id** required Public Kirimdev webhook-delivery ID. string /^wbd\_\[0-9A-HJKMNP-TV-Z\]{26}$/ ##### Example wbd_01HXYZABCDEFGHJKMNPQRSTVWX Public Kirimdev webhook-delivery ID. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#200) Delivery resource Media type application/json object **data** required object **id** required string **object** required string Allowed values: webhook\_delivery **subscription\_id** required string **event\_type** required string **event\_id** required string **status** required string Allowed values: pending succeeded failed dead **attempt\_count** required integer **last\_attempt\_at** required string | null format: date-time **next\_attempt\_at** required string | null format: date-time **response\_status** required integer | null **response\_body\_snippet** required Body returned by YOUR endpoint, truncated. Null when the endpoint sent no body or was never reached — check `error_code` in that case. string | null **duration\_ms** required integer | null **error\_code** required Why the last attempt failed. Null on success. `http_error` means your endpoint answered with a non-2xx status. `timeout` and `connection_error` mean it never answered. The remaining values mean we declined to send. string | null Allowed values: timeout connection\_error http\_error subscription\_inactive subscription\_deleted ssrf\_blocked no\_signing\_secret **error\_message** required Human-readable detail for `error_code`, truncated to 200 characters. string | null **replayed\_from** required string | null **payload** **created\_at** required string format: date-time **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": { "id": "wbd_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "webhook_delivery", "status": "pending", "error_code": "timeout" }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 404 [Section titled “404 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#404) Resource not found Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Resource not found. { "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/webhook_deliveriesid/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} --- # List labels | Kirimdev [Skip to content](https://docs.kirimdev.com/api/operations/labels/get/#_top) Labels List labels =========== Open with AI [Open in ChatGPT](https://chatgpt.com/?hints=search&q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabels%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) [Open in Claude](https://claude.ai/new?q=Read%20the%20Kirimdev%20API%20docs%20at%20https%3A%2F%2Fdocs.kirimdev.com%2Fapi%2Foperations%2Flabels%2Fget%2F%20and%20help%20me%20with%20the%20following%3A%20) GET /labels Select code sample net/http Fetch Reqwest cURL package main import ( "fmt" "net/http" "io") func main() { url := "https://api.kirimdev.com/v1/labels?limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } const url = 'https://api.kirimdev.com/v1/labels?limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ';const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);} use reqwest; #[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/labels"; let querystring = [ ("limit", "25"), ("cursor", "eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ"), ]; let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer ".parse().unwrap()); let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await; let results = response.unwrap() .json::() .await .unwrap(); dbg!(results);} curl --request GET \ --url 'https://api.kirimdev.com/v1/labels?limit=25&cursor=eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ' \ --header 'Authorization: Bearer ' * Production List labels across every team in the organization. Authorizations -------------- [Section titled “Authorizations ”](https://docs.kirimdev.com/api/operations/labels/get/#authorizations) * **[bearerAuth](https://docs.kirimdev.com/api/#bearerauth) ** Parameters ---------- [Section titled “ Parameters ”](https://docs.kirimdev.com/api/operations/labels/get/#parameters) ### Query Parameters [Section titled “Query Parameters ”](https://docs.kirimdev.com/api/operations/labels/get/#query-parameters) **limit** Number of items to return. Defaults to 25; minimum 1 and maximum 100. string default: 25 /^\\d+$/ ##### Example 25 Number of items to return. Defaults to 25; minimum 1 and maximum 100. **cursor** Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. string \>= 1 characters ##### Example eyJpZCI6IjAxSFhZWkFCQ0RFRkdISktNTlBRUlNUVldYIiwidHMiOiIyMDI2LTA5LTEwVDA5OjAwOjAwLjAwMFoifQ Opaque continuation token from the previous response’s `next_cursor`. Pass it unchanged and keep all other filters the same. Responses --------- [Section titled “ Responses ”](https://docs.kirimdev.com/api/operations/labels/get/#responses) ### 200 [Section titled “200 ”](https://docs.kirimdev.com/api/operations/labels/get/#200) Label list Media type application/json object **data** required Items in this page, ordered as documented by the operation. Array object **id** required string **object** required string Allowed values: label **name** required string **color** required string Allowed values: gray red orange amber yellow lime green emerald teal sky blue violet pink **team\_id** required string **created\_at** required string format: date-time **updated\_at** required string format: date-time **has\_more** required Whether another page is available. boolean **next\_cursor** required Pass this value unchanged as `cursor` to fetch the next page. `null` marks the final page. string | null **request\_id** required Unique request identifier to include when contacting support. string ##### Example { "data": [ { "id": "lbl_01HXYZABCDEFGHJKMNPQRSTVWX", "object": "label", "color": "gray" } ], "has_more": false, "next_cursor": null, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"} ### 400 [Section titled “400 ”](https://docs.kirimdev.com/api/operations/labels/get/#400) Validation failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default A field value is invalid. { "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 401 [Section titled “401 ”](https://docs.kirimdev.com/api/operations/labels/get/#401) Authentication failure Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default The provided API key is invalid. { "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 429 [Section titled “429 ”](https://docs.kirimdev.com/api/operations/labels/get/#429) Rate limit exceeded Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default Rate limit exceeded. { "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ### 500 [Section titled “500 ”](https://docs.kirimdev.com/api/operations/labels/get/#500) Internal server error Media type application/json object **error** required object **type** required string Allowed values: invalid\_request\_error authentication\_error permission\_error not\_found conflict rate\_limit\_error api\_error **code** required string **message** required Human-readable explanation of the error. string **param** Request field associated with the error, when applicable. string **request\_id** required Unique request identifier to include when contacting support. string ##### Examples Example default An unexpected error occurred. { "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }} ---