List Campaigns
Retrieve a list of campaigns in a project.
The campaigns are returned sorted by creation date, with the most recent campaigns appearing first.
When you get a list of campaigns, you can optionally specify query parameters to customize the amount of campaigns returned per call using limit, which page of campaigns to return using page, sort the campaigns using the order query parameter and filter the results by the campaign_type.
This method will return an error when trying to return a limit of more than 100 campaigns.
Query parameters
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.
Which page of results to return. The lowest value is 1.
This attribute allows filtering by campaign type.
Includes an expanded categories object in the response. If the Areas and Stores Enterprise feature is enabled, add access_settings_assignments to return assigned areas and stores.
Status of the campaign. Allowed values: DONE, IN_PROGRESS, DRAFT, FAILED MODIFYING
Sorts the results by the status of the campaign.
Lists campaigns that have or do not have referral codes.
Sorts the results that are or are not referral campaigns.
Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
Filters the results by various campaign properties.
{
"validity_timeframe": {
"conditions": {
"$after": "2024-01-01T00:00:00.000Z",
"$before": "2024-01-01T00:00:00.000Z"
}
},
"created_date": {
"conditions": {
"$after": "2024-01-01T00:00:00.000Z",
"$before": "2024-01-01T00:00:00.000Z"
}
},
"updated_at": {
"conditions": {
"$after": "2024-01-01T00:00:00.000Z",
"$before": "2024-01-01T00:00:00.000Z"
}
},
"start_date": {
"conditions": {
"$after": "2024-01-01T00:00:00.000Z",
"$before": "2024-01-01T00:00:00.000Z"
}
},
"expiration_date": {
"conditions": {
"$after": "2024-01-01T00:00:00.000Z",
"$before": "2024-01-01T00:00:00.000Z"
}
}
}Filter by areas and stores IDs to return campaigns that are assigned to areas, stores, and all stores in an area.
{
"filter": {
"areas_ids": [
"ar_0ab12cde3456789fgh"
],
"area_all_stores_ids": [
"ar_0ab12cde3456789fgh"
],
"area_stores_ids": [
"ars_0ab12cde3456789fgh"
]
}
}Response
Returns a dictionary with a campaign property that contains an array of campaigns. The maximum number of campaigns returned is determined by the limit query parameter. Each entry in the array is a separate campaign object. If no more campaigns are available, the resulting array on a given page will be empty.
Example response
{
"campaigns": [
{
"id": "camp_f7fBbQxUuTN7dI7tGOo5XMDA",
"voucher": {
"start_date": "2022-09-20T00:00:00.000Z",
"expiration_date": "2022-09-30T00:00:00.000Z",
"validity_timeframe": {
"duration": "PT1H",
"interval": "P2D"
},
"validity_hours": {
"daily": [
{
"start_time": "12:00",
"expiration_time": "14:00"
}
]
}
},
"validity_timeframe": {
"duration": "PT1H",
"interval": "P2D"
},
"validity_hours": {
"daily": [
{
"start_time": "12:00",
"expiration_time": "14:00"
}
]
},
"start_date": "2022-09-20T00:00:00.000Z",
"expiration_date": "2022-09-30T00:00:00.000Z",
"created_at": "2021-12-01T08:00:50.038Z",
"updated_at": "2022-09-20T09:18:19.623Z",
"category_id": "cat_0b688929a2476386a7",
"categories": [
{
"created_at": "2022-07-14T10:45:13.156Z",
"updated_at": "2022-08-16T10:52:08.094Z"
}
],
"referral_program": {
"custom_event": {
"id": "ms_Ll9enAm2BCN0M1s4VxWobLFM"
},
"referee_reward": {
"related_object_parent": {
"id": "camp_kdxp3vf1clQ9CFs1jpqv3tZe"
}
}
},
"access_settings_assignments": {
"data": [
{
"id": "arsca_0ef5ee192117ae2416",
"area_id": "ar_0ea6cd7b781b8f857f",
"area_store_id": "ars_0ec347e2016bed85f4",
"created_at": "2024-06-25T19:04:16.260Z"
}
]
}
}
]
}