The PitchButler API: Push Leads In, Pull Hot Leads Out, in Ten Minutes

PitchButler finds the right person at a company, writes a considered first email from your own Gmail, reads every reply and hands the interested ones to you. The API is how you plug that into the tools you already run: push a lead in from your CRM or a website form, and pull back who went hot.

This guide takes you from nothing to a working integration in about ten minutes. The full reference lists every endpoint and field.

1. Create an API key

In PitchButler, open Settings, then the API tab (or Integrations, then API access). Click New key, give it a name that says where it will live (“HubSpot sync”, “Website form”), and choose the scope:

  • read lists campaigns and leads and tells you who went hot. Every key has it.
  • write also lets the key add leads and mark a lead do-not-contact. Tick it only for integrations that push data in.

You can give a key an expiry (30 days, 90 days, a year). The key is shown exactly once. Store it in your integration’s secret settings, never in a shared document or in client-side code.

Only a workspace admin can create or revoke keys. Revoking stops a key immediately; every integration using it starts getting 401s. Up to ten active keys per workspace.

2. Make your first call

Every request carries the key as a bearer token. GET /api/v1/me is the cheapest way to check a key works:

curl https://pitchbutler.io/api/v1/me \
  -H "Authorization: Bearer pb_live_YOUR_KEY"
{
  "tenant": {"id": "…", "name": "Example AB", "slug": "example"},
  "api_key": {"id": "…", "name": "HubSpot sync", "scopes": ["read", "write"]}
}

JSON in, JSON out. Base URL https://pitchbutler.io/api/v1.

3. Find your campaign

A lead usually belongs to a campaign: that is where the follow-up plan, the sender mailboxes and the ideal-customer profile live. List yours to get the id:

curl https://pitchbutler.io/api/v1/campaigns \
  -H "Authorization: Bearer pb_live_YOUR_KEY"

4. Push a lead in

This is the call most integrations are built around. It needs the write scope.

curl -X POST https://pitchbutler.io/api/v1/leads \
  -H "Authorization: Bearer pb_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "anna@example.com",
    "contact_name": "Anna Andersson",
    "company_name": "Example AB",
    "campaign_id": "CAMPAIGN_UUID",
    "custom_fields": {"website": "example.com", "source": "webinar"}
  }'

What happens next is exactly what happens to a row in a CSV import: the lead is born in status enriching, PitchButler researches the company and the person, scores the fit against the campaign’s profile, and only then prepares the first email for the campaign’s send window and mailboxes. In approval mode, the default for a new workspace, that email waits for a person to approve it. You do not write the email and you do not pick the mailbox.

Three things worth knowing:

  • Re-posting is safe. An address your workspace already has comes back with HTTP 200 and "created": false instead of a duplicate. Syncs can retry freely.
  • campaign_id is optional. Without it the lead is still researched, then parked until you assign it to a campaign in the app. API leads land in an import batch named after the key and the day, so they show up on the Leads page like any import.
  • custom_fields reach the AI. A website field helps research find the right company. Keys are lowercased. A handful of names are reserved for the pipeline (research, intel, discovery_audit) and are refused.

Optional: timezone as an IANA name (America/New_York) makes the send window follow the lead’s morning instead of the campaign’s.

5. Pull the leads that went hot

hot means the person replied with interest and a human should act. Most integrations poll this once a minute or once an hour and create a deal, a task or a Slack message:

curl "https://pitchbutler.io/api/v1/leads?status=hot&limit=100" \
  -H "Authorization: Bearer pb_live_YOUR_KEY"

Filter by status, campaign_id or search (a plain substring of email, name or company). Page with limit (max 500) and offset; total tells you how many match. Every lead carries status_changed_at, so “hot since my last poll” is a comparison on your side.

6. Respect opt-outs

If someone tells your company to stop, tell PitchButler too. This cancels every pending email, marks the lead unsubscribed and puts the address on the workspace’s permanent suppression list, so it is never contacted again even if re-imported:

curl -X POST https://pitchbutler.io/api/v1/leads/LEAD_UUID/do-not-contact \
  -H "Authorization: Bearer pb_live_YOUR_KEY"

There is no undo through the API. That is deliberate.

Examples in your language

Python

import requests

API = "https://pitchbutler.io/api/v1"
HEADERS = {"Authorization": "Bearer pb_live_YOUR_KEY"}

def add_lead(email, name, company, campaign_id):
    r = requests.post(f"{API}/leads", headers=HEADERS, json={
        "email": email, "contact_name": name,
        "company_name": company, "campaign_id": campaign_id,
    })
    r.raise_for_status()
    return r.json()["lead"]

def hot_leads():
    r = requests.get(f"{API}/leads", headers=HEADERS,
                     params={"status": "hot", "limit": 500})
    r.raise_for_status()
    return r.json()["leads"]

Node

const API = "https://pitchbutler.io/api/v1";
const headers = { Authorization: "Bearer pb_live_YOUR_KEY",
                  "Content-Type": "application/json" };

async function addLead(lead) {
  const res = await fetch(`${API}/leads`, {
    method: "POST", headers, body: JSON.stringify(lead),
  });
  if (!res.ok) throw new Error((await res.json()).detail);
  return (await res.json()).lead;
}

Zapier or Make (no code)

Use the generic Webhooks action with method POST, URL https://pitchbutler.io/api/v1/leads, a header Authorization set to Bearer pb_live_YOUR_KEY, and a JSON body mapped from the trigger (a new form submission, a new CRM contact). The response’s lead.id is worth storing on your side for later lookups.

Errors you will meet

  • 401 the key is missing, revoked or expired. Check the header; create a new key if you lost the old one.
  • 403 the key lacks the write scope for this call.
  • 404 the lead or campaign is not in your workspace.
  • 400 the input is well-formed but wrong (bad email, unknown campaign, a timezone that is not an IANA name). The detail field says what.
  • 422 the body does not match the schema (missing email, a campaign_id that is not a UUID). error.fields names the field.
  • 429 slow down: 120 requests per minute per key. Honour the Retry-After header.
  • 503 we are briefly unavailable. Retry after the Retry-After seconds; your key is fine.

Every error body carries a detail string you can show to a human.

What is not in the API yet

Outbound webhooks (PitchButler calling you when a lead goes hot), adding many leads in one call and lead update are on the list. Customer requests decide the order. If one of these would unblock you, tell us.

Found this useful? Join the PitchButler waitlist or read how it works.

Put your outreach in good hands.

We take on 30 new teams a week, no more. Leave an email and we take you in turn.

We use your address only to offer you a slot. Privacy.