Skip to main content
GET
/
v1
/
templates
/
campaigns
List Campaign Templates
curl --request GET \
  --url https://{cluster}.voucherify.io/v1/templates/campaigns \
  --header 'Authorization: Bearer <token>' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>'
{
  "object": "list",
  "data_ref": "campaign_templates",
  "campaign_templates": [
    {
      "id": "camp_tpl_hFK6hpVc9WKsWaBv4mz7uZn8",
      "name": "DISCOUNT-CAMPAIGN-TEMPLATE",
      "description": "New discount for Q4",
      "campaign_type": "DISCOUNT_COUPONS",
      "created_at": "2024-06-21T13:03:09.431Z",
      "object": "campaign_template"
    },
    {
      "id": "camp_tpl_cR8va5Ga2nAi4Nxoi1I1qR8S",
      "name": "GIFT-CAMPAIGN-TEMPLATE",
      "campaign_type": "GIFT_VOUCHERS",
      "created_at": "2024-07-05T14:26:31.600Z",
      "updated_at": "2024-07-05T14:27:02.905Z",
      "object": "campaign_template"
    }
  ],
  "total": 14,
  "has_more": true
}

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.

Query Parameters

limit
integer

Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

Required range: 1 <= x <= 100
starting_after_id
string

A cursor for pagination. It retrieves the campaign templates created after a template with the given ID.

order
enum<string>

Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

Available options:
id,
-id
include_total
boolean

If set to true, the response returns the number of all campaign templates, regardless of the applied filters or limits. Set to false by default.

filters
object

Filters for listing templates.

Response

200 - application/json

Returns a dictionary of campaign template objects. The templates are returned by creation date by default. The most recent objects appear last unless specified otherwise with the order parameter.

Response body schema for GET /v1/templates/campaign.

object
enum<string>
required

The type of the object represented by JSON. This object stores information about campaign templates.

Available options:
list
data_ref
enum<string>
required

Identifies the name of the JSON property that contains the array of campaign templates.

Available options:
data
has_more
boolean
required

As query results are always limited (by the limit parameter), the has_more flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results.

data
object[]

Dictionary that contains an array of campaign templates.

total
integer

Total number of templates, regardless of the applied query parameters. Displayed only if the include_total query paremeter is set to true.

more_starting_after
string

Returns an ID that can be used to return another page of results. Use the template ID in the starting_after_id query parameter to display another page of the results starting after the template with that ID.

I