Create WhatsApp events, collect RSVPs and schedule call cards
Native event invitations now have an SDK API, attendance listeners, paginated reads and validated JSON snapshots.
OpenWA 5.5 can create native WhatsApp event cards and turn attendance responses into application events. A meetup invitation can stay in the conversation while your bot tracks going, maybe and not going. Events use the common runtime patch and don't require a licence.
Create an invitation
With a ready client, provide a future start time in Unix seconds:
const chatId = '447700900123@c.us';
const startTime = Math.floor(Date.now() / 1000) + 3600;
const eventId = await client.sendEvent(chatId, {
name: 'Community meetup',
startTime,
endTime: startTime + 3600,
description: 'Join us for a chat',
location: 'London',
extraGuestsAllowed: true,
});
The name must be nonblank and the end time must be at or after the start. sendEvent returns the submitted message ID. Use onAck for later delivery and read acknowledgements.
Only the creator can change an event. editEvent(eventId, changes) preserves omitted fields; endTime: null removes the end time, while an empty description or location clears that field. cancelEvent(eventId) leaves a canceled card in history.
Track attendance
const changes = client.onEvent(event => {
console.log(event.id, event.name, event.isCanceled);
});
const responses = client.onEventResponse(response => {
console.log(response.eventId, response.senderId, response.response);
});
onEvent reports native additions and changes, including your own sends. onEventResponse reads decrypted RSVP changes. History loading can emit callbacks too, so use response IDs and timestamps to avoid repeating a follow-up when your application rehydrates history. Both listener handles have .off() for cleanup.
Use getEventResponses(eventId) for the latest explicit response per participant. The creator's implied attendance isn't invented as an RSVP. Your bot can respond to an invitation with respondToEvent(eventId, 'going'), 'notGoing' or 'maybe'; reads may report 'unknown' for an unfamiliar native value.
Read and save events
getEvents(chatId, { limit: 20 }) reads the linked Web device's synced history, newest first. Pass its nextCursor as before for the next page in that chat. Limits range from 1 to 100. getEvent(eventId) returns null when the event isn't in available history.
import {
serializeWhatsAppEvent,
deserializeWhatsAppEvent,
} from '@open-wa/client';
const event = await client.getEvent(eventId);
if (event) {
const json = serializeWhatsAppEvent(event);
const restored = deserializeWhatsAppEvent(json);
console.log(restored.name);
}
Event and RSVP schemas are exported by @open-wa/schema and @open-wa/client. JSON serializers validate snapshots and exclude message secrets, encryption keys and encrypted response bytes. Event times use seconds; RSVP timestamps use milliseconds.
Put a call on the calendar
await client.sendEvent(chatId, {
name: 'Planning call',
startTime,
callType: 'video', // or 'voice'
isScheduledCall: true,
});
This creates an event with a native call link. A scheduled card doesn't start a call, and creating a video link doesn't enable camera streaming in the calling preview. Our receiving-phone demonstration showed RSVP and calendar controls; it didn't confirm a Join control. If link creation fails, the API rejects before sending the event.
Read the events guide and method reference for all seven methods, listeners, routes and models. Mutations don't retry automatically; inspect history before repeating a send whose outcome is uncertain.