Smart Lists Endpoint Reference
Marketo offers a set of REST APIs for performing operations on smart lists. These APIs follow the standard interface pattern for asset APIs providing Query, Delete, and Clone options.
Query
Querying smart lists follows the standard query types for assets of by id, by name, and browse.
By Id
Query by id takes a single smart list id as a path parameter and returns a single smart list record. Optionally you may pass the includeRules boolean parameter to include smart list rules in the response.
1 |
GET /rest/asset/v1/smartList/{id}.json?includeRules=true |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
{ "success": true, "errors": [], "requestId": "6efc#16c8967a21f", "warnings": [], "result": [ { "id": 4363, "name": "Smart List Test 01", "createdAt": "2019-06-03T23:01:13Z+0000", "updatedAt": "2019-06-04T17:37:45Z+0000", "url": "https://app-sjqe.marketo.com/#SL4363A1LA1", "folder": { "id": 1041, "type": "Program" }, "workspace": "Default", "rules": { "filterMatchType": "all", "triggers": [], "filters": [ { "id": 459, "name": "Visited Web Page", "ruleTypeId": 1, "ruleType": "Activity", "operator": "occurs", "conditions": [ { "activityAttributeId": 1, "activityAttributeName": "Web Page", "operator": "is", "values": [ "Program Test.Landing Page Test 01" ], "isPrimary": true }, { "activityAttributeId": 6, "activityAttributeName": "Browser", "operator": "is", "values": [ "Chrome" ], "isPrimary": false }, { "activityAttributeId": -101, "activityAttributeName": "Date of Activity", "operator": "in past", "values": [ "30 days" ], "isPrimary": false } ] } ] } } ] } |
By Smart Campaign Id
Query by smart campaign id takes a single smart campaign id as a path parameter and returns a single smart list record. Optionally you may pass the includeRules boolean parameter to include smart list rules in the response.
1 |
GET /rest/asset/v1/smartCampaign/{smartCampaignId}/smartList.json |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
{ "success": true, "errors": [], "requestId": "6efc#16c8967a21f", "warnings": [], "result": [ { "id": 4363, "name": "Smart List Test 01", "createdAt": "2019-06-03T23:01:13Z+0000", "updatedAt": "2019-06-04T17:37:45Z+0000", "url": "https://app-sjqe.marketo.com/#SL4363A1LA1", "folder": { "id": 1041, "type": "Program" }, "workspace": "Default" } ] } |
By Program Id
Query by program id takes a single email program id as a path parameter and returns a single smart list record. Optionally you may pass the includeRules boolean parameter to include smart list rules in the response.
1 |
GET /rest/asset/v1/program/{programId}/smartList.json |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
{ "success": true, "errors": [], "requestId": "6efc#16c8967a21f", "warnings": [], "result": [ { "id": 4363, "name": "Smart List Test 01", "createdAt": "2019-06-03T23:01:13Z+0000", "updatedAt": "2019-06-04T17:37:45Z+0000", "url": "https://app-sjqe.marketo.com/#SL4363A1LA1", "folder": { "id": 1041, "type": "Program" }, "workspace": "Default" } ] } |
By Name
Query by name takes a smart list name as a parameter and returns a single smart list record. An exact string match is performed against all smart list names in the instance, and returns a result for the smart list matching that name.
1 |
GET /rest/asset/v1/smartList/byName.json?name=2018 Leads |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
{ "success": true, "errors": [], "requestId": "115d7#16423bc13b4", "result": [ { "id": 283988, "name": "2018 Leads", "createdAt": "2008-10-07T15:20:39Z+0000", "updatedAt": "2010-04-13T15:34:32Z+0000", "url": "https://app-abm.marketo.com/#SL283988A1", "folder": { "id": 31, "type": "Folder" }, "workspace": "Default" } ] } |
Browse
Smart lists can also be retrieved in batches. The folder parameter can be used to specify the parent folder under which the query will be performed and is formatted as a JSON object containing id and type. Like other bulk asset retrieval endpoints, offset and maxReturn are optional parameters that can be used for for paging. The optional earliestUpdatedAt and latestUpdatedAt datetime parameters can be used to filter the results by UpdatedAt date range.
1 |
GET /rest/asset/v1/smartLists.json?folder={"id":31,"type":"Folder"} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
{ "success": true, "errors": [], "requestId": "9aa4#16423c0e969", "result": [ { "id": 283988, "name": "2018 Leads", "createdAt": "2008-10-07T15:20:39Z+0000", "updatedAt": "2010-04-13T15:34:32Z+0000", "url": "https://app-abm.marketo.com/#SL283988A1", "folder": { "id": 31, "type": "Folder" }, "workspace": "Default" }, { "id": 299697, "name": "Active Prospects", "createdAt": "2008-10-17T02:09:49Z+0000", "updatedAt": "2010-03-27T18:27:46Z+0000", "url": "https://app-abm.marketo.com/#SL299697A1", "folder": { "id": 31, "type": "Folder" }, "workspace": "Default" }, { "id": 400517, "name": "Leads by Score", "createdAt": "2009-01-07T18:52:52Z+0000", "updatedAt": "2010-04-13T15:36:09Z+0000", "url": "https://app-abm.marketo.com/#SL400517A1", "folder": { "id": 31, "type": "Folder" }, "workspace": "Default" } ] } |
Clone
Cloning a smart list is executed with an application/x-www-form-urlencoded POST. The smart list to clone is specified in the id path parameter. The folder parameter is used to specify the parent folder under which the smart list will be created and is formatted as a JSON object containing id and type. Note that the parent folder must be either a Program or a Smart List folder. The name parameter is used to name the new smart list and must be unique. Optionally the description parameter may be used to describe the smart list.
1 |
POST /rest/asset/v1/smartList/{id}/clone.json |
1 |
Content-Type: application/x-www-form-urlencoded |
1 |
folder={"id":31,"type":"Folder"}&name=2018 Leads Qualified |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
{ "success": true, "errors": [], "requestId": "a672#16423d755ed", "result": [ { "id": 788645, "name": "2018 Leads Qualified", "createdAt": "2018-06-21T19:34:32Z+0000", "updatedAt": "2018-06-21T19:34:32Z+0000", "url": "https://app-abm.marketo.com/#SL788645A1", "folder": { "id": 31, "type": "Folder" }, "workspace": "Default" } ] } |
Delete
Deleting a smart list takes a single smart list id as a path parameter.
1 |
POST /rest/asset/v1/smartList/{id}/delete.json |
1 2 3 4 5 6 7 8 9 10 |
{ "success": true, "errors": [], "requestId": "8f5#16423dd0fbe", "result": [ { "id": 788645 } ] } |