Tham chiếu API

Receiving Events

Standard event types & payload

The unified envelope every delivery carries and the full catalogue of public standard event types. Subscribe per endpoint with subscribed_events using the exact names below, or use ["*"] for public standard events the workspace is eligible to receive. Internal raw events are not delivered. The envelope is always id / type / provider / account_id / occurred_at / data; the shape of data depends on type. Không gian làm việc thông thường cần liệt kê rõ call.answered và call.ended trong subscribed_events để nhận sự kiện gọi đi. Không gian thử nghiệm cũng có thể dùng *, danh sách trống hoặc bỏ qua danh sách. Khi gửi, thử lại hoặc phát lại thư lỗi, hệ thống kiểm tra lại quyền và đăng ký hiện tại. Bản ghi cuộc gọi message.* được xử lý riêng.

Event payload

{
  "id": "evt_2f9c1a4b7e",
  "type": "message.received",
  "provider": "whatsapp",
  "account_id": "acc_8c21d0",
  "occurred_at": "2026-06-08T12:34:56Z",
  "data": {
    "account": { "provider_account_ref": "8600000000000" },
    "conversation": { "id": "8613912345678", "type": "user", "title": "Jordan Lee" },
    "sender": { "id": "8613912345678", "name": "Jordan Lee", "type": "user" },
    "message": {
      "id": "wamid.HBgM",
      "text": "Hi - is my order shipped yet?",
      "direction": "inbound",
      "sent_at": "2026-06-08T12:34:55Z"
    }
  }
}

Standard event types

  • call.incoming

    call.incoming là hợp đồng dự phòng; hiện chưa mở cuộc gọi đến. Khi được mở, không gian thử nghiệm có thể nhận qua subscribed_events chứa tên sự kiện, *, danh sách rỗng hoặc bỏ qua trường.

  • call.answered

    call.answered cho biết cuộc gọi đã kết nối. Để nhận sự kiện gọi đi, hãy thêm call.answered vào subscribed_events.

  • call.ended

    call.ended cho biết cuộc gọi đã kết thúc, kèm data.call.id, reason và duration_seconds. Để nhận sự kiện gọi đi, hãy thêm call.ended vào subscribed_events.

  • post.comment.created

    Thông báo bình luận TikTok sau khi nhận diện và xác minh bài đăng thuộc tài khoản hiện tại. Trước khi bật, xác nhận môi trường đã hỗ trợ thông báo và bên nhận đã sẵn sàng. Polling mặc định tắt; đặt provider_data.enable_comment=true cần khởi động hoặc kết nối lại, thay đổi khi đang trực tuyến cần kết nối lại. start thành công không chứng minh cấu hình đã áp dụng; tắt không thu hồi sự kiện đã xếp hàng. Đăng ký post.comment.created, hoặc dùng danh sách đăng ký rỗng hay *; chỉ đăng ký không bật polling. Gửi theo khả năng tốt nhất: có thể trễ, trùng, sai thứ tự hoặc thiếu, không bảo đảm lịch sử đầy đủ. Loại trùng theo id sự kiện. Thiếu parent_comment_id không chứng minh đây là bình luận cấp đầu có thể trả lời; xác minh mục tiêu trước khi trả lời.

  • contact.updated

    Tên đã lưu trong danh bạ, biệt danh hoặc ảnh đại diện WhatsApp đã đổi. Dựa vào data.event.source và changed_fields để chỉ cập nhật các trường address_book, push_name hoặc avatar_url được gửi. Chuỗi rỗng xóa giá trị, trường vắng mặt giữ nguyên và null không hợp lệ. Hãy tải ảnh từ URL có chữ ký kịp thời. contact.id định danh liên hệ và có thể khác conversation_id.

  • message.received

    A message was observed on the account; data.message.direction identifies inbound or outbound.

  • message.updated

    A previously delivered message was edited.

  • message.deleted

    A message was deleted or recalled.

  • message.read

    Biên nhận đã đọc hoặc biên nhận phát của WhatsApp. Dùng giá trị played của data.event.receipt_type để nhận biết biên nhận phát.

  • message.reaction

    A reaction was added to or removed from a message.

  • message.delivered

    A message was delivered to the recipient's device.

  • conversation.updated

    A conversation-level setting changed — muted/unmuted, archived, pinned, or marked read.

  • conversation.deleted

    A conversation was deleted.

  • conversation.cleared

    A conversation's history was cleared.

  • conversation.history

    Recent WhatsApp history for one conversation was synced after bootstrap or reconnect.

  • group.updated

    Group metadata changed — name, members, or settings.

  • group.join_request

    Someone asked to join a group with join approval enabled. Push is best-effort — poll List group join requests as the reliable source.

  • account.status.updated

    The account runtime / connection status changed.

  • account.profile.updated

    Hồ sơ tên công khai của tài khoản đã được đồng bộ; hiện được kích hoạt bởi sự kiện tên của WhatsApp.

  • account.started

    The account runtime connected and is ready to send and receive.

  • account.history.synced

    A WhatsApp history-sync batch finished; data.summary gives the delivered conversation and message counts.

  • account.auth.required

    The account needs (re)authentication — a code, QR scan, or 2FA.

  • account.auth.succeeded

    Ủy quyền tài khoản đã thành công. Trước khi gửi, truy vấn tài khoản và xác nhận runtime_status=running.

  • account.auth.failed

    An authentication attempt failed.

Ghi chú

  • For media messages, data.message.attachments[] carries a temporary signed OSS url plus type, mimetype, and size.
  • subscribed_events must contain exact public standard event names from above or ["*"]. Unknown names are rejected when you create or update the endpoint, and the wildcard does not expose internal raw events.
  • Không gian làm việc thông thường cần liệt kê rõ call.answered và call.ended trong subscribed_events để nhận sự kiện gọi đi. Không gian thử nghiệm cũng có thể dùng *, danh sách trống hoặc bỏ qua danh sách. Khi gửi, thử lại hoặc phát lại thư lỗi, hệ thống kiểm tra lại quyền và đăng ký hiện tại. Bản ghi cuộc gọi message.* được xử lý riêng.
  • Not every provider emits every event, and some payload fields differ — see "Webhook standard event differences" for the per-provider matrix.
  • message.read và message.delivered có thể liệt kê các tin nhắn được xác nhận trong data.message.ids. WhatsApp gửi biên nhận phát qua message.read với data.event.receipt_type là played và data.message.played_at nếu kênh cung cấp thời gian hợp lệ.
  • WhatsApp inbound messages can include data.message.reply_token — an opaque handle you pass back in reply_to.reply_token of POST /v1/messages to quote the current message. It appears only for real-time message.received when reply-token signing is configured. It is not reply_to_message_id, which identifies the parent of a received quoted reply.