Skip to content
campaiDeveloper
campai.com

Donation ยท Campaigns

DELETE/{organizationId}/{mandateId}/donation/campaigns/{campaignId}

Delete donation campaign

Deletes a donation campaign for the specified organization and mandate, using organizationId, mandateId, and campaignId. A campaign linked to donations, forms, or contracts cannot be deleted. On success, the endpoint returns an empty object.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have access to the organization.
  • The caller needs mandate.read permission.
  • The caller also needs donationsSettings.edit permission.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired
  • campaignIdidrequired
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request DELETE 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/donation/campaigns/YOUR_CAMPAIGN_ID' \
  --header 'X-API-Key: YOUR_API_KEY'

Response

200 Successful response

Content-Type: application/json

    Response200
    {}

    What else happens

    • If the campaign exists and is not in use, it is deleted from donationCampaigns.

    Errors

    Other errors

    StatusErrorWhen
    400The campaign has donations, forms or contracts and can not be deleted. Make it unavailable instead.If a donation in the mandate references the campaign, the endpoint returns HTTP 400 with routes.donation.campaigns.campaignInUse.
    400The campaign has donations, forms or contracts and can not be deleted. Make it unavailable instead.If a form or contract references the campaign, the endpoint returns HTTP 400 with routes.donation.campaigns.campaignInUse.
    404The campaign was not found.If the campaign is not found in the organization and mandate, the endpoint returns HTTP 404 with routes.donation.campaigns.campaignNotFound, provided no linked donation, form, or contract was found first.
    404A mandate needs to be providedIf mandateId is a null object ID, the endpoint returns HTTP 404 with organization.getMandate.nullMandateId.
    404Mandate mandate ID not foundIf the mandate is not found in the organization, the endpoint returns HTTP 404 with organization.getMandate.notFound.

    Marked words such as mandate ID are filled in with the actual value when the error happens.

    Errors nearly every request can meet are listed under Errors.