Your masjid · Content

Your media

The pictures, videos and documents of your organization, the ones your events and announcements show.

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

Your media

Masjid key · Content: read

GET/v1/masjid/media

Your organization's pictures, videos and documents, 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 media.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (12)
    • objectmedia

      Always media.

    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • titlestring | null

      The title.

    • urlstring | null

      The URL to show it from: the web rendition of a picture, else the file itself.

    • sizenumber | null

      The file size, in bytes.

    • widthnumber | null

      Pixels, for a picture or a video.

    • heightnumber | null

      Pixels, for a picture or a video.

    • durationnumber | null

      Seconds, for a video.

    • processingboolean

      A video still encoding: its HD rendition comes within minutes.

    • createdAtstring | null

      When it was uploaded (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/media
curl "https://hub.masjidbox.com/v1/masjid/media" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidMediaPage
{
  "data": [
    {
      "createdAt": "2026-11-12T08:00:00.000Z",
      "duration": null,
      "height": 1080,
      "id": "med_6af5c9e2bc095fbd2dc5735f",
      "object": "media",
      "processing": false,
      "size": 482113,
      "title": null,
      "type": "picture",
      "updatedAt": "2026-11-12T08:00:00.000Z",
      "url": "https://cdn.masjidbox.com/content/pictures/a.webp",
      "width": 1920
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your media

Masjid key · Content: read

GET/v1/masjid/media/{id}

A picture, video or document of your organization. A video shows processing until its HD rendition is encoded. Needs Content: read.

Parameters

  • idstring · pathrequired

    The media id.

Returns

The media.

  • objectmedia

    Always media.

  • idstring

    The media id.

  • typestring | null

    picture, video or document.

  • titlestring | null

    The title.

  • urlstring | null

    The URL to show it from: the web rendition of a picture, else the file itself.

  • sizenumber | null

    The file size, in bytes.

  • widthnumber | null

    Pixels, for a picture or a video.

  • heightnumber | null

    Pixels, for a picture or a video.

  • durationnumber | null

    Seconds, for a video.

  • processingboolean

    A video still encoding: its HD rendition comes within minutes.

  • createdAtstring | null

    When it was uploaded (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/media/{id}
curl "https://hub.masjidbox.com/v1/masjid/media/med_6af5c9e2bc095fbd2dc5735f" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidMedia
{
  "createdAt": "2026-11-12T08:00:00.000Z",
  "duration": null,
  "height": 1080,
  "id": "med_6af5c9e2bc095fbd2dc5735f",
  "object": "media",
  "processing": false,
  "size": 482113,
  "title": null,
  "type": "picture",
  "updatedAt": "2026-11-12T08:00:00.000Z",
  "url": "https://cdn.masjidbox.com/content/pictures/a.webp",
  "width": 1920
}

Start an upload

Masjid key · secret · Content: edit

POST/v1/masjid/media/uploads

Step 1 of 2. Declares a file (its type and exact size) and answers a URL to PUT it to, as is, with the headers given, within 15 minutes. Types: image/jpeg, image/png, image/webp, image/gif (pictures, up to 25 MB), video/mp4, video/quicktime, video/webm (videos, up to 1000 MB) or application/pdf (documents, up to 50 MB); anything else, or larger, 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

  • contentTypestringrequired

    The file's type: image/jpeg, image/png, image/webp, image/gif (pictures, up to 25 MB), video/mp4, video/quicktime, video/webm (videos, up to 1000 MB) or application/pdf (documents, up to 50 MB).

  • sizeintegerrequired

    The exact file size, in bytes.

Returns

Where to PUT the file.

  • objectupload

    Always upload.

  • idstring

    The upload id, to confirm it with.

  • kindpicture | video | document

    What it becomes.

  • methodPUT

    Always PUT.

  • urlstring

    Where to PUT the file, as is.

  • headersobject

    The headers the PUT must carry, exactly: the signature covers them.

  • expiresAtstring

    Until when the URL takes the file (ISO-8601): 15 minutes.

POST /v1/masjid/media/uploads
curl -X POST "https://hub.masjidbox.com/v1/masjid/media/uploads" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contentType":"image/png","size":482113}'
Example request · MasjidUploadCreate
{
  "contentType": "image/png",
  "size": 482113
}
201 · MasjidUpload
{
  "expiresAt": "2026-11-12T08:15:00.000Z",
  "headers": {
    "Content-Length": "482113",
    "Content-Type": "image/png"
  },
  "id": "upl_a1b2c3d4e5f6g7h8i9j0k1l2",
  "kind": "picture",
  "method": "PUT",
  "object": "upload",
  "url": "https://storage.example/content/uploads/…?X-Amz-Signature=…"
}

Delete a media

Masjid key · secret · Content: edit

DELETE/v1/masjid/media/{id}

Deletes a media and its files, and takes it off your albums. 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 media id.

Returns

Deleted. No body.

204 · No response body.

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

Confirm an upload

Masjid key · secret · Content: edit

POST/v1/masjid/media/uploads/{id}/complete

Step 2 of 2, once the PUT succeeded. Masjidbox processes the file and answers the new media; use its med_ id on an event or an announcement. 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 upload id.

Returns

The new media.

  • objectmedia

    Always media.

  • idstring

    The media id.

  • typestring | null

    picture, video or document.

  • titlestring | null

    The title.

  • urlstring | null

    The URL to show it from: the web rendition of a picture, else the file itself.

  • sizenumber | null

    The file size, in bytes.

  • widthnumber | null

    Pixels, for a picture or a video.

  • heightnumber | null

    Pixels, for a picture or a video.

  • durationnumber | null

    Seconds, for a video.

  • processingboolean

    A video still encoding: its HD rendition comes within minutes.

  • createdAtstring | null

    When it was uploaded (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

POST /v1/masjid/media/uploads/{id}/complete
curl -X POST "https://hub.masjidbox.com/v1/masjid/media/uploads/upl_a1b2c3d4e5f6g7h8i9j0k1l2/complete" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidMedia
{
  "createdAt": "2026-11-12T08:00:00.000Z",
  "duration": null,
  "height": 1080,
  "id": "med_6af5c9e2bc095fbd2dc5735f",
  "object": "media",
  "processing": false,
  "size": 482113,
  "title": null,
  "type": "picture",
  "updatedAt": "2026-11-12T08:00:00.000Z",
  "url": "https://cdn.masjidbox.com/content/pictures/a.webp",
  "width": 1920
}