sharepa Docs

window.sharepaTermine

Interface for bookings in the browser. sharepa adds it to every page whose code uses it. It only talks to /__sharepa/termine at the page's own address, never directly to Google.

Readiness#

The script may load after your code. First check whether window.sharepaTermine exists, otherwise wait for the event sharepaTermine on document.

If the interface is still missing after 5 seconds, show "Bookings are not set up for this page yet."

JavaScript
function ready(fn) {
  if (window.sharepaTermine) fn();
  else document.addEventListener("sharepaTermine", fn, { once: true });
}

typen()#

sharepaTermine.typen()

Returns the booking types of this page.

Return value#

  • types[].idTextShort name, for example erstgespraech.
  • types[].nameTextDisplay name.
  • types[].descriptionText or null
  • types[].durationMinutes
  • types[].locationsListmeet, telefon, vorort or link.
  • timezoneTextYour time zone, such as Europe/Zurich.
Return value
{
  "types": [{
    "id": "erstgespraech",
    "name": "First call",
    "description": null,
    "duration": 20,
    "locations": ["meet"]
  }],
  "timezone": "Europe/Zurich"
}

zeiten()#

sharepaTermine.zeiten(type, from, to)

Returns free start times in UTC. Takes your calendar, buffers, notice and daily limits into account.

Parameters#

  • typeTextRequiredShort name of the type.
  • fromYYYY-MM-DDRequiredFirst day, in your time zone.
  • toYYYY-MM-DDRequiredLast day, included. At most 31 days after from.
JavaScript
const { slots } = await sharepaTermine.zeiten(
  "erstgespraech", "2026-11-23", "2026-12-04"
);
// ["2026-11-23T08:00:00Z", "2026-11-23T08:30:00Z", …]

buchen()#

sharepaTermine.buchen(details)

Books a time and returns { start, end } in UTC. A short security check from sharepa appears first; you do not build anything for it.

Parameters#

  • typeTextRequired
  • startTextRequiredExactly one value from slots.
  • nameTextRequired
  • emailTextRequired
  • locationTextRequiredOne of the type's locations.
  • phoneTextOnly with location: "telefon".
  • answersObjectThe page's own questions, flat, field names in lowercase and without a leading underscore.
JavaScript
try {
  await sharepaTermine.buchen({
    type: "erstgespraech",
    start: "2026-11-23T08:00:00Z",
    location: "meet",
    name: "Anna Muster",
    email: "anna@example.com",
    answers: { topic: "Website for my practice" },
  });
} catch (e) {
  if (e.code === "termine.belegt") reloadTimes();
}

Error codes#

Errors are Error objects with the fields code and status.

CodeStatusMeaningWhat the page should do
termine.aus404The page has no active booking type."Bookings are not set up for this page yet."
termine.belegt409The time was just taken.Reload the times.
termine.turnstile403The security check failed.Let the visitor try again.
formular.heikel422Answers look like password, payment or health data.Point this out.
termine.ungueltig400Details are missing or wrong, such as a time that does not exist.General error message.
termine.langsam429Too many requests or bookings in a short time.Let the visitor try again later.
formular.grenze429The entry limit is reached.General error message.
termine.gesperrt401The page has a password, and the visitor has not unlocked it.General error message.
termine.nicht_verfuegbar503Bookings are not possible right now, for example because the calendar is disconnected.General error message.
termine.fehler502Unexpected error.General error message.

Last updated