InTouch Hub · Blue Isle Software

Marketo

Sync leads, trigger smart campaigns, and pull activities via the Marketo (Adobe Marketo Engage) REST API.

marketomarketingleadscampaigns

Marketo

Sync leads, trigger smart campaigns, and pull activities via the Marketo (Adobe Marketo Engage) REST API.

Grounded in the official Marketo REST API reference (https://developers.marketo.com/rest-api/, now hosted on Adobe Experience League). Standard-library Python only (urllib, json, base64) — no third-party packages.

What it does

The tool authenticates with Marketo using OAuth 2.0 client_credentials, fetches a short-lived bearer token, and then calls the REST API on your instance host (https://<munchkin-id>.mktorest.com). It returns the raw Marketo JSON response as result and the HTTP status as status.

Operations

operation Method / endpoint Purpose
get_leads GET /rest/v1/leads.json Read leads by filter
sync_leads POST /rest/v1/leads.json Create/update (upsert) up to 300 leads
trigger_campaign POST /rest/v1/campaigns/{id}/trigger.json Run up to 100 leads through a smart campaign
get_activities GET /rest/v1/activities.json Pull lead activities (paged)

Inputs by operation

apiKey setup

Marketo uses OAuth, not a single static key, so the apiKey packs the three OAuth parts pipe-separated:

<Identity URL>|<Client Id>|<Client Secret>

Example:

https://123-ABC-456.mktorest.com/identity|abcd1234-client-id|s3cr3t-client-secret

Where to find each part in the Marketo Admin console:

  1. Identity URLAdmin > Integration > Web Services (the "Identity" REST URL, usually https://<munchkin-id>.mktorest.com/identity).
  2. Client Id / Client SecretAdmin > Integration > LaunchPoint → create (or open) a Custom Service, then View Details.

The tool performs the token exchange for you:

GET <Identity URL>/oauth/token?grant_type=client_credentials&client_id=…&client_secret=…

and sends the returned token as Authorization: Bearer <access_token> on each call (query-param tokens are being removed 2026-07-31, so the header form is used).

Alternative: if you already have a valid bearer token, pass it directly as apiKey (no |) and set instanceUrl to your REST host (https://<munchkin-id>.mktorest.com).

Examples

Look up leads by email

operation:    get_leads
apiKey:       https://123-ABC-456.mktorest.com/identity|<clientId>|<clientSecret>
filterType:   email
filterValues: [email protected],[email protected]
fields:       email,firstName,lastName

Upsert leads

operation: sync_leads
apiKey:    https://123-ABC-456.mktorest.com/identity|<clientId>|<clientSecret>
leads:     [{"email":"[email protected]","firstName":"Ann","lastName":"Lee"}]
action:    createOrUpdate

Trigger a smart campaign for two leads

operation:  trigger_campaign
apiKey:     https://123-ABC-456.mktorest.com/identity|<clientId>|<clientSecret>
campaignId: 1234
leads:      [{"id":318581},{"id":318582}]
tokens:     [{"name":"{{my.message}}","value":"Welcome aboard"}]

Pull lead activities since a date

operation:       get_activities
apiKey:          https://123-ABC-456.mktorest.com/identity|<clientId>|<clientSecret>
sinceDatetime:   2024-01-01T00:00:00Z
activityTypeIds: 1,12,13

Output

{ "result": "<raw Marketo JSON response>", "status": "200" }

A non-2xx HTTP response is returned as-is (with its status) so you can inspect Marketo error codes (e.g. 601/602 token errors). A transport-level failure returns {"error": "<message>"} and fails the step.