Your masjid · Content

Your quizzes

Your quizzes and their results, counted per answer. Never a play: a play carries the player's name and email.

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

Your quizzes

Masjid key · Content: read

GET/v1/masjid/quizzes

Your organization's quizzes, each with its results: how many times it was played and how many plays picked each answer: aggregates only, 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 quizzes.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (23)
    • objectquiz

      Always quiz.

    • idstring

      The quiz id.

    • titlestring | null

      The title.

    • descriptionstring | null

      The description.

    • timenumber | null

      The time budget, in seconds.

    • levelnumber | null

      The difficulty level.

    • beginstring | null

      When it opens (ISO-8601).

    • endstring | null

      When it closes (ISO-8601).

    • questionsobject[]

      The questions, in order.

    • questions[].idstring | null

      The question id, to keep it on a change.

    • questions[].textstring | null

      Its wording.

    • questions[].answersobject[]

      Its answers, each counted.

    • questions[].answers[].idstring | null

      The answer id, to keep it on a change.

    • questions[].answers[].textstring | null

      Its label.

    • questions[].answers[].correctboolean | null

      Whether it is the correct one.

    • questions[].answers[].picksinteger

      The plays that picked it.

    • playersinteger

      How many times it was played.

    • mediaobject | null

      The media it shows.

    • media.idstring

      The media id.

    • media.typestring | null

      picture, video or document.

    • media.urlstring | null

      The URL to show it from.

    • 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/quizzes
curl "https://hub.masjidbox.com/v1/masjid/quizzes" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidQuizzesPage
{
  "data": [
    {
      "begin": "2026-12-01T00:00:00.000Z",
      "createdAt": "2026-11-12T08:00:00.000Z",
      "description": "Test your knowledge",
      "end": null,
      "id": "qiz_6af5c9e2bc095fbd2dc57366",
      "level": 1,
      "media": null,
      "object": "quiz",
      "players": 14,
      "questions": [
        {
          "answers": [
            {
              "correct": true,
              "id": "000000000000000000000082",
              "picks": 11,
              "text": "The 27th"
            },
            {
              "correct": false,
              "id": "000000000000000000000083",
              "picks": 3,
              "text": "The 15th"
            }
          ],
          "id": "000000000000000000000081",
          "text": "Which night is Laylat al-Qadr sought on most?"
        }
      ],
      "time": 300,
      "title": "Ramadan quiz",
      "updatedAt": "2026-11-12T08:00:00.000Z"
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your quizzes

Masjid key · Content: read

GET/v1/masjid/quizzes/{id}

A quiz of your organization, its questions and answers, and its results counted per answer. Needs Content: read.

Parameters

  • idstring · pathrequired

    The quiz id.

Returns

The quiz.

  • objectquiz

    Always quiz.

  • idstring

    The quiz id.

  • titlestring | null

    The title.

  • descriptionstring | null

    The description.

  • timenumber | null

    The time budget, in seconds.

  • levelnumber | null

    The difficulty level.

  • beginstring | null

    When it opens (ISO-8601).

  • endstring | null

    When it closes (ISO-8601).

  • questionsobject[]

    The questions, in order.

    Show child attributes (7)
    • idstring | null

      The question id, to keep it on a change.

    • textstring | null

      Its wording.

    • answersobject[]

      Its answers, each counted.

    • answers[].idstring | null

      The answer id, to keep it on a change.

    • answers[].textstring | null

      Its label.

    • answers[].correctboolean | null

      Whether it is the correct one.

    • answers[].picksinteger

      The plays that picked it.

  • playersinteger

    How many times it was played.

  • mediaobject | null

    The media it shows.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/quizzes/{id}
curl "https://hub.masjidbox.com/v1/masjid/quizzes/qiz_6af5c9e2bc095fbd2dc57366" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidQuiz
{
  "begin": "2026-12-01T00:00:00.000Z",
  "createdAt": "2026-11-12T08:00:00.000Z",
  "description": "Test your knowledge",
  "end": null,
  "id": "qiz_6af5c9e2bc095fbd2dc57366",
  "level": 1,
  "media": null,
  "object": "quiz",
  "players": 14,
  "questions": [
    {
      "answers": [
        {
          "correct": true,
          "id": "000000000000000000000082",
          "picks": 11,
          "text": "The 27th"
        },
        {
          "correct": false,
          "id": "000000000000000000000083",
          "picks": 3,
          "text": "The 15th"
        }
      ],
      "id": "000000000000000000000081",
      "text": "Which night is Laylat al-Qadr sought on most?"
    }
  ],
  "time": 300,
  "title": "Ramadan quiz",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Create a quiz

Masjid key · secret · Content: edit

POST/v1/masjid/quizzes

Creates a quiz: its questions, their answers (which are correct), its time budget, level and dates. Nothing can play through the API. 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

  • descriptionstring | null

    The description.

  • timeinteger | null

    The time budget, in seconds.

  • levelinteger | null

    The difficulty level.

  • beginstring | null

    When it opens (ISO-8601, with its offset).

  • endstring | null

    When it closes (ISO-8601, with its offset).

  • questionsobject[]

    The questions: the list replaces the quiz's.

    Show child attributes (6)
    • idstring

      A stored question's id, to keep it; absent, a new one.

    • textstringrequired

      Its wording.

    • answersobject[]required

      Its answers.

    • answers[].idstring

      A stored answer's id, to keep it; absent, a new one.

    • answers[].textstringrequired

      Its label.

    • answers[].correctbooleanrequired

      Whether it is the correct one.

  • mediastring | null

    A media of your organization (upload it first); null removes it.

  • titlestringrequired

    The title.

Returns

The quiz, as stored.

  • objectquiz

    Always quiz.

  • idstring

    The quiz id.

  • titlestring | null

    The title.

  • descriptionstring | null

    The description.

  • timenumber | null

    The time budget, in seconds.

  • levelnumber | null

    The difficulty level.

  • beginstring | null

    When it opens (ISO-8601).

  • endstring | null

    When it closes (ISO-8601).

  • questionsobject[]

    The questions, in order.

    Show child attributes (7)
    • idstring | null

      The question id, to keep it on a change.

    • textstring | null

      Its wording.

    • answersobject[]

      Its answers, each counted.

    • answers[].idstring | null

      The answer id, to keep it on a change.

    • answers[].textstring | null

      Its label.

    • answers[].correctboolean | null

      Whether it is the correct one.

    • answers[].picksinteger

      The plays that picked it.

  • playersinteger

    How many times it was played.

  • mediaobject | null

    The media it shows.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

POST /v1/masjid/quizzes
curl -X POST "https://hub.masjidbox.com/v1/masjid/quizzes" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"time":300,"title":"Ramadan quiz"}'
Example request · MasjidQuizCreate
{
  "time": 300,
  "title": "Ramadan quiz"
}
201 · MasjidQuiz
{
  "begin": "2026-12-01T00:00:00.000Z",
  "createdAt": "2026-11-12T08:00:00.000Z",
  "description": "Test your knowledge",
  "end": null,
  "id": "qiz_6af5c9e2bc095fbd2dc57366",
  "level": 1,
  "media": null,
  "object": "quiz",
  "players": 14,
  "questions": [
    {
      "answers": [
        {
          "correct": true,
          "id": "000000000000000000000082",
          "picks": 11,
          "text": "The 27th"
        },
        {
          "correct": false,
          "id": "000000000000000000000083",
          "picks": 3,
          "text": "The 15th"
        }
      ],
      "id": "000000000000000000000081",
      "text": "Which night is Laylat al-Qadr sought on most?"
    }
  ],
  "time": 300,
  "title": "Ramadan quiz",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Change a quiz

Masjid key · secret · Content: edit

PATCH/v1/masjid/quizzes/{id}

JSON Merge Patch: a field you leave out stays, null clears it. A media must be one of your organization's (med_ id), else 400. questions replaces the list: a question or an answer kept by its id keeps its counts. 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 quiz id.

Request body

  • descriptionstring | null

    The description.

  • timeinteger | null

    The time budget, in seconds.

  • levelinteger | null

    The difficulty level.

  • beginstring | null

    When it opens (ISO-8601, with its offset).

  • endstring | null

    When it closes (ISO-8601, with its offset).

  • questionsobject[]

    The questions: the list replaces the quiz's.

    Show child attributes (6)
    • idstring

      A stored question's id, to keep it; absent, a new one.

    • textstringrequired

      Its wording.

    • answersobject[]required

      Its answers.

    • answers[].idstring

      A stored answer's id, to keep it; absent, a new one.

    • answers[].textstringrequired

      Its label.

    • answers[].correctbooleanrequired

      Whether it is the correct one.

  • mediastring | null

    A media of your organization (upload it first); null removes it.

  • titlestring

    The title.

Returns

The quiz after the change.

  • objectquiz

    Always quiz.

  • idstring

    The quiz id.

  • titlestring | null

    The title.

  • descriptionstring | null

    The description.

  • timenumber | null

    The time budget, in seconds.

  • levelnumber | null

    The difficulty level.

  • beginstring | null

    When it opens (ISO-8601).

  • endstring | null

    When it closes (ISO-8601).

  • questionsobject[]

    The questions, in order.

    Show child attributes (7)
    • idstring | null

      The question id, to keep it on a change.

    • textstring | null

      Its wording.

    • answersobject[]

      Its answers, each counted.

    • answers[].idstring | null

      The answer id, to keep it on a change.

    • answers[].textstring | null

      Its label.

    • answers[].correctboolean | null

      Whether it is the correct one.

    • answers[].picksinteger

      The plays that picked it.

  • playersinteger

    How many times it was played.

  • mediaobject | null

    The media it shows.

    Show child attributes (3)
    • idstring

      The media id.

    • typestring | null

      picture, video or document.

    • urlstring | null

      The URL to show it from.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/quizzes/{id}
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/quizzes/qiz_6af5c9e2bc095fbd2dc57366" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"end":"2026-12-31T23:59:00.000Z"}'
Example request · MasjidQuizPatch
{
  "end": "2026-12-31T23:59:00.000Z"
}
200 · MasjidQuiz
{
  "begin": "2026-12-01T00:00:00.000Z",
  "createdAt": "2026-11-12T08:00:00.000Z",
  "description": "Test your knowledge",
  "end": null,
  "id": "qiz_6af5c9e2bc095fbd2dc57366",
  "level": 1,
  "media": null,
  "object": "quiz",
  "players": 14,
  "questions": [
    {
      "answers": [
        {
          "correct": true,
          "id": "000000000000000000000082",
          "picks": 11,
          "text": "The 27th"
        },
        {
          "correct": false,
          "id": "000000000000000000000083",
          "picks": 3,
          "text": "The 15th"
        }
      ],
      "id": "000000000000000000000081",
      "text": "Which night is Laylat al-Qadr sought on most?"
    }
  ],
  "time": 300,
  "title": "Ramadan quiz",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Delete a quiz

Masjid key · secret · Content: edit

DELETE/v1/masjid/quizzes/{id}

Deletes a quiz and its plays. 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 quiz id.

Returns

Deleted. No body.

204 · No response body.

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