Skip to main content
POST
/
v1
/
templates
/
campaigns
/
{campaignTemplateId}
/
campaign-setup
Create Campaign From Template
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/templates/campaigns/{campaignTemplateId}/campaign-setup \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "name": "Campaign-out-of-template",
  "description": "Created out of a template",
  "auto_join": true,
  "join_once": true
}'
{
  "created_resources": [
    {
      "id": "val_3LBFw25WTmAK",
      "object": "validation_rules"
    }
  ],
  "campaign": {
    "id": "camp_txDwyDPeLvBEq490bfV2nLwo",
    "name": "Campaign-out-of-template",
    "campaign_type": "DISCOUNT_COUPONS",
    "type": "AUTO_UPDATE",
    "is_referral_code": false,
    "voucher": {
      "type": "DISCOUNT_VOUCHER",
      "discount": {
        "type": "AMOUNT",
        "amount_off": 2500,
        "aggregated_amount_limit": 25000,
        "units": null,
        "effect": "APPLY_TO_ITEMS"
      },
      "gift": null,
      "loyalty_card": null,
      "redemption": {
        "quantity": 4,
        "redeemed_quantity": 0
      },
      "code_config": {
        "pattern": "##",
        "length": 2,
        "charset": "xD",
        "prefix": "U-",
        "postfix": "-WOT"
      }
    },
    "auto_join": true,
    "join_once": true,
    "use_voucher_metadata_schema": true,
    "description": "Winter 2024-25",
    "start_date": null,
    "expiration_date": null,
    "validity_timeframe": null,
    "validity_hours": null,
    "validity_day_of_week": null,
    "activity_duration_after_publishing": null,
    "vouchers_count_invalid": null,
    "vouchers_count": 0,
    "active": true,
    "metadata": null,
    "created_at": "2024-09-26T17:14:56.226Z",
    "updated_at": null,
    "category": null,
    "creation_status": "DONE",
    "protected": false,
    "validation_rules_assignments": {
      "data": [
        {
          "id": "asgm_BLgJYmo64rnAK5eB",
          "rule_id": "val_3LBFw25WTmAK",
          "related_object_id": "camp_txDwyDPeLvBEq490bfV2nLwo",
          "related_object_type": "campaign",
          "created_at": "2024-09-26T17:14:56.226Z",
          "object": "validation_rules_assignment"
        }
      ],
      "total": 1
    },
    "object": "campaign",
    "deleted": false,
    "deleted_at": null,
    "category_id": null,
    "voucher_type": "DISCOUNT_VOUCHER",
    "discount": {
      "type": "AMOUNT",
      "amount_off": 2500,
      "aggregated_amount_limit": 25000,
      "units": null,
      "effect": "APPLY_TO_ITEMS"
    },
    "gift": null,
    "loyalty_card": null,
    "voucher_code_config": {
      "pattern": "##",
      "length": 2,
      "charset": "xD",
      "prefix": "Your-",
      "postfix": "-Voucher"
    },
    "default_voucher_redemption": {
      "quantity": 4
    }
  },
  "object": "campaign_setup"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

Path Parameters

campaignTemplateId
string
required
Example:

Body

application/json
name
string
required
description
string
type
enum<string>
Available options:
AUTO_UPDATE,
STATIC
join_once
boolean
auto_join
boolean
use_voucher_metadata_schema
boolean
vouchers_count
integer
start_date
string<date-time>
Example:
expiration_date
string<date-time>
Example:
validity_timeframe
object
validity_day_of_week
enum<integer>[]
validity_hours
object
activity_duration_after_publishing
string
category_id
string
Example:
category
string
metadata
object
access_settings
object
voucher
object

Response

created_resources
object[]
required
campaign
object
required
object
enum<string>
required
Available options:
campaign_setup