Skip to main content
POST
/
v1
/
templates
/
campaigns
Create Campaign Template
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/templates/campaigns \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "campaign_id": "<string>",
  "promotion_tier_id": "<string>",
  "name": "<string>",
  "description": "<string>"
}'
{
"id": "camp_tpl_0f887664cfe19f2162",
"name": "Template Halloween Campaigns",
"description": "Reuse every October",
"campaign_type": "DISCOUNT_COUPONS",
"created_at": "2024-10-17T14:37:59.488Z",
"object": "campaign_template"
}

Authorizations

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

The access token received from the authorization server in the OAuth 2.0 flow.

Body

application/json

Provide details for a campaign template

Request body schema for POST /templates/campaign. Request body for updating a campaign template.

name
string
required

User-defined name of the campaign template. It must be unique.

campaign_id
string | null

Unique identifier of the campaign that will create a template. It must be an ID of an existing discount or gift card campaign. It cannot be passed when promotion_tier_id has value. Required when the promotion_tier_id is not passed or it is null.

promotion_tier_id
string | null

Unique identifier of the promotion tier that will create a template. It cannot be passed when campaign_id has value. Required when the campaign_id is not passed or it is null.

description
string | null

User-defined description of the campaign template.

Response

Returns the details of a created campaign template.

Response body schema for POST /v1/templates/campaigns. Stores details about a campaign template.

id
string
required

Unique identifier of the campaign template. It is assigned by Voucherify.

Example:

"camp_tpl_eR9NsNJ5gqJRN2TG3fqCvbVl"

name
string
required

User-defined name of the campaign template.

campaign_type
enum<string>
required

Type of the campaign used to create the campaign template. Templates created from a promotion tier are converted to DISCOUNT_COUPONS.

Available options:
DISCOUNT_COUPONS,
GIFT_VOUCHERS
created_at
string<date-time>
required

Timestamp representing the date and time when the campaign template was created. The value is shown in the ISO 8601 format.

Example:

"2024-07-16T09:05:53.175Z"

object
enum<string>
required

The type of the object represented by JSON.

Available options:
campaign_template
description
string

User-defined description of the campaign template.

I