Docs / For your masjid

Quickstart

Read your masjid's times and update your jumu'ah from your own website, screens or tools. This section is for a masjid's own key: to build an app that shows many masjids, read the developer docs instead.

1. Create a key in your dashboard

In your Masjidbox dashboard, open API → Keys → New key. You need the API permission of your organization; its owner has it and can give it to other managers.

Pick the kind of key and its rights per product:

KeyCanUse it in
Publishable (mbx_pk_live_…)Read onlyyour website, a widget, an app
Secret (mbx_sk_live_…)Read and edita server only, never in a page or an app

The key is shown once: copy it before you leave the page.

sh
export MASJIDBOX_KEY="mbx_sk_live_…"

2. Read today's times

No masjid id to pass: the key says which organization it belongs to.

sh
curl https://hub.masjidbox.com/v1/masjid/prayer-times \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
# → { "object": "prayer_times", "date": "2026-10-23", "prayers": { "fajr": { "athan": "06:41", "iqamah": "07:00" }, … } }

Times are wall-clock HH:mm in your organization's timezone.

3. Update your jumu'ah

A write needs a secret key with Prayer times: edit.

sh
curl -X PATCH https://hub.masjidbox.com/v1/masjid/jumuah-times \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"times":[{"athan":"12:45","iqamah":"13:05"}]}'
# → { "object": "jumuah_times", "times": [ … ], "affectedMasjids": ["msj_o5urjd3hd5"] }

times replaces the whole list, [] removes jumu'ah. Every masjid of your organization gets the new times: affectedMasjids lists them. Apps and widgets reading the public API may show the old times for up to 5 minutes.

Next

  • Keys & rights: publishable or secret, rights per product, expiry and revoking.
  • Limits: how many reads and writes your organization may send.
  • Errors: every refusal, and what to do about it.