Your masjid · Website and app

Your app's widget

The widget of your app's home screen: its colours, its banner, its donation campaign and its text overrides.

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

Your app's widget

Masjid key · Website and app: read

GET/v1/masjid/app-widget

The widget of your app's home screen: its colours, banner, donation campaign and text overrides. Needs Website and app: read.

Parameters

No parameters.

Returns

The app widget.

  • objectapp_widget

    Always app_widget.

  • themeobject

    Its colours.

    Show child attributes (4)
    • lightobject

      Light mode.

    • light.universestring | null

      The colour of the mode, #rrggbb.

    • darkobject

      Dark mode.

    • dark.universestring | null

      The colour of the mode, #rrggbb.

  • announcementstring | null

    The banner it shows.

  • campaignstring | null

    The donation campaign it shows.

  • translationobject

    Its text overrides, by key.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/app-widget
curl "https://hub.masjidbox.com/v1/masjid/app-widget" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidAppWidget
{
  "announcement": "Ramadan timetables are in.",
  "campaign": "cmp_6af5c9e2bc095fbd2dc5735b",
  "createdAt": "2026-12-01T10:00:00.000Z",
  "object": "app_widget",
  "theme": {
    "dark": {
      "universe": "#000000"
    },
    "light": {
      "universe": "#32a852"
    }
  },
  "translation": {
    "NEED_UPDATE": "Update available"
  },
  "updatedAt": "2026-12-01T10:00:00.000Z"
}

Change your app's widget

Masjid key · secret · Website and app: edit

PATCH/v1/masjid/app-widget

A merge: a field you leave out stays, theme mode by mode, translation key by key; null clears the banner or the campaign. A new campaign must be one of your donation campaigns (cmp_ id), else 400. Every device of the app shows the change once its caches refresh. 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

  • themeobject

    Its colours; the modes named merge.

    Show child attributes (4)
    • lightobject

      Light mode.

    • light.universestring | null

      The colour of the mode, #rrggbb; null clears it.

    • darkobject

      Dark mode.

    • dark.universestring | null

      The colour of the mode, #rrggbb; null clears it.

  • announcementstring | null

    The banner it shows; null clears it.

  • campaignstring | null

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

  • translationobject

    Text overrides, by key; the keys named merge.

Returns

The app widget after the change.

  • objectapp_widget

    Always app_widget.

  • themeobject

    Its colours.

    Show child attributes (4)
    • lightobject

      Light mode.

    • light.universestring | null

      The colour of the mode, #rrggbb.

    • darkobject

      Dark mode.

    • dark.universestring | null

      The colour of the mode, #rrggbb.

  • announcementstring | null

    The banner it shows.

  • campaignstring | null

    The donation campaign it shows.

  • translationobject

    Its text overrides, by key.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/app-widget
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/app-widget" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"announcement":"Ramadan timetables are in."}'
Example request · MasjidAppWidgetPatch
{
  "announcement": "Ramadan timetables are in."
}
200 · MasjidAppWidget
{
  "announcement": "Ramadan timetables are in.",
  "campaign": "cmp_6af5c9e2bc095fbd2dc5735b",
  "createdAt": "2026-12-01T10:00:00.000Z",
  "object": "app_widget",
  "theme": {
    "dark": {
      "universe": "#000000"
    },
    "light": {
      "universe": "#32a852"
    }
  },
  "translation": {
    "NEED_UPDATE": "Update available"
  },
  "updatedAt": "2026-12-01T10:00:00.000Z"
}