Your masjid · Donation campaigns

Your donation campaigns

The campaigns your donors give to, each with what it collected. Change one, or close it with enabled: false: a campaign is never deleted.

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

Your donation campaigns

Masjid key · Donation campaigns: read

GET/v1/masjid/donation-campaigns

Your organization's donation campaigns, each with what it collected, newest first, by cursor (limit 1 to 100, 25 by default; cursor from the previous page). Needs Donation campaigns: 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 campaigns.

  • objectlist

    Always list.

  • dataobject[]

    The items of this page.

    Show child attributes (33)
    • objectdonation_campaign

      Always donation_campaign.

    • idstring

      The campaign id.

    • titlestring

      Its title.

    • descriptionstring | null

      Short description.

    • longDescriptionstring | null

      Long description.

    • slugstring | null

      Where its page lives.

    • mediastring | null

      The media shown on it.

    • colorstring | null

      Brand colour, #rrggbb.

    • targetnumber | null

      Its target, in minor units of the currency (pence, cents).

    • externalnumber | null

      Collected elsewhere and counted in, in minor units of the currency (pence, cents).

    • amountsnumber[]

      Suggested amounts, in minor units.

    • allowFreeInputboolean

      The donor may type an amount.

    • oneTimeboolean

      One-off donations offered.

    • recurrentboolean

      Recurring donations offered.

    • recurrentFrequenciesstring[]

      day, week, month, year.

    • startDatestring | null

      When it opens (ISO-8601).

    • endDatestring | null

      When it closes (ISO-8601).

    • dayOfWeeknumber | null

      Weekly collection day, 0 = Sunday.

    • dayOfMonthnumber | null

      Monthly collection day.

    • recuFiscalboolean

      French tax receipts issued.

    • giftAidboolean

      UK Gift Aid offered.

    • coverFeesboolean

      The donor may cover the fees.

    • sponsoredboolean

      A sponsored event (HMRC).

    • featuredboolean

      Featured on your pages.

    • hideCollectedAmountboolean

      The collected amount is hidden.

    • enabledboolean

      Enabled.

    • activeboolean

      Enabled, started and not ended: it takes donations now.

    • currencystring | null

      The account's currency, ISO 4217.

    • donationsobject

      What it collected.

    • donations.countnumber

      Succeeded donations.

    • donations.totalnumber

      Collected, in minor units, what was collected elsewhere included.

    • 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/donation-campaigns
curl "https://hub.masjidbox.com/v1/masjid/donation-campaigns" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidDonationCampaignsPage
{
  "data": [
    {
      "active": true,
      "allowFreeInput": true,
      "amounts": [
        1000,
        2500,
        5000
      ],
      "color": "#0a7d5c",
      "coverFees": false,
      "createdAt": "2026-11-12T08:00:00.000Z",
      "currency": "GBP",
      "dayOfMonth": null,
      "dayOfWeek": null,
      "description": "Feed a family this Ramadan",
      "donations": {
        "count": 12,
        "total": 45000
      },
      "enabled": true,
      "endDate": null,
      "external": 0,
      "featured": false,
      "giftAid": true,
      "hideCollectedAmount": false,
      "id": "cmp_6af5c9e2bc095fbd2dc5735b",
      "longDescription": null,
      "media": "med_6af5c9e2bc095fbd2dc57360",
      "object": "donation_campaign",
      "oneTime": true,
      "recuFiscal": false,
      "recurrent": true,
      "recurrentFrequencies": [
        "month"
      ],
      "slug": "ramadan-appeal",
      "sponsored": false,
      "startDate": "2026-11-12T08:00:00.000Z",
      "target": 1000000,
      "title": "Ramadan Appeal",
      "updatedAt": "2026-11-12T08:00:00.000Z"
    }
  ],
  "object": "list",
  "pagination": {
    "hasMore": false,
    "limit": 25,
    "nextCursor": null
  }
}

One of your donation campaigns

Masjid key · Donation campaigns: read

GET/v1/masjid/donation-campaigns/{id}

A donation campaign of your organization, with what it collected. Needs Donation campaigns: read.

Parameters

  • idstring · pathrequired

    The campaign id.

Returns

The campaign.

  • objectdonation_campaign

    Always donation_campaign.

  • idstring

    The campaign id.

  • titlestring

    Its title.

  • descriptionstring | null

    Short description.

  • longDescriptionstring | null

    Long description.

  • slugstring | null

    Where its page lives.

  • mediastring | null

    The media shown on it.

  • colorstring | null

    Brand colour, #rrggbb.

  • targetnumber | null

    Its target, in minor units of the currency (pence, cents).

  • externalnumber | null

    Collected elsewhere and counted in, in minor units of the currency (pence, cents).

  • amountsnumber[]

    Suggested amounts, in minor units.

  • allowFreeInputboolean

    The donor may type an amount.

  • oneTimeboolean

    One-off donations offered.

  • recurrentboolean

    Recurring donations offered.

  • recurrentFrequenciesstring[]

    day, week, month, year.

  • startDatestring | null

    When it opens (ISO-8601).

  • endDatestring | null

    When it closes (ISO-8601).

  • dayOfWeeknumber | null

    Weekly collection day, 0 = Sunday.

  • dayOfMonthnumber | null

    Monthly collection day.

  • recuFiscalboolean

    French tax receipts issued.

  • giftAidboolean

    UK Gift Aid offered.

  • coverFeesboolean

    The donor may cover the fees.

  • sponsoredboolean

    A sponsored event (HMRC).

  • featuredboolean

    Featured on your pages.

  • hideCollectedAmountboolean

    The collected amount is hidden.

  • enabledboolean

    Enabled.

  • activeboolean

    Enabled, started and not ended: it takes donations now.

  • currencystring | null

    The account's currency, ISO 4217.

  • donationsobject

    What it collected.

    Show child attributes (2)
    • countnumber

      Succeeded donations.

    • totalnumber

      Collected, in minor units, what was collected elsewhere included.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

GET /v1/masjid/donation-campaigns/{id}
curl "https://hub.masjidbox.com/v1/masjid/donation-campaigns/cmp_6af5c9e2bc095fbd2dc5735b" \
  -H "Authorization: Bearer $MASJIDBOX_KEY"
200 · MasjidDonationCampaign
{
  "active": true,
  "allowFreeInput": true,
  "amounts": [
    1000,
    2500,
    5000
  ],
  "color": "#0a7d5c",
  "coverFees": false,
  "createdAt": "2026-11-12T08:00:00.000Z",
  "currency": "GBP",
  "dayOfMonth": null,
  "dayOfWeek": null,
  "description": "Feed a family this Ramadan",
  "donations": {
    "count": 12,
    "total": 45000
  },
  "enabled": true,
  "endDate": null,
  "external": 0,
  "featured": false,
  "giftAid": true,
  "hideCollectedAmount": false,
  "id": "cmp_6af5c9e2bc095fbd2dc5735b",
  "longDescription": null,
  "media": "med_6af5c9e2bc095fbd2dc57360",
  "object": "donation_campaign",
  "oneTime": true,
  "recuFiscal": false,
  "recurrent": true,
  "recurrentFrequencies": [
    "month"
  ],
  "slug": "ramadan-appeal",
  "sponsored": false,
  "startDate": "2026-11-12T08:00:00.000Z",
  "target": 1000000,
  "title": "Ramadan Appeal",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Create a donation campaign

Masjid key · secret · Donation campaigns: edit

POST/v1/masjid/donation-campaigns

Creates a campaign as the dashboard does: enabled, its page under the first free slug of its title, your default campaign if it is your first. Its dates (startDate, endDate, with their offset) are set here, once. A media must be one of your organization's (med_ id), else 400. Needs a secret key with Donation campaigns: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

No parameters.

Request body

  • titlestringrequired

    Its title.

  • descriptionstring

    Short description.

  • longDescriptionstring

    Long description.

  • mediastring | null

    One of your media (med_); null removes it.

  • colorstring

    Brand colour, #rrggbb.

  • targetinteger

    Target, in minor units.

  • externalinteger

    Collected elsewhere, in minor units.

  • amountsinteger[]

    Suggested amounts, in minor units, up to 10.

  • allowFreeInputboolean

    The donor may type an amount.

  • oneTimeboolean

    One-off donations offered.

  • recurrentboolean

    Recurring donations offered.

  • recurrentFrequenciesstring[]

    Recurrence units offered.

  • dayOfWeekinteger | null

    Weekly collection day, 0 = Sunday.

  • dayOfMonthinteger | null

    Monthly collection day.

  • recuFiscalboolean

    French tax receipts issued.

  • giftAidboolean

    UK Gift Aid offered.

  • coverFeesboolean

    The donor may cover the fees.

  • sponsoredboolean

    A sponsored event (HMRC).

  • featuredboolean

    Featured on your pages.

  • hideCollectedAmountboolean

    The collected amount is hidden.

  • startDatestring

    When it opens, with its offset; set once, here.

  • endDatestring

    When it closes, with its offset; set once, here.

Returns

The campaign, as stored.

  • objectdonation_campaign

    Always donation_campaign.

  • idstring

    The campaign id.

  • titlestring

    Its title.

  • descriptionstring | null

    Short description.

  • longDescriptionstring | null

    Long description.

  • slugstring | null

    Where its page lives.

  • mediastring | null

    The media shown on it.

  • colorstring | null

    Brand colour, #rrggbb.

  • targetnumber | null

    Its target, in minor units of the currency (pence, cents).

  • externalnumber | null

    Collected elsewhere and counted in, in minor units of the currency (pence, cents).

  • amountsnumber[]

    Suggested amounts, in minor units.

  • allowFreeInputboolean

    The donor may type an amount.

  • oneTimeboolean

    One-off donations offered.

  • recurrentboolean

    Recurring donations offered.

  • recurrentFrequenciesstring[]

    day, week, month, year.

  • startDatestring | null

    When it opens (ISO-8601).

  • endDatestring | null

    When it closes (ISO-8601).

  • dayOfWeeknumber | null

    Weekly collection day, 0 = Sunday.

  • dayOfMonthnumber | null

    Monthly collection day.

  • recuFiscalboolean

    French tax receipts issued.

  • giftAidboolean

    UK Gift Aid offered.

  • coverFeesboolean

    The donor may cover the fees.

  • sponsoredboolean

    A sponsored event (HMRC).

  • featuredboolean

    Featured on your pages.

  • hideCollectedAmountboolean

    The collected amount is hidden.

  • enabledboolean

    Enabled.

  • activeboolean

    Enabled, started and not ended: it takes donations now.

  • currencystring | null

    The account's currency, ISO 4217.

  • donationsobject

    What it collected.

    Show child attributes (2)
    • countnumber

      Succeeded donations.

    • totalnumber

      Collected, in minor units, what was collected elsewhere included.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

POST /v1/masjid/donation-campaigns
curl -X POST "https://hub.masjidbox.com/v1/masjid/donation-campaigns" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amounts":[1000,2500],"startDate":"2026-11-12T08:00:00.000Z","title":"Ramadan Appeal"}'
Example request · MasjidDonationCampaignCreate
{
  "amounts": [
    1000,
    2500
  ],
  "startDate": "2026-11-12T08:00:00.000Z",
  "title": "Ramadan Appeal"
}
201 · MasjidDonationCampaign
{
  "active": true,
  "allowFreeInput": true,
  "amounts": [
    1000,
    2500,
    5000
  ],
  "color": "#0a7d5c",
  "coverFees": false,
  "createdAt": "2026-11-12T08:00:00.000Z",
  "currency": "GBP",
  "dayOfMonth": null,
  "dayOfWeek": null,
  "description": "Feed a family this Ramadan",
  "donations": {
    "count": 12,
    "total": 45000
  },
  "enabled": true,
  "endDate": null,
  "external": 0,
  "featured": false,
  "giftAid": true,
  "hideCollectedAmount": false,
  "id": "cmp_6af5c9e2bc095fbd2dc5735b",
  "longDescription": null,
  "media": "med_6af5c9e2bc095fbd2dc57360",
  "object": "donation_campaign",
  "oneTime": true,
  "recuFiscal": false,
  "recurrent": true,
  "recurrentFrequencies": [
    "month"
  ],
  "slug": "ramadan-appeal",
  "sponsored": false,
  "startDate": "2026-11-12T08:00:00.000Z",
  "target": 1000000,
  "title": "Ramadan Appeal",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}

Change a donation campaign

Masjid key · secret · Donation campaigns: edit

PATCH/v1/masjid/donation-campaigns/{id}

A merge: a field you leave out stays. Its dates never change here. A change that would cancel running recurring donations (enabled: false or recurrent: false while one runs) is a 409; there is no delete — close it with enabled: false. A new media must be one of your organization's (med_ id), else 400. Needs a secret key with Donation campaigns: edit. Counts against the write quota: 30 writes an hour and 300 a day per organization.

Parameters

  • idstring · pathrequired

    The campaign id.

Request body

  • titlestring

    Its title.

  • descriptionstring

    Short description.

  • longDescriptionstring

    Long description.

  • mediastring | null

    One of your media (med_); null removes it.

  • colorstring

    Brand colour, #rrggbb.

  • targetinteger

    Target, in minor units.

  • externalinteger

    Collected elsewhere, in minor units.

  • amountsinteger[]

    Suggested amounts, in minor units, up to 10.

  • allowFreeInputboolean

    The donor may type an amount.

  • oneTimeboolean

    One-off donations offered.

  • recurrentboolean

    Recurring donations offered.

  • recurrentFrequenciesstring[]

    Recurrence units offered.

  • dayOfWeekinteger | null

    Weekly collection day, 0 = Sunday.

  • dayOfMonthinteger | null

    Monthly collection day.

  • recuFiscalboolean

    French tax receipts issued.

  • giftAidboolean

    UK Gift Aid offered.

  • coverFeesboolean

    The donor may cover the fees.

  • sponsoredboolean

    A sponsored event (HMRC).

  • featuredboolean

    Featured on your pages.

  • hideCollectedAmountboolean

    The collected amount is hidden.

  • enabledboolean

    false closes it; refused (409) while recurring donations run on it.

Returns

The campaign after the change.

  • objectdonation_campaign

    Always donation_campaign.

  • idstring

    The campaign id.

  • titlestring

    Its title.

  • descriptionstring | null

    Short description.

  • longDescriptionstring | null

    Long description.

  • slugstring | null

    Where its page lives.

  • mediastring | null

    The media shown on it.

  • colorstring | null

    Brand colour, #rrggbb.

  • targetnumber | null

    Its target, in minor units of the currency (pence, cents).

  • externalnumber | null

    Collected elsewhere and counted in, in minor units of the currency (pence, cents).

  • amountsnumber[]

    Suggested amounts, in minor units.

  • allowFreeInputboolean

    The donor may type an amount.

  • oneTimeboolean

    One-off donations offered.

  • recurrentboolean

    Recurring donations offered.

  • recurrentFrequenciesstring[]

    day, week, month, year.

  • startDatestring | null

    When it opens (ISO-8601).

  • endDatestring | null

    When it closes (ISO-8601).

  • dayOfWeeknumber | null

    Weekly collection day, 0 = Sunday.

  • dayOfMonthnumber | null

    Monthly collection day.

  • recuFiscalboolean

    French tax receipts issued.

  • giftAidboolean

    UK Gift Aid offered.

  • coverFeesboolean

    The donor may cover the fees.

  • sponsoredboolean

    A sponsored event (HMRC).

  • featuredboolean

    Featured on your pages.

  • hideCollectedAmountboolean

    The collected amount is hidden.

  • enabledboolean

    Enabled.

  • activeboolean

    Enabled, started and not ended: it takes donations now.

  • currencystring | null

    The account's currency, ISO 4217.

  • donationsobject

    What it collected.

    Show child attributes (2)
    • countnumber

      Succeeded donations.

    • totalnumber

      Collected, in minor units, what was collected elsewhere included.

  • createdAtstring | null

    When it was created (ISO-8601).

  • updatedAtstring | null

    When it last changed (ISO-8601).

PATCH /v1/masjid/donation-campaigns/{id}
curl -X PATCH "https://hub.masjidbox.com/v1/masjid/donation-campaigns/cmp_6af5c9e2bc095fbd2dc5735b" \
  -H "Authorization: Bearer $MASJIDBOX_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Ramadan Appeal 1448"}'
Example request · MasjidDonationCampaignPatch
{
  "title": "Ramadan Appeal 1448"
}
200 · MasjidDonationCampaign
{
  "active": true,
  "allowFreeInput": true,
  "amounts": [
    1000,
    2500,
    5000
  ],
  "color": "#0a7d5c",
  "coverFees": false,
  "createdAt": "2026-11-12T08:00:00.000Z",
  "currency": "GBP",
  "dayOfMonth": null,
  "dayOfWeek": null,
  "description": "Feed a family this Ramadan",
  "donations": {
    "count": 12,
    "total": 45000
  },
  "enabled": true,
  "endDate": null,
  "external": 0,
  "featured": false,
  "giftAid": true,
  "hideCollectedAmount": false,
  "id": "cmp_6af5c9e2bc095fbd2dc5735b",
  "longDescription": null,
  "media": "med_6af5c9e2bc095fbd2dc57360",
  "object": "donation_campaign",
  "oneTime": true,
  "recuFiscal": false,
  "recurrent": true,
  "recurrentFrequencies": [
    "month"
  ],
  "slug": "ramadan-appeal",
  "sponsored": false,
  "startDate": "2026-11-12T08:00:00.000Z",
  "target": 1000000,
  "title": "Ramadan Appeal",
  "updatedAt": "2026-11-12T08:00:00.000Z"
}