Your masjid · Content

Your announcements

The banners your apps and screens show: a text, its colours and an optional media.

Right on the key: Content: read for a read, edit (secret key) for a write.

Your announcements

Masjid key · Content: read

GET/v1/masjid/announcements

Your organization's announcements (the banners of the apps and screens), newest first, by cursor (limit 1 to 100, 25 by default; cursor from the previous page). Needs Content: 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 announcements.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (12)
    • objectannouncement

      Always announcement.

    • idstring

      The announcement id.

    • titlestring

      The title.

    • descriptionstring | null

      The text.

    • textColorstring | null

      The text colour, CSS hex.

    • backgroundColorstring | null

      The banner colour, CSS hex.

    • mediaobject | null

      The media it shows.

    • media.idstring

      The media id.

    • media.typestring | null

      picture, video or document.

    • media.urlstring | null

      The URL to show it from.

    • 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/announcements
curl "https://hub.masjidbox.com/v1/masjid/announcements" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidAnnouncementsPage
{
  "data": [
    {
      "backgroundColor": "#0f172a",
      "createdAt": "2026-11-12T08:00:00.000Z",
      "description": "Doors open at 17:30.",
      "id": "ann_6af5c9e2bc095fbd2dc5735e",
      "media": null,
      "object": "announcement",
      "textColor": "#ffffff",
      "title": "Iftar tonight",
      "updatedAt": "2026-11-12T08:00:00.000Z"
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your announcements

Masjid key · Content: read

GET/v1/masjid/announcements/{id}

An announcement of your organization. Needs Content: read.

Parameters

  • idstring · pathrequired

    The announcement id.

Returns

The announcement.

  • objectannouncement

    Always announcement.

  • idstring

    The announcement id.

  • titlestring

    The title.

  • descriptionstring | null

    The text.

  • textColorstring | null

    The text colour, CSS hex.

  • backgroundColorstring | null

    The banner colour, CSS hex.

  • mediaobject | null

    The media it shows.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/announcements/{id}
curl "https://hub.masjidbox.com/v1/masjid/announcements/ann_6af5c9e2bc095fbd2dc5735e" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidAnnouncement
{
  "backgroundColor": "#0f172a",
  "createdAt": "2026-11-12T08:00:00.000Z",
  "description": "Doors open at 17:30.",
  "id": "ann_6af5c9e2bc095fbd2dc5735e",
  "media": null,
  "object": "announcement",
  "textColor": "#ffffff",
  "title": "Iftar tonight",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Create an announcement

Masjid key · secret · Content: edit

POST/v1/masjid/announcements

Creates a banner: a title, a text, its colours (CSS hex) and a media of your organization. Needs a secret key with Content: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

No parameters.

Request body

  • descriptionstring | null

    The text.

  • textColorstring | null

    CSS hex: #rgb, #rrggbb or #rrggbbaa; null clears it.

  • backgroundColorstring | null

    CSS hex: #rgb, #rrggbb or #rrggbbaa; null clears it.

  • mediastring | null

    A media of your organization (upload it first); null removes it.

  • titlestringrequired

    The title.

Returns

The announcement, as stored.

  • objectannouncement

    Always announcement.

  • idstring

    The announcement id.

  • titlestring

    The title.

  • descriptionstring | null

    The text.

  • textColorstring | null

    The text colour, CSS hex.

  • backgroundColorstring | null

    The banner colour, CSS hex.

  • mediaobject | null

    The media it shows.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

POST /v1/masjid/announcements
curl -X POST "https://hub.masjidbox.com/v1/masjid/announcements" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"backgroundColor":"#0f172a","title":"Iftar tonight"}'
Example request · MasjidAnnouncementCreate
{
  "backgroundColor": "#0f172a",
  "title": "Iftar tonight"
}
201 · MasjidAnnouncement
{
  "backgroundColor": "#0f172a",
  "createdAt": "2026-11-12T08:00:00.000Z",
  "description": "Doors open at 17:30.",
  "id": "ann_6af5c9e2bc095fbd2dc5735e",
  "media": null,
  "object": "announcement",
  "textColor": "#ffffff",
  "title": "Iftar tonight",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Change an announcement

Masjid key · secret · Content: edit

PATCH/v1/masjid/announcements/{id}

JSON Merge Patch: a field you leave out stays, null clears it. A media must be one of your organization's (med_ id), else 400. Needs a secret key with Content: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

  • idstring · pathrequired

    The announcement id.

Request body

  • descriptionstring | null

    The text.

  • textColorstring | null

    CSS hex: #rgb, #rrggbb or #rrggbbaa; null clears it.

  • backgroundColorstring | null

    CSS hex: #rgb, #rrggbb or #rrggbbaa; null clears it.

  • mediastring | null

    A media of your organization (upload it first); null removes it.

  • titlestring

    The title.

Returns

The announcement after the change.

  • objectannouncement

    Always announcement.

  • idstring

    The announcement id.

  • titlestring

    The title.

  • descriptionstring | null

    The text.

  • textColorstring | null

    The text colour, CSS hex.

  • backgroundColorstring | null

    The banner colour, CSS hex.

  • mediaobject | null

    The media it shows.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/announcements/{id}
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/announcements/ann_6af5c9e2bc095fbd2dc5735e" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Iftar at 18:02"}'
Example request · MasjidAnnouncementPatch
{
  "title": "Iftar at 18:02"
}
200 · MasjidAnnouncement
{
  "backgroundColor": "#0f172a",
  "createdAt": "2026-11-12T08:00:00.000Z",
  "description": "Doors open at 17:30.",
  "id": "ann_6af5c9e2bc095fbd2dc5735e",
  "media": null,
  "object": "announcement",
  "textColor": "#ffffff",
  "title": "Iftar tonight",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Delete an announcement

Masjid key · secret · Content: edit

DELETE/v1/masjid/announcements/{id}

Deletes an announcement everywhere it shows. Needs a secret key with Content: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

  • idstring · pathrequired

    The announcement id.

Returns

Deleted. No body.

204 · No response body.

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