curl --request PUT \
--url https://{cluster}.voucherify.io/v1/campaigns/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"description": "New description"
}
'{
"id": "camp_FZL4iTTdZw36nZOoXYQ172fQ",
"name": "Loyalty Campaign",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 1000,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 3,
"rounding_type": "END_OF_YEAR"
}
},
"redemption": {
"quantity": 10
},
"code_config": {
"length": 7,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "LOYALTY-CARD-#######"
},
"is_referral_code": false,
"start_date": "2020-08-16T00:00:00.000Z",
"expiration_date": "2023-12-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "P1D"
}
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": false,
"description": "New description",
"start_date": "2020-08-16T00:00:00.000Z",
"expiration_date": "2023-12-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "P1D"
},
"validity_day_of_week": [
0,
1,
2
],
"activity_duration_after_publishing": "P24D",
"vouchers_count": 2,
"active": true,
"metadata": {
"region": "APAC"
},
"created_at": "2022-09-21T09:39:45.479Z",
"updated_at": "2022-09-23T09:47:00.205Z",
"category": "First",
"creation_status": "MODIFYING",
"vouchers_generation_status": "MODIFYING",
"protected": false,
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"category_id": "cat_0bb343dee3cdb5ec0c",
"categories": [
{
"id": "cat_0bb343dee3cdb5ec0c",
"name": "First",
"hierarchy": 1,
"created_at": "2022-09-16T11:47:19.568Z",
"object": "category"
}
],
"object": "campaign"
}{
"code": 400,
"key": "resource_protected",
"message": "Resource is protected",
"details": "Resource campaign with id camp_oazbyS2Y3SxKLCh9yQ3pqFr6 is protected and cannot be modified",
"request_id": "v-0f7548b67cc7ed8dff",
"resource_id": "camp_oazbyS2Y3SxKLCh9yQ3pqFr6",
"resource_type": "campaign"
}{
"code": 403,
"key": "forbidden",
"message": "Forbidden",
"details": "Resource campaign with id camp_7u3ZPLSByANMXjBkAs4kT2nS is not accessible in given context",
"request_id": "v-0f005192bfce923bb7",
"resource_id": "camp_7u3ZPLSByANMXjBkAs4kT2nS",
"resource_type": "campaign"
}Update Campaign
Updates the specified campaign by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
Fields other than the ones listed in the request body won’t be modified. Even if provided, they will be silently skipped.
This method will update vouchers aggregated in the campaign. It will affect all vouchers that are not published or redeemed yet.
curl --request PUT \
--url https://{cluster}.voucherify.io/v1/campaigns/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"description": "New description"
}
'{
"id": "camp_FZL4iTTdZw36nZOoXYQ172fQ",
"name": "Loyalty Campaign",
"campaign_type": "LOYALTY_PROGRAM",
"type": "AUTO_UPDATE",
"voucher": {
"type": "LOYALTY_CARD",
"loyalty_card": {
"points": 1000,
"expiration_rules": {
"period_type": "MONTH",
"period_value": 3,
"rounding_type": "END_OF_YEAR"
}
},
"redemption": {
"quantity": 10
},
"code_config": {
"length": 7,
"charset": "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
"pattern": "LOYALTY-CARD-#######"
},
"is_referral_code": false,
"start_date": "2020-08-16T00:00:00.000Z",
"expiration_date": "2023-12-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "P1D"
}
},
"auto_join": false,
"join_once": false,
"use_voucher_metadata_schema": false,
"description": "New description",
"start_date": "2020-08-16T00:00:00.000Z",
"expiration_date": "2023-12-26T00:00:00.000Z",
"validity_timeframe": {
"interval": "P2D",
"duration": "P1D"
},
"validity_day_of_week": [
0,
1,
2
],
"activity_duration_after_publishing": "P24D",
"vouchers_count": 2,
"active": true,
"metadata": {
"region": "APAC"
},
"created_at": "2022-09-21T09:39:45.479Z",
"updated_at": "2022-09-23T09:47:00.205Z",
"category": "First",
"creation_status": "MODIFYING",
"vouchers_generation_status": "MODIFYING",
"protected": false,
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"category_id": "cat_0bb343dee3cdb5ec0c",
"categories": [
{
"id": "cat_0bb343dee3cdb5ec0c",
"name": "First",
"hierarchy": 1,
"created_at": "2022-09-16T11:47:19.568Z",
"object": "category"
}
],
"object": "campaign"
}{
"code": 400,
"key": "resource_protected",
"message": "Resource is protected",
"details": "Resource campaign with id camp_oazbyS2Y3SxKLCh9yQ3pqFr6 is protected and cannot be modified",
"request_id": "v-0f7548b67cc7ed8dff",
"resource_id": "camp_oazbyS2Y3SxKLCh9yQ3pqFr6",
"resource_type": "campaign"
}{
"code": 403,
"key": "forbidden",
"message": "Forbidden",
"details": "Resource campaign with id camp_7u3ZPLSByANMXjBkAs4kT2nS is not accessible in given context",
"request_id": "v-0f005192bfce923bb7",
"resource_id": "camp_7u3ZPLSByANMXjBkAs4kT2nS",
"resource_type": "campaign"
}Authorizations
Scopes
Path Parameters
Body
Specify the campaign parameters to be updated.
- Update Discount Coupons Campaign
- Update Referral Campaign
- Update Gift Campaign
- Update Loyalty Campaign
- Update Promotion Campaign
Body schema for update a campaign of discount coupons type using PUT v1/campaigns.
Assigns or unassigns an area or store to the campaign.
NOTE: this object can be sent if the Areas and Stores enterprise feature is enabled. Contact Voucherify Sales to learn more.
Show child attributes
Show child attributes
Defines whether the campaign can be updated with new vouchers after campaign creation.
AUTO_UPDATE: By choosing the auto update option you will create a campaign that can be enhanced by new vouchers after the time of creation (e.g. by publish vouchers method).STATIC: vouchers need to be manually published.
If the type of the campaign is STANDALONE, the type cannot be changed. Also, the type cannot be changed to STANDALONE.
AUTO_UPDATE, STATIC Response
Returns the campaign object if the update succeeded.
Response body schema for PUT v1/campaigns/{campaignId}.
Defines whether the campaign can be updated with new vouchers after campaign creation or if the campaign consists of generic (standalone) vouchers.
AUTO_UPDATE: the campaign is dynamic, i.e. vouchers will generate based on set criteriaSTATIC: vouchers need to be manually publishedSTANDALONE: campaign for single vouchers
AUTO_UPDATE, STATIC, STANDALONE Contains details about the campaign category. For the GET List campaigns endpoint, this is returned only if the expand=category query parameter is passed in the request. Otherwise, it is returned as an empty array. For GET Campaign summary endpoint, it is always returned as an empty array.
Show child attributes
Show child attributes
Indicates whether the campaign can be only read by a restricted user in the Areas and Stores enterprise feature. It is returned only to restricted users; this field is not returned for users with other roles. It is also not returned for restricted users who use the GET Campaign summary endpoint.
Lists all assignments of the campaign to areas and stores. For GET List Campaigns, this is returned if the expand=access_settings_assignments query parameter is passed in the request. This object is not returned for the GET Campaign summary endpoint.
NOTE: This object is returned only if the Areas and Stores enterprise feature is enabled. Contact Voucherify Sales to learn more.
Show child attributes
Show child attributes

