เอกสารอ้างอิง 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. เวิร์กสเปซทั่วไปต้องระบุ call.answered และ call.ended ใน subscribed_events เพื่อรับเหตุการณ์สายโทรออก เวิร์กสเปซทดสอบใช้ * รายการว่าง หรือไม่ระบุรายการก็ได้ ระบบตรวจสิทธิ์และการสมัครรับล่าสุดเมื่อส่ง ลองใหม่ หรือเล่นซ้ำจากคิวข้อความล้มเหลว บันทึกการโทร message.* แยกจากเหตุการณ์เหล่านี้

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 เป็นสัญญาที่สงวนไว้ ยังไม่เปิดรับสาย เมื่อเปิดแล้ว เวิร์กสเปซทดสอบจะรับได้ผ่าน subscribed_events ที่ระบุชื่อเหตุการณ์, *, รายการว่าง หรือไม่ระบุฟิลด์

  • call.answered

    call.answered แจ้งว่าเชื่อมต่อสายแล้ว ให้ระบุ call.answered ใน subscribed_events เพื่อรับเหตุการณ์ของสายโทรออก

  • call.ended

    call.ended แจ้งว่าสายสิ้นสุดแล้ว พร้อม data.call.id, reason และ duration_seconds ให้ระบุ call.ended ใน subscribed_events เพื่อรับเหตุการณ์ของสายโทรออก

  • post.comment.created

    การแจ้งเตือนความคิดเห็น TikTok หลังผ่านการระบุและตรวจสอบว่าโพสต์เป็นของบัญชีปัจจุบัน ก่อนเปิดใช้ให้ยืนยันว่าสภาพแวดล้อมรองรับการแจ้งเตือนและผู้รับพร้อมแล้ว การ polling ปิดไว้โดยค่าเริ่มต้น เมื่อตั้ง provider_data.enable_comment=true ต้องเริ่มหรือเชื่อมต่อใหม่ การเปลี่ยนค่าขณะออนไลน์ต้องเชื่อมต่อใหม่ start สำเร็จไม่ได้ยืนยันว่าใช้ค่าใหม่แล้ว การปิดไม่ถอนเหตุการณ์ที่อยู่ในคิว สมัครรับ post.comment.created หรือใช้รายการสมัครว่างหรือ * การสมัครอย่างเดียวไม่เปิด polling การส่งเป็นแบบพยายามให้ดีที่สุด อาจล่าช้า ซ้ำ ผิดลำดับ หรือตกหล่น และไม่รับประกันประวัติครบถ้วน ใช้ id ของเหตุการณ์เพื่อตัดรายการซ้ำ การไม่มี parent_comment_id ไม่ได้ยืนยันว่าเป็นความคิดเห็นระดับแรกที่ตอบกลับได้ ต้องตรวจสอบเป้าหมายก่อนตอบกลับ

  • contact.updated

    ชื่อที่บันทึกในสมุดที่อยู่ ชื่อเล่น หรือรูปโปรไฟล์ WhatsApp เปลี่ยนแปลง ให้ใช้ data.event.source และ changed_fields อัปเดตเฉพาะฟิลด์ address_book, push_name หรือ avatar_url ที่ส่งมา สตริงว่างใช้ล้างค่า ฟิลด์ที่ละเว้นคงเดิม และใช้ null ไม่ได้ ให้ดาวน์โหลดรูปจาก URL ที่มีลายเซ็นโดยเร็ว contact.id ระบุรายชื่อและอาจต่างจาก 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

    ใบรับการอ่านหรือใบรับการเล่นของ WhatsApp ตรวจค่า played ใน data.event.receipt_type เพื่อแยกใบรับการเล่น

  • 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

    ซิงค์โปรไฟล์ชื่อสาธารณะของบัญชีแล้ว; ปัจจุบัน trigger โดยอีเวนต์ชื่อของ 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

    อนุญาตบัญชีสำเร็จแล้ว ก่อนส่งข้อความให้สอบถามบัญชีและยืนยันว่า runtime_status=running

  • account.auth.failed

    An authentication attempt failed.

หมายเหตุ

  • 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.
  • เวิร์กสเปซทั่วไปต้องระบุ call.answered และ call.ended ใน subscribed_events เพื่อรับเหตุการณ์สายโทรออก เวิร์กสเปซทดสอบใช้ * รายการว่าง หรือไม่ระบุรายการก็ได้ ระบบตรวจสิทธิ์และการสมัครรับล่าสุดเมื่อส่ง ลองใหม่ หรือเล่นซ้ำจากคิวข้อความล้มเหลว บันทึกการโทร message.* แยกจากเหตุการณ์เหล่านี้
  • Not every provider emits every event, and some payload fields differ — see "Webhook standard event differences" for the per-provider matrix.
  • message.read และ message.delivered อาจระบุข้อความในใบรับไว้ใน data.message.ids การเล่นบน WhatsApp จะส่งผ่าน message.read โดยมี data.event.receipt_type เป็น played และมี data.message.played_at เมื่อช่องทางให้เวลาที่ถูกต้อง
  • 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.