Your masjid · Website and app

Your website widgets

The widgets your website embeds, the prayer times or a donation campaign, each under the public key of its embed snippet.

Right on the key: Website and app: read for a read, edit (secret key) for a write.

Your widgets

Masjid key · Website and app: read

GET/v1/masjid/widgets

The widgets your website embeds (prayer times, a donation campaign), newest first, by cursor (limit 1 to 100, 25 by default; cursor from the previous page). Needs Website and app: read.

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 widgets.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (16)
    • objectwidget

      Always widget.

    • idstring

      The widget id.

    • keystring

      The public key its embed snippet carries.

    • typeprayer-times | prayer-times-small | donations-campaign

      What it shows: the prayer times (full or compact), or a donation campaign.

    • titlestring | null

      Its title.

    • enabledboolean

      False when it is switched off.

    • colorstring | null

      Main colour, a CSS colour.

    • labelColorstring | null

      Colour of the labels, a CSS colour.

    • languagestring | null

      Language of its texts (ISO 639-1).

    • layoutstring | null

      The layout it renders with.

    • optionsobject

      Display options, by name: a switch or a text.

    • translationsobject

      Texts overridden, by translation key.

    • websitestring[]

      The websites it may be embedded on.

    • campaignstring | null

      The donation campaign it shows.

    • createdAtstring | null

      When it was created (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/widgets
curl "https://hub.masjidbox.com/v1/masjid/widgets" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidWidgetsPage
{
  "data": [
    {
      "campaign": null,
      "color": "#0f766e",
      "createdAt": "2026-12-01T10:00:00.000Z",
      "enabled": true,
      "id": "wdg_6af5c9e2bc095fbd2dc5735a",
      "key": "example-widget-key",
      "labelColor": "#ffffff",
      "language": "en",
      "layout": "horizontal",
      "object": "widget",
      "options": {
        "showIqamah": true
      },
      "title": "Prayer times",
      "translations": {
        "WIDGET_PRY_IQAMAH": "Jamaat"
      },
      "type": "prayer-times",
      "updatedAt": "2026-12-01T10:00:00.000Z",
      "website": [
        "mosque.example.org"
      ]
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your widgets

Masjid key · Website and app: read

GET/v1/masjid/widgets/{id}

A widget of your organization, with the public key its embed snippet carries. Needs Website and app: read.

Parameters

  • idstring · pathrequired

    The widget id.

Returns

The widget.

  • objectwidget

    Always widget.

  • idstring

    The widget id.

  • keystring

    The public key its embed snippet carries.

  • typeprayer-times | prayer-times-small | donations-campaign

    What it shows: the prayer times (full or compact), or a donation campaign.

  • titlestring | null

    Its title.

  • enabledboolean

    False when it is switched off.

  • colorstring | null

    Main colour, a CSS colour.

  • labelColorstring | null

    Colour of the labels, a CSS colour.

  • languagestring | null

    Language of its texts (ISO 639-1).

  • layoutstring | null

    The layout it renders with.

  • optionsobject

    Display options, by name: a switch or a text.

  • translationsobject

    Texts overridden, by translation key.

  • websitestring[]

    The websites it may be embedded on.

  • campaignstring | null

    The donation campaign it shows.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/widgets/{id}
curl "https://hub.masjidbox.com/v1/masjid/widgets/wdg_6af5c9e2bc095fbd2dc5735a" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidWidget
{
  "campaign": null,
  "color": "#0f766e",
  "createdAt": "2026-12-01T10:00:00.000Z",
  "enabled": true,
  "id": "wdg_6af5c9e2bc095fbd2dc5735a",
  "key": "example-widget-key",
  "labelColor": "#ffffff",
  "language": "en",
  "layout": "horizontal",
  "object": "widget",
  "options": {
    "showIqamah": true
  },
  "title": "Prayer times",
  "translations": {
    "WIDGET_PRY_IQAMAH": "Jamaat"
  },
  "type": "prayer-times",
  "updatedAt": "2026-12-01T10:00:00.000Z",
  "website": [
    "mosque.example.org"
  ]
}

Create a widget

Masjid key · secret · Website and app: edit

POST/v1/masjid/widgets

Creates a widget as the dashboard does: enabled, under a fresh public key for its embed snippet, its options checked against its type. A campaign must be one of your donation campaigns (cmp_ id), else 400. Needs a secret key with Website and app: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

No parameters.

Request body

  • typeprayer-times | prayer-times-small | donations-campaignrequired

    What it shows.

  • titlestring

    Its title.

  • colorstring

    Main colour, a CSS colour.

  • labelColorstring

    Colour of the labels.

  • languagestring

    Language of its texts (ISO 639-1).

  • layoutstring

    The layout it renders with.

  • optionsobject

    Display options, checked against its type: prayer-times takes showJumuah, showIqamah, highlightIqamah, showName, showCountdown, showDate; prayer-times-small takes showIqamah, showJumuah, highlightIqamah; donations-campaign takes showProgress, showTitle, showDescription, showRecap and the text overwriteDescription. Another option is a 400.

  • translationsobject

    Texts overridden, by translation key.

  • websitestring[]

    The websites it may be embedded on, up to 50.

  • campaignstring

    One of your donation campaigns (cmp_); another organization’s is a 400.

Returns

The widget, as stored.

  • objectwidget

    Always widget.

  • idstring

    The widget id.

  • keystring

    The public key its embed snippet carries.

  • typeprayer-times | prayer-times-small | donations-campaign

    What it shows: the prayer times (full or compact), or a donation campaign.

  • titlestring | null

    Its title.

  • enabledboolean

    False when it is switched off.

  • colorstring | null

    Main colour, a CSS colour.

  • labelColorstring | null

    Colour of the labels, a CSS colour.

  • languagestring | null

    Language of its texts (ISO 639-1).

  • layoutstring | null

    The layout it renders with.

  • optionsobject

    Display options, by name: a switch or a text.

  • translationsobject

    Texts overridden, by translation key.

  • websitestring[]

    The websites it may be embedded on.

  • campaignstring | null

    The donation campaign it shows.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

POST /v1/masjid/widgets
curl -X POST "https://hub.masjidbox.com/v1/masjid/widgets" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Prayer times","type":"prayer-times"}'
Example request · MasjidWidgetCreate
{
  "title": "Prayer times",
  "type": "prayer-times"
}
201 · MasjidWidget
{
  "campaign": null,
  "color": "#0f766e",
  "createdAt": "2026-12-01T10:00:00.000Z",
  "enabled": true,
  "id": "wdg_6af5c9e2bc095fbd2dc5735a",
  "key": "example-widget-key",
  "labelColor": "#ffffff",
  "language": "en",
  "layout": "horizontal",
  "object": "widget",
  "options": {
    "showIqamah": true
  },
  "title": "Prayer times",
  "translations": {
    "WIDGET_PRY_IQAMAH": "Jamaat"
  },
  "type": "prayer-times",
  "updatedAt": "2026-12-01T10:00:00.000Z",
  "website": [
    "mosque.example.org"
  ]
}

Change a widget

Masjid key · secret · Website and app: edit

PATCH/v1/masjid/widgets/{id}

A merge: a field you leave out stays. The options are checked against the type the widget will have; a new campaign must be one of yours (cmp_ id), else 400. Every website embedding it shows the change. Needs a secret key with Website and app: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

  • idstring · pathrequired

    The widget id.

Request body

  • typeprayer-times | prayer-times-small | donations-campaign

    What it shows.

  • enabledboolean

    false switches it off.

  • titlestring

    Its title.

  • colorstring

    Main colour, a CSS colour.

  • labelColorstring

    Colour of the labels.

  • languagestring

    Language of its texts (ISO 639-1).

  • layoutstring

    The layout it renders with.

  • optionsobject

    Display options, checked against its type: prayer-times takes showJumuah, showIqamah, highlightIqamah, showName, showCountdown, showDate; prayer-times-small takes showIqamah, showJumuah, highlightIqamah; donations-campaign takes showProgress, showTitle, showDescription, showRecap and the text overwriteDescription. Another option is a 400.

  • translationsobject

    Texts overridden, by translation key.

  • websitestring[]

    The websites it may be embedded on, up to 50.

  • campaignstring

    One of your donation campaigns (cmp_); another organization’s is a 400.

Returns

The widget after the change.

  • objectwidget

    Always widget.

  • idstring

    The widget id.

  • keystring

    The public key its embed snippet carries.

  • typeprayer-times | prayer-times-small | donations-campaign

    What it shows: the prayer times (full or compact), or a donation campaign.

  • titlestring | null

    Its title.

  • enabledboolean

    False when it is switched off.

  • colorstring | null

    Main colour, a CSS colour.

  • labelColorstring | null

    Colour of the labels, a CSS colour.

  • languagestring | null

    Language of its texts (ISO 639-1).

  • layoutstring | null

    The layout it renders with.

  • optionsobject

    Display options, by name: a switch or a text.

  • translationsobject

    Texts overridden, by translation key.

  • websitestring[]

    The websites it may be embedded on.

  • campaignstring | null

    The donation campaign it shows.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/widgets/{id}
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/widgets/wdg_6af5c9e2bc095fbd2dc5735a" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":false}'
Example request · MasjidWidgetPatch
{
  "enabled": false
}
200 · MasjidWidget
{
  "campaign": null,
  "color": "#0f766e",
  "createdAt": "2026-12-01T10:00:00.000Z",
  "enabled": true,
  "id": "wdg_6af5c9e2bc095fbd2dc5735a",
  "key": "example-widget-key",
  "labelColor": "#ffffff",
  "language": "en",
  "layout": "horizontal",
  "object": "widget",
  "options": {
    "showIqamah": true
  },
  "title": "Prayer times",
  "translations": {
    "WIDGET_PRY_IQAMAH": "Jamaat"
  },
  "type": "prayer-times",
  "updatedAt": "2026-12-01T10:00:00.000Z",
  "website": [
    "mosque.example.org"
  ]
}

Delete a widget

Masjid key · secret · Website and app: edit

DELETE/v1/masjid/widgets/{id}

Deletes a widget and its view counters: every website embedding it stops showing it. Needs a secret key with Website and app: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

  • idstring · pathrequired

    The widget id.

Returns

Deleted. No body.

204 · No response body.

DELETE /v1/masjid/widgets/{id}
curl -X DELETE "https://hub.masjidbox.com/v1/masjid/widgets/wdg_6af5c9e2bc095fbd2dc5735a" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"