Skip to content
ReppREST reference · v2

Events

What Repp tells your page as it happens, while it is open: frames loading, a request posted, a substitute trainer chosen, a room booked. Ids and states only.

Browser events or webhooks

Two ways Repp tells you
WhatBrowser eventsWebhooks
ReachYour page, through the SDKYour server, signed
WhenOnly while a page with the messenger booted is openAlways, retried until your server answers 2xx
Use them forUpdating what the person sees at onceYour records: a class covered, a room blocked or freed
Source of truthNo: a hintYes

Write nothing lasting from a browser event: a person can close the page a moment before it comes, and events are never sent again. Keep your records from Webhooks, and use the events below to update an open screen without waiting for your server.

Listening

Listen on the messenger, an instance or a component's handle. Each on returns a function that stops listening.

Listening
const stop = messenger.on("substitute_chosen", ({ partner_class_id, trainer }) => {
  calendar.markCovered(partner_class_id, trainer.display_name);
});
// later: stop();

Every event

Events
EventFromPayloadWhen
readyEvery frame{ component: "connect" | "substitute" | "class-status" | "messenger" }A frame loaded and claimed its session.
load_errorEvery frame{ code: "timeout" | "session" | "unknown_partner" | "origin" }A frame could not load: no answer in time, no session, an unknown publishable key, or a page whose origin the key does not allow.
closeSubstitute window{ reason: "user" | "done" }The substitute window closed.
session_expiredEvery frame{}A session ran out and fetchClientSecret could not give a new one. The frame asks the person to refresh the page.
connectedMessenger, connect{ connection_id: string }The business connected its Repp account.
disconnectedMessenger, connect{ connection_id: string }An owner disconnected it (the panel's Account tab, or the connect card).
connect_failedMessenger, connect{ reason: "cancelled" | "already_connected" | "expired" }Connecting did not finish: the person cancelled, the business is already connected to another Repp account, or the 10-minute window ran out.
request_postedMessenger, substitute{ partner_class_id: string; repp_request_id: string }A request for a substitute trainer was posted for one of your classes.
status_changedMessenger, substitute, class-status{ partner_class_id: string; state: "none" | "looking" | "offers" | "chosen" | "cancelled" | "no_one"; offers_count: number }Where a class's request stands changed.
substitute_chosenMessenger, substitute{ partner_class_id: string; repp_request_id: string; trainer: { display_name: string; photo_url: string | null } }A substitute trainer was chosen on Repp. display_name is the short name ("דנה כ."), never the full one.
badge_clickclass-status{ partner_class_id: string }A class's status chip was clicked.
showMessenger{}The panel opened (its button, or show, showSpace, showSubstitute).
hideMessenger{}The panel closed.
waiting_changedMessenger{ count: number }The count on the button changed (Intercom's unread count): what waits for the business (classes with offers to choose from, space booking requests waiting for its yes), and what is new since this person last opened the panel's Activity tab (a "+1" each, cleared when that tab opens; never what this person did there, and never an offer or a space request, which already count as waiting).
space_openedMessenger{ partner_room_id: string; repp_space_id: string }One of your rooms was opened for rent as a space on Repp.
room_booking_changedMessenger{ partner_room_id: string; repp_space_id: string; repp_booking_id: string; state: "pending" | "confirmed" | "cancelled"; date: string; start_hour: number; end_hour: number }Between two reads of the panel, one booking day of a room opened from the panel came in (pending), was confirmed, or went (cancelled). Block or free that room in your calendar. Date and whole hours in Israel's time. Key your blocks by repp_booking_id and date, never by hours: a weekly booking comes once per week with the same id, and a week once charged becomes a booking of its own, so you hear that day of the weekly booking go and the week's own id come in the same read (cancellations first). Heard only while your page is open (the messenger reads every 15 seconds while shown, every minute while hidden); your server hears the same from Webhooks, which are the source of truth.
room_bookingsMessenger{ partner_room_id: string; repp_space_id: string; from: string; to: string; bookings: { repp_booking_id: string; state: "pending" | "confirmed"; date: string; start_hour: number; end_hour: number }[] }Everything that holds a room opened from the panel, from from to to (both included, Israel's days: today and the next 59, or fewer when more than 300 booking days fall in them). Said when the messenger boots, so bookings made or cancelled while your page was closed reach you, and again when the window moves (a new day). Replace all of your Repp blocks of that room within those days with these.

What an event never carries

Events carry ids and states, the date and hours of a room's booking, and at most a chosen trainer's short name ("דנה כ.") and photo. Never a phone, a full name, a renter or an amount. What a request or a booking holds stays inside Repp's frame and on Repp's site.

state of status_changed is one of none, looking, offers, chosen, cancelled, no_one: no request yet, looking for a trainer, offers to choose from, a trainer chosen, cancelled, or the hour came with nobody chosen.