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
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 · queryItems per page, 1 to 100.
cursorstring · queryThe previous page's
pagination.nextCursor; absent for the first page.
Returns
A page of media.
objectlistAlways
list.dataobject[]The items of this page.
Show child attributes (12)
objectmediaAlways
media.idstringThe media id.
typestring | nullpicture,videoordocument.titlestring | nullThe title.
urlstring | nullThe URL to show it from: the web rendition of a picture, else the file itself.
sizenumber | nullThe file size, in bytes.
widthnumber | nullPixels, for a picture or a video.
heightnumber | nullPixels, for a picture or a video.
durationnumber | nullSeconds, for a video.
processingbooleanA video still encoding: its HD rendition comes within minutes.
createdAtstring | nullWhen it was uploaded (ISO-8601).
updatedAtstring | nullWhen it last changed (ISO-8601).
paginationobjectWhere this page stands.
Show child attributes (3)
limitintegerThe page size asked for.
hasMorebooleanWhether another page follows: stop on false, never on a short page.
nextCursorstring | nullThe
cursorof the next page; null on the last one.
Errors
curl "https://hub.masjidbox.com/v1/masjid/media" \
-H "Authorization: Bearer $MASJIDBOX_KEY"{
"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
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 · pathrequiredThe media id.
Returns
The media.
objectmediaAlways
media.idstringThe media id.
typestring | nullpicture,videoordocument.titlestring | nullThe title.
urlstring | nullThe URL to show it from: the web rendition of a picture, else the file itself.
sizenumber | nullThe file size, in bytes.
widthnumber | nullPixels, for a picture or a video.
heightnumber | nullPixels, for a picture or a video.
durationnumber | nullSeconds, for a video.
processingbooleanA video still encoding: its HD rendition comes within minutes.
createdAtstring | nullWhen it was uploaded (ISO-8601).
updatedAtstring | nullWhen it last changed (ISO-8601).
Errors
curl "https://hub.masjidbox.com/v1/masjid/media/med_6af5c9e2bc095fbd2dc5735f" \
-H "Authorization: Bearer $MASJIDBOX_KEY"{
"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
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
contentTypestringrequiredThe 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) orapplication/pdf(documents, up to 50 MB).sizeintegerrequiredThe exact file size, in bytes.
Returns
Where to PUT the file.
objectuploadAlways
upload.idstringThe upload id, to confirm it with.
kindpicture | video | documentWhat it becomes.
methodPUTAlways
PUT.urlstringWhere to PUT the file, as is.
headersobjectThe headers the PUT must carry, exactly: the signature covers them.
expiresAtstringUntil when the URL takes the file (ISO-8601): 15 minutes.
Errors
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}'{
"contentType": "image/png",
"size": 482113
}{
"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
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 · pathrequiredThe media id.
Returns
Deleted. No body.
204 · No response body.
Errors
curl -X DELETE "https://hub.masjidbox.com/v1/masjid/media/med_6af5c9e2bc095fbd2dc5735f" \
-H "Authorization: Bearer $MASJIDBOX_KEY"Confirm an upload
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 · pathrequiredThe upload id.
Returns
The new media.
objectmediaAlways
media.idstringThe media id.
typestring | nullpicture,videoordocument.titlestring | nullThe title.
urlstring | nullThe URL to show it from: the web rendition of a picture, else the file itself.
sizenumber | nullThe file size, in bytes.
widthnumber | nullPixels, for a picture or a video.
heightnumber | nullPixels, for a picture or a video.
durationnumber | nullSeconds, for a video.
processingbooleanA video still encoding: its HD rendition comes within minutes.
createdAtstring | nullWhen it was uploaded (ISO-8601).
updatedAtstring | nullWhen it last changed (ISO-8601).
Errors
curl -X POST "https://hub.masjidbox.com/v1/masjid/media/uploads/upl_a1b2c3d4e5f6g7h8i9j0k1l2/complete" \
-H "Authorization: Bearer $MASJIDBOX_KEY"{
"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
}