younifyd
Menu

List Campaigns

List Campaigns

GET/v1/campaigns

Use it in a workflow

  1. Add a step and choose the Voucherify connector.
  2. Pick the List Campaigns action (under Campaigns).
  3. Fill in the fields below, then reference the result from later steps as {{listCampaigns.response.data}}.

Request

Query parameters

limitinteger

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.

pageinteger

Which page of results to return. The lowest value is `1`.

campaign_typestring

This attribute allows filtering by campaign type.

One ofPROMOTIONGIFT_VOUCHERSREFERRAL_PROGRAMDISCOUNT_COUPONSLOYALTY_PROGRAM

expandstring

Includes an expanded `categories` object in the response. If the [Areas and Stores](/orchestrate/areas-and-stores) Enterprise feature is enabled, add `access_settings_assignments` to return assigned areas and stores.

One ofcategoryaccess_settings_assignments

campaign_statusstring

Sorts the results by the status of the campaign.

One ofDONEIN_PROGRESSFAILEDDRAFTMODIFYING

is_referral_codeboolean

Sorts the results that are or are not referral campaigns.

orderstring

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

One ofcreated_at-created_atupdated_at-updated_at

filtersobject

Filters the results by various campaign properties.

campaignsobject1 fields

Name of the campaign.

campaigns_idobject1 fields

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

campaign_statusobject1 fields

Status of the campaign. Allowed values: `DONE`, `IN_PROGRESS`, `DRAFT`, `FAILED` `MODIFYING`

statusobject1 fields

Filters campaigns by their code generation status. Pass the filter as an empty object, for example `filters[status][conditions][$active]=`

activeobject4 fields

Filters campaigns by their `active` state. Pass the filter as an empty object, for example `filters[active][conditions][$enabled]=`.

is_referral_codeobject1 fields

Determines if the campaign is or is not a referral campaign.

validity_timeframeobject1 fields

Filter by validity timeframe

voucher_typeobject1 fields

Type of the voucher. Allowed values: `DISCOUNT_VOUCHER`, `GIFT_VOUCHER`, `LOYALTY_CARD`.

categoriesobject1 fields

Filter by categories names

category_idsobject1 fields

Filter by categories IDs

typeobject1 fields

Type of the campaign. Allowed values: `AUTO_UPDATE`, `BULK`, `STANDALONE`, `STATIC`. `BULK` is a virtual type that returns campaigns with the `AUTO_UPDATE` or `STATIC` type.

created_dateobject1 fields

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

updated_atobject1 fields

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

start_dateobject1 fields

Timestamp representing the date and time when the campaign starts to be active. Campaign is *inactive before* this date. The value is shown in the ISO 8601 format.

expiration_dateobject1 fields

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

validity_day_of_weekobject1 fields

Filters days of week when the campaign is active. The value is an integer array corresponding to the particular days of the week in which the campaign is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday If the campaign is valid throughout all week days, it is always returned.

junctionstring

Logical Operator Between Filters. Filter by conditions set on the `junction` parameter indicating how the `conditions` should be accounted for in the query. An `AND` is an all-inclusive logical operator, meaning the `AND` operator displays a record if **ALL** the conditions separated by AND are TRUE, while an `OR` operator displays a record if **ANY** of the conditions separated by OR is TRUE.

One ofandor

access_settingsobject

Filter by areas and stores IDs to return campaigns that are assigned to areas, stores, and all stores in an area.

filterobject3 fields

Response

Returns 200 with an object. Read it in later steps with {{listCampaigns.response.data.<field>}}.

objectstring

The type of the object represented by JSON. This object stores information about campaigns in a dictionary.

Default "list"

data_refstring

Identifies the name of the attribute that contains the array of campaign objects.

Default "campaigns"

campaignsarray<object>

Contains array of campaign objects.

idstring

Unique campaign ID, assigned by Voucherify.

namestring

Campaign name.

descriptionstring

An optional field to keep any extra textual information about the campaign such as a campaign description and details.

campaign_typestring

Type of campaign.

One ofLOYALTY_PROGRAMGIFT_VOUCHERSDISCOUNT_COUPONSPROMOTIONREFERRAL_PROGRAM

typestring

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 criteria - `STATIC`: vouchers need to be manually published - `STANDALONE`: campaign for single vouchers

One ofAUTO_UPDATESTATICSTANDALONE

voucherobject12 fields

Schema model for a campaign voucher.

auto_joinboolean

Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled.

join_onceboolean

If this value is set to `true`, customers will be able to join the campaign only once. It is always `false` for generic (standalone) vouchers campaigns and it cannot be changed in them. It is always `true` for loyalty campaigns and it cannot be changed in them.

use_voucher_metadata_schemaboolean

Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema.

validity_timeframeobject2 fields

Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.`start_date` **required** when including the `validity_timeframe`.

validity_day_of_weekarray<integer>

Integer array corresponding to the particular days of the week in which the voucher is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday

validity_hoursobject1 fields

Determines the hours of validity, e.g. to create a happy hours scenario.

activity_duration_after_publishingstring

Defines the amount of time the vouchers will be active after publishing. The value is shown in the ISO 8601 format. For example, a voucher with the value of P24D will be valid for a duration of 24 days.

vouchers_countinteger

Total number of unique vouchers in campaign.

start_datestring (date-time)

Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date.

expiration_datestring (date-time)

Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date.

activeboolean

A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* campaign - `false` indicates an *inactive* campaign

metadataobject

The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format.

created_atstring (date-time)

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

updated_atstring (date-time)

Timestamp representing the date and time when the campaign was last updated in ISO 8601 format.

categorystring

Unique category name.

creation_statusstring

Indicates the status of the campaign creation.

One ofDONEIN_PROGRESSFAILEDDRAFTMODIFYING

vouchers_generation_statusstring

Indicates the status of the campaign's voucher generation.

One ofDONEIN_PROGRESSFAILEDDRAFTMODIFYING

readonlyboolean

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](/api-reference/campaigns/get-campaign-summary) endpoint.

protectedboolean

Indicates whether the resource can be deleted.

category_idstring

Unique category ID that this campaign belongs to.

categoriesarray<object>6 fields

Contains details about the campaign category. For the GET [List campaigns](/api-reference/campaigns/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](/api-reference/campaigns/get-campaign-summary) endpoint, it is always returned as an empty array.

objectstring

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

Default "campaign"

referral_programobject3 fields

Defines the referee reward and the way a referral is triggered. Context: `REFERRAL_PROGRAM`.

loyalty_tiers_expirationobject4 fields

Defines the Loyalty Tiers Expiration.

access_settings_assignmentsobject4 fields

Lists all assignments of the campaign to areas and stores. For [GET List Campaigns](/api-reference/campaigns/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](/api-reference/campaigns/get-campaign-summary). **NOTE**: This object is returned only if the Areas and Stores enterprise feature is enabled. Contact [Voucherify Sales](https://www.voucherify.io/contact-sales) to learn more.

totalinteger

Total number of campaigns.

json
{
  "object": "list",
  "data_ref": "campaigns",
  "campaigns": [
    {
      "id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA",
      "name": "string",
      "description": "string",
      "campaign_type": "LOYALTY_PROGRAM",
      "type": "AUTO_UPDATE",
      "voucher": {
        "code_config": null,
        "type": "string",
        "discount": null,
        "gift": null,
        "loyalty_card": null,
        "redemption": {
          "quantity": 0
        },
        "is_referral_code": false,
        "start_date": "2022-09-20T00:00:00.000Z",
        "expiration_date": "2022-09-30T00:00:00.000Z",
        "validity_timeframe": {
          "duration": "PT1H",
          "interval": "P2D"
        },
        "validity_day_of_week": [
          0
        ],
        "validity_hours": {
          "daily": [
            {
              "start_time": null,
              "days_of_week": null,
              "expiration_time": null
            }
          ]
        }
      },
      "auto_join": false,
      "join_once": false,
      "use_voucher_metadata_schema": false,
      "validity_timeframe": {
        "duration": "PT1H",
        "interval": "P2D"
      },
      "validity_day_of_week": [
        0
      ],
      "validity_hours": {
        "daily": [
          {
            "start_time": "12:00",
            "days_of_week": [
              null
            ],
            "expiration_time": "14:00"
          }
        ]
      }
    }
  ],
  "total": 0
}

Need more? See the Voucherify guide for connection setup and behaviour shared by every action.