InTouch Hub · Blue Isle Software

Marketo

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

Provided free and as is, without warranty of any kind — including merchantability, fitness for a particular purpose, and the accuracy or completeness of any result. See the licence. You are responsible for checking what this produces before relying on it.

campaignsemailleadleadsmarketingmarketing-emailstatussync

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 URL — Admin > Integration > Web Services (the "Identity" REST URL, usually https://<munchkin-id>.mktorest.com/identity).
  2. Client Id / Client Secret — Admin > 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.

Publishes

The keys a later task may reference as {{taskName.key}}. Referencing anything not listed here resolves to nothing at run time.

Input Properties

Every property this tool accepts, from its own tool.iml.

Property Type Required Default Description
apiKey string yes — Marketo OAuth credential packed as 'identityUrl|clientId|clientSecret' (e.g. https://123-ABC-456.mktorest.com/identity||). Get clientId/clientSecret from Admin > Integration > LaunchPoint, and the Identity URL from Admin > Integration > Web Services. The tool performs the client_credentials token exchange itself. (Alternatively, pass an already-issued bearer token here and also set instanceUrl.)
operation string yes — One of: get_leads, sync_leads, trigger_campaign, get_activities
instanceUrl string no — Marketo REST host (e.g. https://123-ABC-456.mktorest.com). Only required when apiKey is a raw bearer token instead of the packed 'identityUrl|clientId|clientSecret' form.
filterType string no — get_leads: field to filter on (e.g. email, id, leadId). Required for get_leads.
filterValues string no — get_leads: up to 300 comma-separated values to match against filterType. Required for get_leads.
fields string no — get_leads: comma-separated list of lead fields to return (e.g. email,firstName,lastName).
batchSize string no — get_leads: page size (max 300).
leads string no — JSON array. For sync_leads, lead objects (e.g. [{"email":"[email protected]","firstName":"Ann"}], up to 300). For trigger_campaign, lead refs (e.g. [{"id":318581}], up to 100). Required for sync_leads and trigger_campaign.
action string no — sync_leads: one of createOrUpdate (default), createOnly, updateOnly, createDuplicate.
lookupField string no — sync_leads: primary key field to match on (defaults to email server-side).
campaignId string no — trigger_campaign: the smart campaign id (must have a 'Campaign is Requested' / Web Service API trigger). Required for trigger_campaign.
tokens string no — trigger_campaign: optional JSON array of My Token overrides (e.g. [{"name":"{{my.message}}","value":"Hello"}], up to 100).
nextPageToken string no — get_activities: paging token from a previous response or the paging-token endpoint. If omitted, supply sinceDatetime to bootstrap one.
sinceDatetime string no — get_activities: ISO-8601 datetime (e.g. 2024-01-01T00:00:00Z) used to fetch an initial paging token when nextPageToken is not supplied.
activityTypeIds string no — get_activities: up to 10 comma-separated activity type ids. Required for get_activities.
leadIds string no — get_activities: optional, up to 30 comma-separated lead ids to narrow results.
listId string no — get_activities: optional static list id to narrow results.