How Marketo Uses the Salesforce API | Community
Skip to main content
Jamie-Carey
Level 4
July 13, 2015

How Marketo Uses the Salesforce API

  • July 13, 2015
  • 12 replies
  • 26816 views

Marketo calls to the Salesforce API

During a single sync session, Marketo makes 25 API calls to check if your Salesforce objects need updating.  Because your Salesforce sync happens in 5 minute intervals (default setting), each day Marketo makes 7200 API calls to your account to see if any updates are needed.

If there are updates, more API calls are used to sync the information.  Leads, Contacts, Accounts, Opportunities, Campaigns, and Activities are synced in batches of 200 per API call.

If you use a Sync Lead to SFDC or Add to Campaign flow step in trigger campaigns, each one uses at least one API call per lead; the API call happens when the lead hits that flow step (instead of waiting for the next sync). Batch campaigns can send up to 200 leads to Salesforce with 1 API call for these flow steps.

Any activities you've synced from Marketo to Salesforce (like "Filled Out Form" or "Opened Email") use an extra API call per event.

You can use these to estimate the number of API calls Marketo makes per day.  For example, if you have 1,000 Lead and Contact updates a day and 100 Account, Opportunity, and Campaign updates, you'll use:

7200 (check for updates) +
(1000 Lead updates / 200 per API call) +
(1000 Contact updates / 200 per API call) +
(100 Account updates / 200 per API call) +
(100 Opportunity updates / 200 per API call) +
(100 Campaign updates / 200 per API call) +

7200 + 5 + 5 + 1 + 1 + 1 = 7213 API calls

When you first sync your Salesforce account to Marketo, you'll use significantly more API calls until Marketo is up to date with your Salesforce instance.  After that, you can expect the API calls to be much lower unless you make large updates to your leads (in Marketo or Salesforce)

API Calls and your Salesforce edition

Salesforce determines your API call limit based on the edition and licenses you have. This document from Salesforce has information on how they calculate that limit.

For many Salesforce users, particularly Enterprise Edition users, the number of API calls made by Marketo is usually not a problem.

If you're using a more limited edition of Salesforce or don't have many Salesforce licenses, you may hit the daily limit on your API calls.  In that case, please contact Marketo Support and ask us to decrease your sync interval.  At a 30 minute sync interval, Marketo uses around 1000 API calls per day, well under the limit for nearly every Salesforce edition.

To see your API limit (per 24 hour period) and your current usage (for past 24 hours) in SFDC,  navigate to:

Setup -> Administration Setup -> Company Profile -> Company Information

Look for the field called "API Requests, Last 24 Hours", which will display API usage for the past 24-hour period as well as your current 24-hour limit (in parenthesis).

Order of Events during SFDC Sync

Marketo will sync your SFDC and Marketo objects in the following order:

  • Lead: synch schema
  • Account: synch schema
  • Contact: synch schema
  • User: synch schema
  • Task: synch schema
  • Opportunity: synch schema
  • Opportunity Contact Role: synch schema
  • Campaign: synch schema
  • Campaign Member: synch schema
  • Campaign Member Status: synch schema
  • Lead: pull conversions
  • Account: pull deletes
  • Account: pull updates
  • User: pull updates
  • Lead Queue: pull updates
  • Lead Status: pull updates
  • Account Type: pull updates
  • Lead: pull deletes
  • Contact: pull deletes
  • Lead: pull updates
  • Contact: pull updates
  • Lead: push updates
  • Contact: push updates
  • Campaign: pull deletes
  • Campaign Member: pull deletes
  • Campaign Member Status: pull deletes
  • Campaign: pull updates
  • Campaign Member: pull updates
  • Campaign Member Status: pull updates
  • Opportunity: pull deletes
  • Opportunity Contact Role: pull deletes
  • Opportunity: pull updates
  • Opportunity Contact Role: pull updates
  • Event: pull updates
  • Task: pull updates
  • Email Template: push new
  • Email Template: push updates
  • Task: push new
  • Task: push updates

12 replies

July 13, 2015

Helpful stuff. I do have a few questions: where do custom object syncs fall in the Order of Events and the impact on syncs? For example, we have related records tied to an account. Would each account sync automatically include the child object records or is each child record sync consuming an API call?

Jamie-Carey
Level 4
July 13, 2015

Hey Mark,

That is a great question. I think that @Tim Davis​ or @Calvin Lam​ may be good resources here.

Kenny_Elkington
Adobe Employee
Adobe Employee
July 13, 2015

Hi Mark,

Custom Obect sync is ordered at the end of each sync cycle and behaves the same as any other object type for the bidirectional sync, pulling up to 200 updated records per API call.  They are not retrieved as part of the retrieval process for their parent objects.

Jamie-Carey
Level 4
July 13, 2015

Thanks Kenny!

July 29, 2015

Thanks!

September 2, 2015

This is great information.  If I want to dive into the next level of the data, how do I track/understand what Marketo actions drove a big SF API sync?  Where can I find that Marketo log information?

eg., We made 50,000 API calls yesterday, which is 3x more than normal.  How do I figure out what generated the call and why it would be 3x more?

Thanks,

Jeff

September 3, 2015

Are you sure the increase in API calls came from Marketo?

If not, you can check the API usage in Salesforce by going to:

     Reports > Administrative Reports > API Usage Last 7 Days

If that isn't detailed enough, you can download a detailed report for the Marketo sync user:

     User > Login History > "Download login history for last fix months"

If you know it came from Marketo, here are a few causes of increased API usage:

- Modifying/adding many records. This could include updating many records in one day... or adding new custom objects to the sync. The Marketo sync is very efficient though, so it would take about 6 million records to cause an extra 30,000 API calls just from this (30,000 API calls at 200 records per call).

- Lots of marketing activity. If your Marketo-to-Salesforce sync is setup to create activities, this can cause a big spike if you have a particularly effective campaign (again, it would take a ton of records to account for the ~30k difference)

- Having many Salesforce formulas. After much troubleshooting, this was the cause of our massive API usage (which increased gradually over a few months). Try hiding the unnecessary formulas from Marketo (warning: updating the formula values in Marketo after unhiding them can be a pain... so be sure you wont need them in Marketo later on).

I hope his helps!

September 4, 2015

Thanks for the response.

Yes, the Salesforce report "API activity last 7 days" told me it was

Marketo.

We did add 3000 leads to a campaign....but as you say, that should not

create 20,000 API calls. Per your support pages document, of 200 updates

per call, adding 3000 leads would only be 15-20 calls. So I don't know

what happened.

What Saleforce formulas are you talking about? Formulas w/in a SFDC

field? We don't have many of those. handful tops...mostly in opps, which

were not effected here.

Thanks for the info. Wish I had better logs.

Jeff

On Thu, Sep 3, 2015 at 3:39 PM, Adriel Briscoe <marketingnation@marketo.com>

Jamie-Carey
Level 4
September 4, 2015

Do you have "campaign inspector" turned on? It's a feature in the Treasure Chest. You could look through all the SFDC related flow steps in campaigns to see what else may have been triggered during that timeframe.

June 9, 2016

How/when does this sync fire off triggered campaigns in marketo? I'm looking for an 'order of operations,' similar to what salesforce has: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm

More specifically, when does the "Lead is Created" trigger fire? Does it fire once the lead or contact record has finished updating? Or does it fire while the record is updating?