---
title: "Update a campaign"
description: "Update your campaign."
canonical: https://www.charitips.com/docs/api-reference/update-campaign
---

# Update a campaign

`PATCH /v1/campaigns/{campaignId}`

Update your campaign.

**Authentication**: Bearer access token.

## Parameters

- `campaignId` (string, required)

## Body

- `name` (string, 2 to 100 characters): Name of your campaign. Only use for display in your dashboard.
- `slug` (string, 2 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` (string, 2 to 100 characters): Will be displayed in the campaign page
- `description` (string, 2 to 1000 characters): Will be displayed in the campaign page.
- `titleColor` (string, hex color): Customize the color of titles in the campaign page
- `accentColor` (string, hex color): Customize the color of buttons in the campaign page
- `logoUrl` (string, URL): Logo that will be displayed in the campaign page's header
- `faviconUrl` (string, URL): Image that will be used as favicon for the campaign page
- `message` (string, 1 to 600 characters): Slack campaigns only. Message posted to each participant with their donation. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.
- `reminderMessage` (string, 1 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` (string, 1 to 100 characters): Email campaigns only. Name of the sender of the donation emails.
- `emailSenderPictureUrl` (string, URL): Email campaigns only. Picture of the sender displayed in the donation emails.
- `emailSubject` (string, 1 to 100 characters): Email campaigns only. Subject of the donation emails.
- `emailTemplate` (string, 1 to 1000 characters): Email campaigns only. HTML body of the donation emails. Supports the {{firstName}}, {{lastName}}, {{company}} and {{amount}} variables.
- `emailReplyTo` (string, email 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.
  - `fullname` (boolean)
  - `companyName` (boolean)
  - `email` (boolean)
  - `phone` (boolean)
  - `custom` (string | 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. One of `MANUAL`, `EMAIL`.
- `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. One of `SOCIAL_SHARING`, `DONATION_MATCHING`, `CHARITY_NEWSLETTER_SUBSCRIPTION`.
- `charitiesSelectionId` (string, UUID)

## Response 200

- `campaignId` (string, required)
- `name` (string, required)
- `type` (CampaignType) One of `TIME_BASED`, `PERMANENT`.
- `amountType` (CampaignAmountType) One of `FIXED_AMOUNT`, `FREE_AMOUNT`.
- `audienceType` (CampaignAudienceType) One of `PRIVATE`, `PUBLIC`.
- `donationType` (CampaignDonationType) One of `FACE_VALUE`, `DISTRIBUTION`.
- `givingType` (GivingType, required) One of `FINANCIAL`, `PAYROLL`, `PAID_TIME_OFF`.
- `recurringType` (RecurringType, required) One of `NONE`, `FREQUENCY`, `MANUAL`.
- `startDate` (string (date-time), required)
- `endDate` (string (date-time))
- `budget` (integer (int64))
- `sendingMode` (CampaignSendingMode) One of `MANUAL`, `EMAIL`, `PHYSICAL`, `SLACK`, `POSTAL`.
- `status` (CampaignStatus) One of `DRAFT`, `PENDING`, `ACTIVE`, `COMPLETE`, `CANCELED`.
- `slug` (string)
- `publicKey` (string, required)
- `withFiscalReceipts` (boolean, required)
- `language` (Language) One of `fr`, `en`.
- `frequency` (string)
- `budgetFrequency` (string)
- `billingStatus` (BillingStatus, required) One of `PENDING`, `BILLED`, `PAID`.
- `defaultHideAmount` (boolean)
- `withHideAmountCustomization` (boolean)
- `withGiftCards` (boolean)
- `withLeadCollection` (boolean)
- `withoutCustomization` (boolean, required)
- `momentType` (MomentType) One of `OCCASION`, `KEY_MOMENT`, `EDITION`.
- `momentSlug` (string)
- `leadCollectionOptions` (object)
- `donationsBilledOn` (DonationBilledOn, required) One of `CREATION`, `CLAIM`.
- `withDonationsValidation` (boolean, required)
- `fiscalReceiptType` (FiscalReceiptType, required) One of `YEARLY`, `SINGLE_DONATION`.
- `fiscalReceiptSendingMode` (FiscalReceiptSendingMode, required) One of `MANUAL`, `EMAIL`.
- `defaultHasBeenCharged` (boolean, required)
- `defaultFeeType` (FeeType, required) One of `EXCLUDED`, `INCLUDED`.
- `donationValidityPeriod` (string, required)
- `template` (string)
- `physicalFormat` (PhysicalFormat) One of `CUSTOM`, `PRINT`, `PARCEL`.
- `withEmailWall` (boolean)
- `postDonationWidgets` (PostDonationWidget[], required)
- `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` (string, required)
- `campaignTemplateId` (string)
- `donorPlatformId` (string)
- `createdAt` (string (date-time), required)
- `updatedAt` (string (date-time), required)

## Errors

- 400 `Invalid charitiesSelectionId`: The selection does not exist on your account. List your selections, or create one. See https://www.charitips.com/docs/api-reference/list-charities-selections.md.
- 400 `A field is missing, has the wrong type, or is not part of the request schema.`: `message` lists every problem. Unknown fields are rejected, not ignored: remove them rather than sending extra data. See https://www.charitips.com/docs/api-reference/errors.md.
- 401 `Unauthorized`: The access token is missing, expired or invalid. Create a new one with your client id and secret, send it as `Authorization: Bearer <accessToken>`, then retry once. Sandbox tokens only work on api.sandbox.charitips.com. See https://www.charitips.com/docs/get-started/authentication.md.
- 403 `The charities of this campaign cannot be customized`: This campaign keeps the charities it was created with: its `charitiesSelectionId` cannot change. Leave the field out, or create a new campaign with your selection. See https://www.charitips.com/docs/api-reference/create-campaign.md.
- 403 `Account closed`: The account behind these credentials is closed: no token is issued and every call is refused, reads included. Contact Charitips to reopen it. See https://www.charitips.com/docs/api-reference/troubleshooting.md#calls-answer-403-account-not-active-account-not-validated-or-account-closed.
- 403 `Forbidden`: Your credentials cannot perform this action on this resource. An id from another account never answers 403: it is treated as unknown, with a 404 in the path or a 400 `Bad Request` in the body or the query. See https://www.charitips.com/docs/api-reference/errors.md.
- 404 `Not Found`: No resource with this id on your account and environment. An id that belongs to another account answers 404 too when it is in the path. Ids from the sandbox do not exist in production. See https://www.charitips.com/docs/get-started/sandbox.md.
- 409 `Slug already used`: Another campaign of your account already uses this `slug`. Pick another one. See https://www.charitips.com/docs/api-reference/errors.md.

## Example

```bash
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"
  }'
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/campaigns/<campaignId>', {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "Checkout donations"
  }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
```

```python
import os, requests

response = requests.patch(
    "https://api.sandbox.charitips.com/v1/campaigns/<campaignId>",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
    json={
      "name": "Checkout donations"
    },
)
response.raise_for_status()
data = response.json()
```

## Response example (200, placeholder values)

```json
{
  "campaignId": "<campaignId>",
  "name": "<name>",
  "type": "PERMANENT",
  "amountType": "FREE_AMOUNT",
  "audienceType": "PRIVATE",
  "donationType": "FACE_VALUE",
  "givingType": "FINANCIAL",
  "recurringType": "NONE",
  "status": "DRAFT"
}
```
