Your masjid · Content

Your albums

Photo and video albums: a cover and your media, in order.

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

Your albums

Masjid key · Content: read

GET/v1/masjid/albums

Your organization's photo and video albums, 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 albums.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (14)
    • objectalbum

      Always album.

    • idstring

      The album id.

    • titlestring

      The title.

    • coverobject | null

      The cover media.

    • cover.idstring

      The media id.

    • cover.typestring | null

      picture, video or document.

    • cover.urlstring | null

      The URL to show it from.

    • mediasobject[]

      The media of the album, in order.

    • medias[].idstring

      The media id.

    • medias[].typestring | null

      picture, video or document.

    • medias[].urlstring | null

      The URL to show it from.

    • enabledboolean | null

      Whether the album is shown.

    • 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/albums
curl "https://hub.masjidbox.com/v1/masjid/albums" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidAlbumsPage
{
  "data": [
    {
      "cover": {
        "id": "med_6af5c9e2bc095fbd2dc5735f",
        "type": "picture",
        "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
      },
      "createdAt": "2026-11-12T08:00:00.000Z",
      "enabled": true,
      "id": "alb_6af5c9e2bc095fbd2dc57362",
      "medias": [
        {
          "id": "med_6af5c9e2bc095fbd2dc5735f",
          "type": "picture",
          "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
        }
      ],
      "object": "album",
      "title": "Eid 2026",
      "updatedAt": "2026-11-12T08:00:00.000Z"
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your albums

Masjid key · Content: read

GET/v1/masjid/albums/{id}

An album of your organization: its cover and its media, in order. Needs Content: read.

Parameters

  • idstring · pathrequired

    The album id.

Returns

The album.

  • objectalbum

    Always album.

  • idstring

    The album id.

  • titlestring

    The title.

  • coverobject | null

    The cover media.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • mediasobject[]

    The media of the album, in order.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • enabledboolean | null

    Whether the album is shown.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/albums/{id}
curl "https://hub.masjidbox.com/v1/masjid/albums/alb_6af5c9e2bc095fbd2dc57362" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidAlbum
{
  "cover": {
    "id": "med_6af5c9e2bc095fbd2dc5735f",
    "type": "picture",
    "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
  },
  "createdAt": "2026-11-12T08:00:00.000Z",
  "enabled": true,
  "id": "alb_6af5c9e2bc095fbd2dc57362",
  "medias": [
    {
      "id": "med_6af5c9e2bc095fbd2dc5735f",
      "type": "picture",
      "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
    }
  ],
  "object": "album",
  "title": "Eid 2026",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Create an album

Masjid key · secret · Content: edit

POST/v1/masjid/albums

Creates an album: a title, a cover and media of your organization (med_ ids, in order; upload them first). Any cover or medias entry 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

  • coverstring | null

    A media of your organization as the cover; null removes it.

  • mediasstring[]

    Media of your organization (med_ ids), in order: the list replaces the album's.

  • enabledboolean

    Whether the album is shown.

  • titlestringrequired

    The title.

Returns

The album, as stored.

  • objectalbum

    Always album.

  • idstring

    The album id.

  • titlestring

    The title.

  • coverobject | null

    The cover media.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • mediasobject[]

    The media of the album, in order.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • enabledboolean | null

    Whether the album is shown.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

POST /v1/masjid/albums
curl -X POST "https://hub.masjidbox.com/v1/masjid/albums" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"medias":["med_6af5c9e2bc095fbd2dc5735f"],"title":"Eid 2026"}'
Example request · MasjidAlbumCreate
{
  "medias": [
    "med_6af5c9e2bc095fbd2dc5735f"
  ],
  "title": "Eid 2026"
}
201 · MasjidAlbum
{
  "cover": {
    "id": "med_6af5c9e2bc095fbd2dc5735f",
    "type": "picture",
    "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
  },
  "createdAt": "2026-11-12T08:00:00.000Z",
  "enabled": true,
  "id": "alb_6af5c9e2bc095fbd2dc57362",
  "medias": [
    {
      "id": "med_6af5c9e2bc095fbd2dc5735f",
      "type": "picture",
      "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
    }
  ],
  "object": "album",
  "title": "Eid 2026",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Change an album

Masjid key · secret · Content: edit

PATCH/v1/masjid/albums/{id}

JSON Merge Patch: a field you leave out stays, null clears it. medias replaces the album's list whole. A cover or a medias entry 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 album id.

Request body

  • coverstring | null

    A media of your organization as the cover; null removes it.

  • mediasstring[]

    Media of your organization (med_ ids), in order: the list replaces the album's.

  • enabledboolean

    Whether the album is shown.

  • titlestring

    The title.

Returns

The album after the change.

  • objectalbum

    Always album.

  • idstring

    The album id.

  • titlestring

    The title.

  • coverobject | null

    The cover media.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • mediasobject[]

    The media of the album, in order.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • enabledboolean | null

    Whether the album is shown.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/albums/{id}
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/albums/alb_6af5c9e2bc095fbd2dc57362" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":false}'
Example request · MasjidAlbumPatch
{
  "enabled": false
}
200 · MasjidAlbum
{
  "cover": {
    "id": "med_6af5c9e2bc095fbd2dc5735f",
    "type": "picture",
    "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
  },
  "createdAt": "2026-11-12T08:00:00.000Z",
  "enabled": true,
  "id": "alb_6af5c9e2bc095fbd2dc57362",
  "medias": [
    {
      "id": "med_6af5c9e2bc095fbd2dc5735f",
      "type": "picture",
      "url": "https://cdn.masjidbox.com/content/pictures/a.webp"
    }
  ],
  "object": "album",
  "title": "Eid 2026",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Delete an album

Masjid key · secret · Content: edit

DELETE/v1/masjid/albums/{id}

Deletes an album. Its media stay in your library. 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 album id.

Returns

Deleted. No body.

204 · No response body.

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