I am new to working with Marketo. I've been asked to sync our email unsubscribes with the Marketo unsubscribes through the API. I need to pull unsubscribes back from Marketo and also send Marketo any unsubscribes that we have that they don't have. What endpoints would I use for these activities?
Solved! Go to Solution.
In Marketo, “unsubscribes” isn’t really the best term. Rather, we’d say “people with the system field Unsubscribed set to true.” There is an activity Unsubscribed from Email but that’s not the only way the field gets changed.
Any endpoint that can set that field can be used, including Sync Lead, Push Lead, and Bulk Lead Import.
To extract you’ll need to use Bulk Export (paginated) or Bulk Extract (CSV). Extract could be run against a Smart List that has a filter on Unsubscribed [is] true.
In Marketo, “unsubscribes” isn’t really the best term. Rather, we’d say “people with the system field Unsubscribed set to true.” There is an activity Unsubscribed from Email but that’s not the only way the field gets changed.
Any endpoint that can set that field can be used, including Sync Lead, Push Lead, and Bulk Lead Import.
To extract you’ll need to use Bulk Export (paginated) or Bulk Extract (CSV). Extract could be run against a Smart List that has a filter on Unsubscribed [is] true.
To Sandy's point -
You can use the leads endpoint to update the Unsubscribed field - you can set the 'action' attribute to 'updateOnly', or 'createOrUpdate' in the request body if you want to update the existing records only, or create any non-existing and update existing records respectively. You can use the get leads endpoint to get the lead data - you would want to pass the 'Unsubscribed' field in the "fields" parameter since you're querying for leads' Unsubscribed field. If you have fairly larger # of records to query - you can use the bulk import/export APIs as well.
Updating records via a simple list import in Marketo may be fairly easier and simpler in-case you're able to export the records with Email Address and Unsubscribed field's value in the CSV file format from the platform.