Skip to content
campaiDeveloper
campai.com

Donation ยท Campaigns

POST/{organizationId}/{mandateId}/donation/campaigns/{campaignId}/updateCampaign

Update donation campaign

Updates a donation campaign for a mandate using the supplied name, description, availability, goal, and cost centers. A renamed campaign is reflected in its donation form submissions and donations; changed cost centers apply to future postings. 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 organization access.
  • The caller needs mandate.read and donationsSettings.edit.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired
  • campaignIdidrequired

Body

Content-Type: application/json

  • namestringrequired

    1โ€“100 characters

  • descriptionstringrequired

    at most 1000 characters

  • availablebooleanrequired
  • goalintegerrequirednullable

    at most 9999999999

  • costCenter1numberrequirednullable

    1โ€“99999999

  • costCenter2numberrequirednullable

    1โ€“99999999

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

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

    Response200
    {}

    What else happens

    • The campaign is updated with the supplied fields.
    • If the name changes, matching donation form submissions receive the new campaignName.
    • If the name changes, matching campaign positions in donations receive the new campaignName.

    Errors

    Other errors

    StatusErrorWhen
    400The Cost-center 1 first digit has to be within "regions digits"If accounting regions are configured and the first digit of costCenter1 does not match a region, the endpoint returns 400 with key finance.accounting.validateGetCostCenters.costCenter1Digits. Only region eu
    400cost center name "cost center number" is invalidIf a cost center that must be validated is not found, the endpoint returns 400 with key finance.accounting.validateGetCostCenters.invalidCostCenter. Only region eu
    400cost center name "cost center number" is not bookableIf a cost center that must be validated is not bookable, the endpoint returns 400 with key finance.accounting.validateGetCostCenters.notBookableCostCenter. Only region eu
    404The campaign was not found.If the campaign is not found in the organization and mandate, the endpoint returns 404 with key routes.donation.campaigns.campaignNotFound.
    404A mandate needs to be providedIf mandateId is a null object ID, the endpoint returns 404 with key organization.getMandate.nullMandateId.
    404Mandate mandate ID not foundIf the mandate is not found in the organization, the endpoint returns 404 with key organization.getMandate.notFound.
    404Accounting plan is missing. Please make sure you have setup your finances app properly.If costCenter1 is provided and the organization's accounting plan is missing, the endpoint returns 404 with key finance.accounting.getAccountingPlan.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.