Obtain an OAuth 2.0 access token via the Marketo identity endpoint and pass it as an Authorization: Bearer header on all subsequent requests — do not use the access_token query parameter, which is scheduled for removal.
Create the export job by sending POST /bulk/v1/leads/export/create.json with a JSON body specifying the fields array, the format (CSV, TSV, or SSV), optional columnHeaderNames, and exactly one filter — e.g., {"createdAt": {"startAt": "...", "endAt": "..."}} — covering a range of 31 days or fewer.
Enqueue the job by sending POST /bulk/v1/leads/export/{exportId}/enqueue.json using the exportId returned in the create response; the job status will move to Queued and then Processing.
Poll job status with GET /bulk/v1/leads/export/{exportId}/status.json no more than once per minute until status returns Completed; the job queue holds a maximum of 10 jobs and runs at most 2 concurrently.
Download the file with GET /bulk/v1/leads/export/{exportId}/file.json; use an HTTP Range header to support resumable partial downloads if the file is large.
If the job is no longer needed, cancel it with POST /bulk/v1/leads/export/{exportId}/cancel.json to free the queue slot.
Known gotchas
Bulk API endpoints are not prefixed with /rest unlike other Marketo REST endpoints — omitting or adding /rest will produce a 404.
Only one filter type may be specified per export job; attempting multiple filter types returns error 1035 (Unsupported filter type for target subscription) on some accounts.
Status can only be retrieved for jobs created by the same API user that is making the status request.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp