Your masjid · Content

Your collections

Titled sets of your news or your events, in order.

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

Your collections

Masjid key · Content: read

GET/v1/masjid/collections

Your organization's collections, titled sets of its news or events, 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 collections.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (16)
    • objectcollection

      Always collection.

    • idstring

      The collection id.

    • titlestring

      The title.

    • typeevents | news | null

      What it gathers: news or events.

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

    • newsobject[]

      The news it holds, in order.

    • news[].idstring

      The news item id.

    • news[].titlestring | null

      Its title.

    • eventsobject[]

      The events it holds, in order.

    • events[].idstring

      The event id.

    • events[].titlestring | null

      Its title.

    • 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/collections
curl "https://hub.masjidbox.com/v1/masjid/collections" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidCollectionsPage
{
  "data": [
    {
      "createdAt": "2026-11-12T08:00:00.000Z",
      "events": [],
      "id": "col_6af5c9e2bc095fbd2dc57363",
      "media": null,
      "news": [
        {
          "id": "nws_6af5c9e2bc095fbd2dc57361",
          "title": "The new wing opens"
        }
      ],
      "object": "collection",
      "title": "Ramadan 2027",
      "type": "news",
      "updatedAt": "2026-11-12T08:00:00.000Z"
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your collections

Masjid key · Content: read

GET/v1/masjid/collections/{id}

A collection of your organization: the news (nws_) or events (evt_) it holds, in order, each with its title. Needs Content: read.

Parameters

  • idstring · pathrequired

    The collection id.

Returns

The collection.

  • objectcollection

    Always collection.

  • idstring

    The collection id.

  • titlestring

    The title.

  • typeevents | news | null

    What it gathers: news or events.

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

  • newsobject[]

    The news it holds, in order.

    Show child attributes (2)
    • idstring

      The news item id.

    • titlestring | null

      Its title.

  • eventsobject[]

    The events it holds, in order.

    Show child attributes (2)
    • idstring

      The event id.

    • titlestring | null

      Its title.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/collections/{id}
curl "https://hub.masjidbox.com/v1/masjid/collections/col_6af5c9e2bc095fbd2dc57363" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidCollection
{
  "createdAt": "2026-11-12T08:00:00.000Z",
  "events": [],
  "id": "col_6af5c9e2bc095fbd2dc57363",
  "media": null,
  "news": [
    {
      "id": "nws_6af5c9e2bc095fbd2dc57361",
      "title": "The new wing opens"
    }
  ],
  "object": "collection",
  "title": "Ramadan 2027",
  "type": "news",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Create a collection

Masjid key · secret · Content: edit

POST/v1/masjid/collections

Creates a collection of your news (news, nws_ ids) or events (events, evt_ ids), in order. A media, news item or event that is not your organization's is a 400. 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

  • typeevents | news | null

    What it gathers: news or events.

  • mediastring | null

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

  • newsstring[]

    News of your organization (nws_ ids), in order: the list replaces the stored one.

  • eventsstring[]

    Events of your organization (evt_ ids), in order: the list replaces the stored one.

  • titlestringrequired

    The title.

Returns

The collection, as stored.

  • objectcollection

    Always collection.

  • idstring

    The collection id.

  • titlestring

    The title.

  • typeevents | news | null

    What it gathers: news or events.

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

  • newsobject[]

    The news it holds, in order.

    Show child attributes (2)
    • idstring

      The news item id.

    • titlestring | null

      Its title.

  • eventsobject[]

    The events it holds, in order.

    Show child attributes (2)
    • idstring

      The event id.

    • titlestring | null

      Its title.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

POST /v1/masjid/collections
curl -X POST "https://hub.masjidbox.com/v1/masjid/collections" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"news":["nws_6af5c9e2bc095fbd2dc57361"],"title":"Ramadan 2027","type":"news"}'
Example request · MasjidCollectionCreate
{
  "news": [
    "nws_6af5c9e2bc095fbd2dc57361"
  ],
  "title": "Ramadan 2027",
  "type": "news"
}
201 · MasjidCollection
{
  "createdAt": "2026-11-12T08:00:00.000Z",
  "events": [],
  "id": "col_6af5c9e2bc095fbd2dc57363",
  "media": null,
  "news": [
    {
      "id": "nws_6af5c9e2bc095fbd2dc57361",
      "title": "The new wing opens"
    }
  ],
  "object": "collection",
  "title": "Ramadan 2027",
  "type": "news",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Change a collection

Masjid key · secret · Content: edit

PATCH/v1/masjid/collections/{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. news and events replace their list whole. A media, news item or event that is not your organization's is a 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 collection id.

Request body

  • typeevents | news | null

    What it gathers: news or events.

  • mediastring | null

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

  • newsstring[]

    News of your organization (nws_ ids), in order: the list replaces the stored one.

  • eventsstring[]

    Events of your organization (evt_ ids), in order: the list replaces the stored one.

  • titlestring

    The title.

Returns

The collection after the change.

  • objectcollection

    Always collection.

  • idstring

    The collection id.

  • titlestring

    The title.

  • typeevents | news | null

    What it gathers: news or events.

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

  • newsobject[]

    The news it holds, in order.

    Show child attributes (2)
    • idstring

      The news item id.

    • titlestring | null

      Its title.

  • eventsobject[]

    The events it holds, in order.

    Show child attributes (2)
    • idstring

      The event id.

    • titlestring | null

      Its title.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/collections/{id}
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/collections/col_6af5c9e2bc095fbd2dc57363" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"news":["nws_6af5c9e2bc095fbd2dc57361"]}'
Example request · MasjidCollectionPatch
{
  "news": [
    "nws_6af5c9e2bc095fbd2dc57361"
  ]
}
200 · MasjidCollection
{
  "createdAt": "2026-11-12T08:00:00.000Z",
  "events": [],
  "id": "col_6af5c9e2bc095fbd2dc57363",
  "media": null,
  "news": [
    {
      "id": "nws_6af5c9e2bc095fbd2dc57361",
      "title": "The new wing opens"
    }
  ],
  "object": "collection",
  "title": "Ramadan 2027",
  "type": "news",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Delete a collection

Masjid key · secret · Content: edit

DELETE/v1/masjid/collections/{id}

Deletes a collection. Its news and events stay. 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 collection id.

Returns

Deleted. No body.

204 · No response body.

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