Your masjid · Webhooks

Your webhook endpoints

The URLs Masjidbox posts your organization's events to, each signed with its endpoint's secret. They need a secret key.

The endpoints you register and the deliveries sent to them. A secret key with Masjid profile: read.

Your webhook endpoints

Masjid key · secret · Masjid profile: read

GET/v1/masjid/webhook-endpoints

The URLs Masjidbox posts your organization's events to, newest first, by cursor (limit 1 to 100, 25 by default; cursor from the previous page). Needs a secret key with Masjid profile: read; an endpoint belongs to your organization, not to the key.

Parameters

  • limitinteger · query

    Items per page, 1 to 100.

  • cursorstring · query

    The previous page's pagination.nextCursor; absent for the first page.

Returns

A page of endpoints.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (8)
    • objectwebhook_endpoint

      Always webhook_endpoint.

    • idstring

      The webhook endpoint id.

    • urlstring

      Where the events are posted.

    • eventsstring[]

      The event types it receives.

    • enabledboolean

      It receives events.

    • disabledReasonfailing | null

      failing: Masjidbox disabled it after three days of failed deliveries; null otherwise.

    • createdAtstring | null

      When it was registered (ISO-8601).

    • updatedAtstring | null

      When it last changed (ISO-8601).

  • paginationobject

    Where this page stands.

    Show child attributes (3)
    • limitinteger

      The page size asked for.

    • hasMoreboolean

      Whether another page follows: stop on false, never on a short page.

    • nextCursorstring | null

      The cursor of the next page; null on the last one.

GET /v1/masjid/webhook-endpoints
curl "https://hub.masjidbox.com/v1/masjid/webhook-endpoints" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidWebhookEndpointsPage
{
  "data": [
    {
      "createdAt": "2026-11-13T08:00:00.000Z",
      "disabledReason": null,
      "enabled": true,
      "events": [
        "event.created",
        "event.updated"
      ],
      "id": "whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10",
      "object": "webhook_endpoint",
      "updatedAt": "2026-11-13T08:00:00.000Z",
      "url": "https://example.org/masjidbox/webhooks"
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your webhook endpoints

Masjid key · secret · Masjid profile: read

GET/v1/masjid/webhook-endpoints/{id}

A webhook endpoint of your organization: its URL, its event types, whether it receives them (disabledReason: failing once Masjidbox disabled it after three days of failed deliveries). Needs a secret key with Masjid profile: read; an endpoint belongs to your organization, not to the key.

Parameters

  • idstring · pathrequired

    The webhook endpoint id.

Returns

The endpoint.

  • objectwebhook_endpoint

    Always webhook_endpoint.

  • idstring

    The webhook endpoint id.

  • urlstring

    Where the events are posted.

  • eventsstring[]

    The event types it receives.

  • enabledboolean

    It receives events.

  • disabledReasonfailing | null

    failing: Masjidbox disabled it after three days of failed deliveries; null otherwise.

  • createdAtstring | null

    When it was registered (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/webhook-endpoints/{id}
curl "https://hub.masjidbox.com/v1/masjid/webhook-endpoints/whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidWebhookEndpoint
{
  "createdAt": "2026-11-13T08:00:00.000Z",
  "disabledReason": null,
  "enabled": true,
  "events": [
    "event.created",
    "event.updated"
  ],
  "id": "whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10",
  "object": "webhook_endpoint",
  "updatedAt": "2026-11-13T08:00:00.000Z",
  "url": "https://example.org/masjidbox/webhooks"
}

Register a webhook endpoint

Masjid key · secret · Masjid profile: read

POST/v1/masjid/webhook-endpoints

Registers a URL (https, a public host name, no credentials: else 400, the reason in the detail) and the event types Masjidbox posts to it, each signed in Masjidbox-Signature with the endpoint's secret (whsec_…). The secret is answered here, once: store it now. Each event type needs the read right of its product on the key: masjid.*, profile.* Masjid profile; prayer_times.*, jumuah_times.* Prayer times; event.*, announcement.*, media.*, news.*, album.*, collection.*, poll.*, quiz.*, question.*, live.* Content; notification.*, app_notification.*, app_recurring_notification.*, app_one_time_notification.* Notifications; donation_account.*, donation_campaign.* Donation campaigns; website.*, widget.*, app_widget.*, app_popup.*, app_page.* Website and app; screen.*, screen_settings.*, playlist.*, playlist_schedule.* Screens (else 403). Five endpoints per organization (409). Needs a secret key with Masjid profile: read; an endpoint belongs to your organization, not to the key.

Parameters

No parameters.

Request body

  • urlstringrequired

    Where the events are posted: https, a public host name (no IP address, no private name), no credentials, 2048 characters at most.

  • eventsstring[]required

    The event types it receives, one at least (the enum lists them; the webhooks guide groups them by product). Each needs the read right of its product on the key.

Returns

The endpoint, and its signing secret, once.

  • objectwebhook_endpoint

    Always webhook_endpoint.

  • idstring

    The webhook endpoint id.

  • urlstring

    Where the events are posted.

  • eventsstring[]

    The event types it receives.

  • enabledboolean

    It receives events.

  • disabledReasonfailing | null

    failing: Masjidbox disabled it after three days of failed deliveries; null otherwise.

  • createdAtstring | null

    When it was registered (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

  • secretstring

    The signing secret (whsec_…) of the Masjidbox-Signature header. Answered here only, once: store it now.

POST /v1/masjid/webhook-endpoints
curl -X POST "https://hub.masjidbox.com/v1/masjid/webhook-endpoints" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"events":["event.created"],"url":"https://example.org/masjidbox/webhooks"}'
Example request · MasjidWebhookEndpointCreate
{
  "events": [
    "event.created"
  ],
  "url": "https://example.org/masjidbox/webhooks"
}
201 · MasjidWebhookEndpointWithSecret
{
  "createdAt": "2026-11-13T08:00:00.000Z",
  "disabledReason": null,
  "enabled": true,
  "events": [
    "event.created",
    "event.updated"
  ],
  "id": "whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10",
  "object": "webhook_endpoint",
  "updatedAt": "2026-11-13T08:00:00.000Z",
  "url": "https://example.org/masjidbox/webhooks",
  "secret": "whsec_example"
}

Change a webhook endpoint

Masjid key · secret · Masjid profile: read

PATCH/v1/masjid/webhook-endpoints/{id}

Changes the URL, the event types (the whole list) or enabled; a field you leave out stays. enabled: true resumes the deliveries and clears a failing disable; false stops them. Each event type needs the read right of its product on the key: masjid.*, profile.* Masjid profile; prayer_times.*, jumuah_times.* Prayer times; event.*, announcement.*, media.*, news.*, album.*, collection.*, poll.*, quiz.*, question.*, live.* Content; notification.*, app_notification.*, app_recurring_notification.*, app_one_time_notification.* Notifications; donation_account.*, donation_campaign.* Donation campaigns; website.*, widget.*, app_widget.*, app_popup.*, app_page.* Website and app; screen.*, screen_settings.*, playlist.*, playlist_schedule.* Screens (else 403). Needs a secret key with Masjid profile: read; an endpoint belongs to your organization, not to the key.

Parameters

  • idstring · pathrequired

    The webhook endpoint id.

Request body

  • urlstring

    Where the events are posted: https, a public host name (no IP address, no private name), no credentials, 2048 characters at most.

  • eventsstring[]

    The event types it receives, one at least (the enum lists them; the webhooks guide groups them by product). Each needs the read right of its product on the key.

  • enabledboolean

    false stops its deliveries; true resumes them, and clears a failing disable.

Returns

The endpoint after the change.

  • objectwebhook_endpoint

    Always webhook_endpoint.

  • idstring

    The webhook endpoint id.

  • urlstring

    Where the events are posted.

  • eventsstring[]

    The event types it receives.

  • enabledboolean

    It receives events.

  • disabledReasonfailing | null

    failing: Masjidbox disabled it after three days of failed deliveries; null otherwise.

  • createdAtstring | null

    When it was registered (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/webhook-endpoints/{id}
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/webhook-endpoints/whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'
Example request · MasjidWebhookEndpointPatch
{
  "enabled": true
}
200 · MasjidWebhookEndpoint
{
  "createdAt": "2026-11-13T08:00:00.000Z",
  "disabledReason": null,
  "enabled": true,
  "events": [
    "event.created",
    "event.updated"
  ],
  "id": "whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10",
  "object": "webhook_endpoint",
  "updatedAt": "2026-11-13T08:00:00.000Z",
  "url": "https://example.org/masjidbox/webhooks"
}

Delete a webhook endpoint

Masjid key · secret · Masjid profile: read

DELETE/v1/masjid/webhook-endpoints/{id}

Deletes an endpoint and its delivery log: nothing is posted to it any more, the attempts still due included. Needs a secret key with Masjid profile: read; an endpoint belongs to your organization, not to the key.

Parameters

  • idstring · pathrequired

    The webhook endpoint id.

Returns

Deleted. No body.

204 · No response body.

DELETE /v1/masjid/webhook-endpoints/{id}
curl -X DELETE "https://hub.masjidbox.com/v1/masjid/webhook-endpoints/whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"

Rotate a webhook endpoint's secret

Masjid key · secret · Masjid profile: read

POST/v1/masjid/webhook-endpoints/{id}/rotate-secret

A new signing secret, answered here once: store it now. For 24 hours every delivery carries a second v1 signature under the previous secret, so your receiver switches without a gap. Needs a secret key with Masjid profile: read; an endpoint belongs to your organization, not to the key.

Parameters

  • idstring · pathrequired

    The webhook endpoint id.

Returns

The endpoint, and its new signing secret, once.

  • objectwebhook_endpoint

    Always webhook_endpoint.

  • idstring

    The webhook endpoint id.

  • urlstring

    Where the events are posted.

  • eventsstring[]

    The event types it receives.

  • enabledboolean

    It receives events.

  • disabledReasonfailing | null

    failing: Masjidbox disabled it after three days of failed deliveries; null otherwise.

  • createdAtstring | null

    When it was registered (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

  • secretstring

    The signing secret (whsec_…) of the Masjidbox-Signature header. Answered here only, once: store it now.

POST /v1/masjid/webhook-endpoints/{id}/rotate-secret
curl -X POST "https://hub.masjidbox.com/v1/masjid/webhook-endpoints/whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10/rotate-secret" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidWebhookEndpointWithSecret
{
  "createdAt": "2026-11-13T08:00:00.000Z",
  "disabledReason": null,
  "enabled": true,
  "events": [
    "event.created",
    "event.updated"
  ],
  "id": "whk_3f0c2a52-7d8e-4b1a-9c6f-2e5d8a4b7c10",
  "object": "webhook_endpoint",
  "updatedAt": "2026-11-13T08:00:00.000Z",
  "url": "https://example.org/masjidbox/webhooks",
  "secret": "whsec_example"
}

Events, by product

Every event Masjidbox posts to a webhook endpoint, and the read right a key needs to subscribe to it. The webhooks guide says how to verify them.

Events, by product
EventProduct (right to subscribe)Entitydata.id
masjid.updatedMasjid profileYour organizationnull
profile.updatedMasjid profileYour masjid's profilenull
prayer_times.updatedPrayer timesYour prayer timesnull
jumuah_times.updatedPrayer timesYour jumu'ah timesnull
event.createdContentYour eventsevt_…
event.updatedContentYour eventsevt_…
event.deletedContentYour eventsevt_…
announcement.createdContentYour announcementsann_…
announcement.updatedContentYour announcementsann_…
announcement.deletedContentYour announcementsann_…
media.createdContentYour mediamed_…
media.updatedContentYour mediamed_…
media.deletedContentYour mediamed_…
news.createdContentYour newsnws_…
news.updatedContentYour newsnws_…
news.deletedContentYour newsnws_…
album.createdContentYour albumsalb_…
album.updatedContentYour albumsalb_…
album.deletedContentYour albumsalb_…
collection.createdContentYour collectionscol_…
collection.updatedContentYour collectionscol_…
collection.deletedContentYour collectionscol_…
poll.createdContentYour pollspol_…
poll.updatedContentYour pollspol_…
poll.deletedContentYour pollspol_…
quiz.createdContentYour quizzesqiz_…
quiz.updatedContentYour quizzesqiz_…
quiz.deletedContentYour quizzesqiz_…
question.updatedContentAsk-the-imam questionsqst_…
question.deletedContentAsk-the-imam questionsqst_…
live.createdContentYour livesliv_…
live.updatedContentYour livesliv_…
live.deletedContentYour livesliv_…
notification.createdNotificationsYour One notificationsntf_…
notification.updatedNotificationsYour One notificationsntf_…
notification.deletedNotificationsYour One notificationsntf_…
app_notification.createdNotificationsYour app's scheduled pushesapn_…
app_notification.updatedNotificationsYour app's scheduled pushesapn_…
app_notification.deletedNotificationsYour app's scheduled pushesapn_…
app_recurring_notification.createdNotificationsYour app's recurring pushesarn_…
app_recurring_notification.updatedNotificationsYour app's recurring pushesarn_…
app_recurring_notification.deletedNotificationsYour app's recurring pushesarn_…
app_one_time_notification.createdNotificationsYour app's one-time pushesaon_…
app_one_time_notification.updatedNotificationsYour app's one-time pushesaon_…
app_one_time_notification.deletedNotificationsYour app's one-time pushesaon_…
donation_account.updatedDonation campaignsYour donation accountnull
donation_campaign.createdDonation campaignsYour donation campaignscmp_…
donation_campaign.updatedDonation campaignsYour donation campaignscmp_…
donation_campaign.deletedDonation campaignsYour donation campaignscmp_…
website.updatedWebsite and appYour websitenull
widget.createdWebsite and appYour website widgetswdg_…
widget.updatedWebsite and appYour website widgetswdg_…
widget.deletedWebsite and appYour website widgetswdg_…
app_widget.updatedWebsite and appYour app's widgetnull
app_popup.createdWebsite and appYour app's popupsapo_…
app_popup.updatedWebsite and appYour app's popupsapo_…
app_popup.deletedWebsite and appYour app's popupsapo_…
app_page.createdWebsite and appYour app's pagesthe stored id
app_page.updatedWebsite and appYour app's pagesthe stored id
app_page.deletedWebsite and appYour app's pagesthe stored id
screen.updatedScreensYour screensscr_…
screen.deletedScreensYour screensscr_…
screen_settings.updatedScreensYour screen settingsnull
playlist.createdScreensYour playlistspll_…
playlist.updatedScreensYour playlistspll_…
playlist.deletedScreensYour playlistspll_…
playlist_schedule.createdScreensYour playlist schedulespsc_…
playlist_schedule.updatedScreensYour playlist schedulespsc_…
playlist_schedule.deletedScreensYour playlist schedulespsc_…