API reference

Both APIs on one page: the public data of every masjid, for a developer key, and your own masjid's, for its own key. Generated from the OpenAPI documents the API is built from.

The Masjidbox API answers JSON over HTTPS, at resource-oriented URLs, with standard HTTP status codes. One base URL for everyone: the key you send decides what you reach.

Every example uses curl: there is no SDK to install yet.

Base URL
https://hub.masjidbox.com

Authentication

Every call carries a key in the Authorization: Bearer header. Two kinds of key reach the same API.

Kinds of key
KeyWhere you get itWhat it reaches
Developer keyThe developer console, once your project is approvedEvery published masjid, without changing it (/v1/masjids/…), this project's contribution totals, referral links and masjid suggestions
Masjid keyYour Masjidbox dashboard, under API → KeysYour organization: /v1/masjid/…, with a right per product (none, read, edit). Never the public API, not even for your own masjid.

Both come as publishable (mbx_pk_live_…, made to embed in an app or other code you ship, never changes a masjid's data) or secret (mbx_sk_live_…, a server only). There are no test keys: every key reads the live data.

A developer key on /v1/masjid/… is refused with INSUFFICIENT_SCOPE, and so is a masjid key on /v1/masjids/….

Read the guide
Authenticated request
curl "https://hub.masjidbox.com/v1/masjids/msj_abc123defg" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"

Errors

A refusal answers an RFC 9457 problem: type links to the code's page, code is stable, requestId finds the call in your log.

Example · 404
{
  "type": "https://hub.masjidbox.com/docs/errors/MASJID_NOT_FOUND",
  "title": "Masjid not found",
  "status": 404,
  "detail": "No published masjid has this id.",
  "instance": "/v1/masjids/msj_abc123defg",
  "code": "MASJID_NOT_FOUND",
  "requestId": "req_8f14e45fceea167a5a36dedd4bea2543",
  "requestLogUrl": "https://hub.masjidbox.com/console/logs/req_8f14e45fceea167a5a36dedd4bea2543"
}

Request ids

Every answer, served or refused, carries a request id, req_ and 32 hexadecimal characters, in the Masjidbox-Request-Id header and in the requestId of every error body. Quote it when you ask for help, never your key.

Read the guide
Response header
Masjidbox-Request-Id: req_8f14e45fceea167a5a36dedd4bea2543

Limits

Limits are counted per developer project, or per masjid organization, all its keys together.

Developer project
Requests, per project3,600 / hour
Distinct masjids, per project300 / day
Burst, per key600 / minute
Masjid organization
Reads3,600 / hour
Writes30 / hour and 300 / day

A reached limit answers 429 with a Retry-After header, in seconds: wait for it before you call again.

429 answer
HTTP/1.1 429 Too Many Requests
Retry-After: 42

Versioning & changelog

The version is in the path: /v1/…. Additive changes (a new field, a new operation) can land inside V1; a breaking change would be a new version.

Read the guide
Current version
v1