PostHero API

v1 Reference

Lead Magnets

Lead Magnets are LinkedIn comment-to-DM automations. Watch any LinkedIn post for comments containing your keywords, then capture commenters as leads, reply to their comment, and/or DM them your lead magnet automatically. Access: requires the API plan plus a Pro plan or higher. API-only users will receive a 403 PLAN_UPGRADE_REQUIRED error. Workflow types When creating a lead magnet, choose one of three workflows: - full — DM the lead magnet + auto-connect + reply to the comment + optional follow-ups - comments_only — Reply to the matched comment only, no DM, no connection request - collect_only — Capture commenters as leads (great for webhooks), no outbound action Template requirements per workflow - fulltemplates.dm is required - comments_onlytemplates.commentReplies (non-empty array) is required - collect_only → no template required Lifecycle 1. Create the lead magnet (POST /lead-magnets). Pass activate: true to start it immediately, or omit to keep it paused. 2. Cron picks up active automations and watches the post for new comments. 3. Matched commenters appear in GET /lead-magnets/:id/leads and (if configured) trigger your webhook. 4. Pause anytime with POST /lead-magnets/:id/pause. Outreach account Lead magnets run on a LinkedIn outreach account — the same connection that powers Outreach and Comment automations. This is separate from the LinkedIn account used for posting. Get the outreachAccountId from GET /accounts/outreach and pass it when creating or updating a lead magnet. The user must have at least one outreach account connected.