Skip to content
Aller au contenu
Charitips

API reference · Campaigns

Update a campaign

PATCH/v1/campaigns/{campaignId}

Update your campaign.

Requires a Bearer access token.

Parameters

This field has no description in the spec.

  • campaignId#stringin pathrequired

Body

UpdateCampaignDto

1 of 25 fields has no description in the spec.

  • name#string2 to 100 characters

    Name of your campaign. Only use for display in your dashboard.

  • slug#string2 to 100 characters

    Slug of your campaign. Will be use in your generated page url.

  • startDate#string (date)

    Defaults to today

  • endDate#string (date)

    Required for time limited campaigns.

  • donationValidityPeriod#string

    A valid time interval matching the format 'X days' | 'X weeks' | 'X months' | 'X years'. Maximum 1 year. Define the validity period for donations. Upon creation, a donation's expiry date will be computed by adding this duration to the latest date between startDate and now. If endDate is set, the expiry date will be the earliest between the computed date and endDate.

  • title#string2 to 100 characters

    Will be displayed in the campaign page

  • description#string2 to 1000 characters

    Will be displayed in the campaign page.

  • titleColor#stringhex color

    Customize the color of titles in the campaign page

  • accentColor#stringhex color

    Customize the color of buttons in the campaign page

  • logoUrl#stringURL

    Logo that will be displayed in the campaign page's header

  • faviconUrl#stringURL

    Image that will be used as favicon for the campaign page

  • message#string1 to 600 characters

    Slack campaigns only. Message posted to each participant with their donation. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.

  • reminderMessage#string1 to 600 characters

    Slack campaigns only. Message posted to remind the participants who have not chosen a charity yet. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.

  • emailSenderName#string1 to 100 characters

    Email campaigns only. Name of the sender of the donation emails.

  • emailSenderPictureUrl#stringURL

    Email campaigns only. Picture of the sender displayed in the donation emails.

  • emailSubject#string1 to 100 characters

    Email campaigns only. Subject of the donation emails.

  • emailTemplate#string1 to 1000 characters

    Email campaigns only. HTML body of the donation emails. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.

  • emailReplyTo#stringemail address

    Email campaigns only. Address the participants reply to.

  • emailDisplayCard#boolean

    Email campaigns only. Whether the donation emails show the donation card. Defaults to true.

  • leadCollectionOptions#object

    Fields to be collected from the donor: any of the keys below, at least one. custom is your own question, or false.

    5 child fields
    • fullnameboolean

    • companyNameboolean

    • emailboolean

    • phoneboolean

    • customstring | false

  • fiscalReceiptSendingMode#string

    Restricted to B2C use cases. Set to EMAIL to let Charitips email their fiscal receipt to the donors who paid their donation (hasBeenCharged). With MANUAL, you send them yourself.

    MANUALEMAIL

  • withFiscalReceipts#boolean

    Restricted to B2C use cases. Default value of withFiscalReceipt for the donations of this campaign. Set to false when no fiscal receipt should be issued for them.

  • givingTarget#integer (int64)

    Only used for fundraising campaigns. It represents the target amount to be raised.

  • postDonationWidgets#string[]

    Blocks shown after a donation on Charitips pages and widgets: social sharing, a top-up paid by the beneficiary and the charity newsletter subscription. All of them by default.

    SOCIAL_SHARINGDONATION_MATCHINGCHARITY_NEWSLETTER_SUBSCRIPTION

  • charitiesSelectionId#stringUUID

Response

200 · Campaign

No field is described in the spec.

  • campaignId#stringalways returned

  • name#stringalways returned

  • type#CampaignType

    TIME_BASEDPERMANENT

  • amountType#CampaignAmountType

    FIXED_AMOUNTFREE_AMOUNT

  • audienceType#CampaignAudienceType

    PRIVATEPUBLIC

  • donationType#CampaignDonationType

    FACE_VALUEDISTRIBUTION

  • givingType#GivingTypealways returned

    FINANCIALPAYROLLPAID_TIME_OFF

  • recurringType#RecurringTypealways returned

    NONEFREQUENCYMANUAL

  • startDate#string (date-time)always returned

  • endDate#string (date-time)

  • budget#integer (int64)

  • sendingMode#CampaignSendingMode

    MANUALEMAILPHYSICALSLACKPOSTAL

  • status#CampaignStatus

    DRAFTPENDINGACTIVECOMPLETECANCELED

  • slug#string

  • publicKey#stringalways returned

  • withFiscalReceipts#booleanalways returned

  • language#Language

    fren

  • frequency#string

  • budgetFrequency#string

  • billingStatus#BillingStatusalways returned

    PENDINGBILLEDPAID

  • defaultHideAmount#boolean

  • withHideAmountCustomization#boolean

  • withGiftCards#boolean

  • withLeadCollection#boolean

  • withoutCustomization#booleanalways returned

  • momentType#MomentType

    OCCASIONKEY_MOMENTEDITION

  • momentSlug#string

  • leadCollectionOptions#object

  • donationsBilledOn#DonationBilledOnalways returned

    CREATIONCLAIM

  • withDonationsValidation#booleanalways returned

  • fiscalReceiptType#FiscalReceiptTypealways returned

    YEARLYSINGLE_DONATION

  • fiscalReceiptSendingMode#FiscalReceiptSendingModealways returned

    MANUALEMAIL

  • defaultHasBeenCharged#booleanalways returned

  • defaultFeeType#FeeTypealways returned

    EXCLUDEDINCLUDED

  • donationValidityPeriod#stringalways returned

  • template#string

  • physicalFormat#PhysicalFormat

    CUSTOMPRINTPARCEL

  • withEmailWall#boolean

  • postDonationWidgets#PostDonationWidget[]always returned

  • title#string

  • description#string

  • logoUrl#string

  • faviconUrl#string

  • titleColor#string

  • accentColor#string

  • givingTarget#integer (int64)

  • message#string

  • reminderMessage#string

  • emailSenderName#string

  • emailSenderPictureUrl#string

  • emailSubject#string

  • emailTemplate#string

  • emailReplyTo#string

  • emailDisplayCard#boolean

  • lastCustomerReminderId#string

  • charitiesSelectionId#string

  • accountId#stringalways returned

  • campaignTemplateId#string

  • donorPlatformId#string

  • createdAt#string (date-time)always returned

  • updatedAt#string (date-time)always returned

Errors

  • 400Invalid charitiesSelectionId
    {
      "statusCode": 400,
      "message": "Invalid charitiesSelectionId",
      "error": "Bad Request"
    }
  • 400A field is missing, has the wrong type, or is not part of the request schema.

    Every request with a body or query is validated.

    {
      "statusCode": 400,
      "message": [
        "amount must not be less than 1",
        "property foo should not exist"
      ],
      "error": "Bad Request"
    }
  • 401Unauthorized

    Missing, expired or invalid access token.

    {
      "statusCode": 401,
      "message": "Unauthorized"
    }
  • 403The charities of this campaign cannot be customized
    {
      "statusCode": 403,
      "message": "The charities of this campaign cannot be customized",
      "error": "Forbidden"
    }
  • 403Account closed
    {
      "message": "Account closed",
      "code": "ACCOUNT_CLOSED"
    }
  • 403Forbidden

    Your credentials cannot perform this action on this resource. An id from another account answers 404 in the path, 400 in the body or the query.

    {
      "statusCode": 403,
      "message": "Forbidden"
    }
  • 404Not Found

    No resource with this id on your account: the API answers as if it did not exist.

    {
      "statusCode": 404,
      "message": "Not Found"
    }
  • 409Slug already used
    {
      "message": "Slug already used",
      "code": "slug_already_used"
    }
PATCH /v1/campaigns/<campaignId>
curl -X PATCH https://api.sandbox.charitips.com/v1/campaigns/<campaignId> \  -H "Authorization: Bearer $CHARITIPS_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "name": "Checkout donations"  }'
Built from the spec and the API code

Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.