Your masjid · Website and app
Your website widgets
The widgets your website embeds, the prayer times or a donation campaign, each under the public key of its embed snippet.
Right on the key: Website and app: read for a read, edit (secret key) for a write.
Your widgets
GET/v1/masjid/widgets
The widgets your website embeds (prayer times, a donation campaign), newest first, by cursor (limit 1 to 100, 25 by default; cursor from the previous page). Needs Website and app: 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 widgets.
objectlistAlways
list.dataobject[]The items of this page.
Show child attributes (16)
objectwidgetAlways
widget.idstringThe widget id.
keystringThe public key its embed snippet carries.
typeprayer-times | prayer-times-small | donations-campaignWhat it shows: the prayer times (full or compact), or a donation campaign.
titlestring | nullIts title.
enabledbooleanFalse when it is switched off.
colorstring | nullMain colour, a CSS colour.
labelColorstring | nullColour of the labels, a CSS colour.
languagestring | nullLanguage of its texts (ISO 639-1).
layoutstring | nullThe layout it renders with.
optionsobjectDisplay options, by name: a switch or a text.
translationsobjectTexts overridden, by translation key.
websitestring[]The websites it may be embedded on.
campaignstring | nullThe donation campaign it shows.
createdAtstring | nullWhen it was created (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/widgets" \
-H "Authorization: Bearer $MASJIDBOX_KEY"{
"data": [
{
"campaign": null,
"color": "#0f766e",
"createdAt": "2026-12-01T10:00:00.000Z",
"enabled": true,
"id": "wdg_6af5c9e2bc095fbd2dc5735a",
"key": "example-widget-key",
"labelColor": "#ffffff",
"language": "en",
"layout": "horizontal",
"object": "widget",
"options": {
"showIqamah": true
},
"title": "Prayer times",
"translations": {
"WIDGET_PRY_IQAMAH": "Jamaat"
},
"type": "prayer-times",
"updatedAt": "2026-12-01T10:00:00.000Z",
"website": [
"mosque.example.org"
]
}
],
"object": "list",
"pagination": {
"hasMore": false,
"limit": 25,
"nextCursor": null
}
}One of your widgets
GET/v1/masjid/widgets/{id}
A widget of your organization, with the public key its embed snippet carries. Needs Website and app: read.
Parameters
idstring · pathrequiredThe widget id.
Returns
The widget.
objectwidgetAlways
widget.idstringThe widget id.
keystringThe public key its embed snippet carries.
typeprayer-times | prayer-times-small | donations-campaignWhat it shows: the prayer times (full or compact), or a donation campaign.
titlestring | nullIts title.
enabledbooleanFalse when it is switched off.
colorstring | nullMain colour, a CSS colour.
labelColorstring | nullColour of the labels, a CSS colour.
languagestring | nullLanguage of its texts (ISO 639-1).
layoutstring | nullThe layout it renders with.
optionsobjectDisplay options, by name: a switch or a text.
translationsobjectTexts overridden, by translation key.
websitestring[]The websites it may be embedded on.
campaignstring | nullThe donation campaign it shows.
createdAtstring | nullWhen it was created (ISO-8601).
updatedAtstring | nullWhen it last changed (ISO-8601).
Errors
curl "https://hub.masjidbox.com/v1/masjid/widgets/wdg_6af5c9e2bc095fbd2dc5735a" \
-H "Authorization: Bearer $MASJIDBOX_KEY"{
"campaign": null,
"color": "#0f766e",
"createdAt": "2026-12-01T10:00:00.000Z",
"enabled": true,
"id": "wdg_6af5c9e2bc095fbd2dc5735a",
"key": "example-widget-key",
"labelColor": "#ffffff",
"language": "en",
"layout": "horizontal",
"object": "widget",
"options": {
"showIqamah": true
},
"title": "Prayer times",
"translations": {
"WIDGET_PRY_IQAMAH": "Jamaat"
},
"type": "prayer-times",
"updatedAt": "2026-12-01T10:00:00.000Z",
"website": [
"mosque.example.org"
]
}Create a widget
POST/v1/masjid/widgets
Creates a widget as the dashboard does: enabled, under a fresh public key for its embed snippet, its options checked against its type. A campaign must be one of your donation campaigns (cmp_ id), else 400. Needs a secret key with Website and app: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.
Parameters
No parameters.
Request body
typeprayer-times | prayer-times-small | donations-campaignrequiredWhat it shows.
titlestringIts title.
colorstringMain colour, a CSS colour.
labelColorstringColour of the labels.
languagestringLanguage of its texts (ISO 639-1).
layoutstringThe layout it renders with.
optionsobjectDisplay options, checked against its type:
prayer-timestakesshowJumuah,showIqamah,highlightIqamah,showName,showCountdown,showDate;prayer-times-smalltakesshowIqamah,showJumuah,highlightIqamah;donations-campaigntakesshowProgress,showTitle,showDescription,showRecapand the textoverwriteDescription. Another option is a 400.translationsobjectTexts overridden, by translation key.
websitestring[]The websites it may be embedded on, up to 50.
campaignstringOne of your donation campaigns (
cmp_); another organization’s is a 400.
Returns
The widget, as stored.
objectwidgetAlways
widget.idstringThe widget id.
keystringThe public key its embed snippet carries.
typeprayer-times | prayer-times-small | donations-campaignWhat it shows: the prayer times (full or compact), or a donation campaign.
titlestring | nullIts title.
enabledbooleanFalse when it is switched off.
colorstring | nullMain colour, a CSS colour.
labelColorstring | nullColour of the labels, a CSS colour.
languagestring | nullLanguage of its texts (ISO 639-1).
layoutstring | nullThe layout it renders with.
optionsobjectDisplay options, by name: a switch or a text.
translationsobjectTexts overridden, by translation key.
websitestring[]The websites it may be embedded on.
campaignstring | nullThe donation campaign it shows.
createdAtstring | nullWhen it was created (ISO-8601).
updatedAtstring | nullWhen it last changed (ISO-8601).
Errors
curl -X POST "https://hub.masjidbox.com/v1/masjid/widgets" \
-H "Authorization: Bearer $MASJIDBOX_KEY" \
-H "Content-Type: application/json" \
-d '{"title":"Prayer times","type":"prayer-times"}'{
"title": "Prayer times",
"type": "prayer-times"
}{
"campaign": null,
"color": "#0f766e",
"createdAt": "2026-12-01T10:00:00.000Z",
"enabled": true,
"id": "wdg_6af5c9e2bc095fbd2dc5735a",
"key": "example-widget-key",
"labelColor": "#ffffff",
"language": "en",
"layout": "horizontal",
"object": "widget",
"options": {
"showIqamah": true
},
"title": "Prayer times",
"translations": {
"WIDGET_PRY_IQAMAH": "Jamaat"
},
"type": "prayer-times",
"updatedAt": "2026-12-01T10:00:00.000Z",
"website": [
"mosque.example.org"
]
}Change a widget
PATCH/v1/masjid/widgets/{id}
A merge: a field you leave out stays. The options are checked against the type the widget will have; a new campaign must be one of yours (cmp_ id), else 400. Every website embedding it shows the change. Needs a secret key with Website and app: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.
Parameters
idstring · pathrequiredThe widget id.
Request body
typeprayer-times | prayer-times-small | donations-campaignWhat it shows.
enabledbooleanfalseswitches it off.titlestringIts title.
colorstringMain colour, a CSS colour.
labelColorstringColour of the labels.
languagestringLanguage of its texts (ISO 639-1).
layoutstringThe layout it renders with.
optionsobjectDisplay options, checked against its type:
prayer-timestakesshowJumuah,showIqamah,highlightIqamah,showName,showCountdown,showDate;prayer-times-smalltakesshowIqamah,showJumuah,highlightIqamah;donations-campaigntakesshowProgress,showTitle,showDescription,showRecapand the textoverwriteDescription. Another option is a 400.translationsobjectTexts overridden, by translation key.
websitestring[]The websites it may be embedded on, up to 50.
campaignstringOne of your donation campaigns (
cmp_); another organization’s is a 400.
Returns
The widget after the change.
objectwidgetAlways
widget.idstringThe widget id.
keystringThe public key its embed snippet carries.
typeprayer-times | prayer-times-small | donations-campaignWhat it shows: the prayer times (full or compact), or a donation campaign.
titlestring | nullIts title.
enabledbooleanFalse when it is switched off.
colorstring | nullMain colour, a CSS colour.
labelColorstring | nullColour of the labels, a CSS colour.
languagestring | nullLanguage of its texts (ISO 639-1).
layoutstring | nullThe layout it renders with.
optionsobjectDisplay options, by name: a switch or a text.
translationsobjectTexts overridden, by translation key.
websitestring[]The websites it may be embedded on.
campaignstring | nullThe donation campaign it shows.
createdAtstring | nullWhen it was created (ISO-8601).
updatedAtstring | nullWhen it last changed (ISO-8601).
Errors
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/widgets/wdg_6af5c9e2bc095fbd2dc5735a" \
-H "Authorization: Bearer $MASJIDBOX_KEY" \
-H "Content-Type: application/json" \
-d '{"enabled":false}'{
"enabled": false
}{
"campaign": null,
"color": "#0f766e",
"createdAt": "2026-12-01T10:00:00.000Z",
"enabled": true,
"id": "wdg_6af5c9e2bc095fbd2dc5735a",
"key": "example-widget-key",
"labelColor": "#ffffff",
"language": "en",
"layout": "horizontal",
"object": "widget",
"options": {
"showIqamah": true
},
"title": "Prayer times",
"translations": {
"WIDGET_PRY_IQAMAH": "Jamaat"
},
"type": "prayer-times",
"updatedAt": "2026-12-01T10:00:00.000Z",
"website": [
"mosque.example.org"
]
}Delete a widget
DELETE/v1/masjid/widgets/{id}
Deletes a widget and its view counters: every website embedding it stops showing it. Needs a secret key with Website and app: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.
Parameters
idstring · pathrequiredThe widget id.
Returns
Deleted. No body.
204 · No response body.
Errors
curl -X DELETE "https://hub.masjidbox.com/v1/masjid/widgets/wdg_6af5c9e2bc095fbd2dc5735a" \
-H "Authorization: Bearer $MASJIDBOX_KEY"