Events feature creates WhatsApp event messages — the scheduled-event bubble with a date, location, and join link. It also sends RSVPs. Like polls, an event carries a per-message message_secret. Responders derive their RSVP encryption key from that secret. Keep the secret so you can send and decrypt responses later.
Access
Access event operations through the client:Methods
create
Create and send an event message.Recipient JID — a direct message or group chat.
Event details. Only
name is required; everything else is optional. See EventCreationParams.A
SendResult and the event’s 32-byte message_secret. Store the secret — it is required to decrypt the RSVPs that come back. A fresh secret is generated per event and attached as messageContextInfo.messageSecret; WhatsApp Web rejects an event without one.respond
RSVP to an event. The RSVP is end-to-end encrypted against the event’smessage_secret.
Chat JID where the event was sent.
Message ID of the event creation message.
JID of the user who created the event. It keys the RSVP’s encryption derivation and AAD, so it must match the creator exactly.
The 32-byte secret from the event creation message.
Going, NotGoing, or Maybe. See EventResponseType.Number of additional guests you’re bringing, when the event allows extra guests.
Result of the RSVP send. See SendResult.
The responder (self) JID also keys the derivation, so it must use the creator’s namespace: your own LID for a LID-addressed event, your PN otherwise (falling back to PN when your LID isn’t known). The library resolves this for you, mirroring the poll-vote path.
Decrypting inbound RSVPs
When you receive anEncEventResponseMessage, decrypt it with the event’s secret using the helpers in wacore::event:
| Function | Description |
|---|---|
encrypt_event_response_with_secret(response, secret, stanza_id, creator, responder) -> (Vec<u8>, [u8; 12]) | Encrypt an EventResponseMessage against the event secret. Returns (payload_with_tag, iv). |
decrypt_event_response_with_secret(payload, iv, secret, stanza_id, creator, responder) -> EventResponseMessage | Decrypt an inbound RSVP. The creator + responder JIDs must match what the responder used, or decryption fails (rather than silently mis-decrypting). |
secret_enc_addon machinery specialized for the "Event Response" use-case, matching WhatsApp Web’s WAWebAddonEncryption.
Types
EventCreationParams
| Field | Type | Description |
|---|---|---|
name | String | Event title (required; must not be empty). |
description | Option<String> | Free-text description. |
start_time | Option<i64> | Start time in unix seconds. |
end_time | Option<i64> | End time in unix seconds. |
join_link | Option<String> | Call/join link. |
location | Option<LocationMessage> | Event location. |
is_scheduled_call | Option<bool> | Mark the event as a scheduled call. |
extra_guests_allowed | Option<bool> | Allow responders to bring extra guests. |
EventResponseType
whatsapp_rust re-exports this enum from the generated proto.
Error handling
All methods returnResult<T, anyhow::Error>. Common errors:
- Empty event name when calling
create. - Not logged in — the responder’s own JID can’t be determined.
message_secretnot 32 bytes — encryption/decryption rejects the wrong size.- GCM tag verification failed — wrong secret, wrong creator/responder JID, or a tampered payload.