{"servers":[{"url":"/api/v1"}],"info":{"title":"Ballast API","version":"1.0.0","description":"Cold email: campaigns, leads, mailboxes, replies and analytics. Guide: https://ballast.to/docs/api"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"A workspace API key (bl_...) from Settings, API keys"}}},"security":[{"apiKey":[]}],"openapi":"3.1.1","paths":{"/ping":{"get":{"operationId":"ping","summary":"Liveness check","tags":["Workspace"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"time":{"type":"string"}},"required":["ok","time"]}}}}}}},"/check":{"get":{"operationId":"checker.check","summary":"Grade a sending domain","description":"Checks MX, SPF, DKIM, DMARC, blacklists and domain age. Results are cached for 10 minutes.","tags":["Domain checker"],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","maxLength":300,"description":"Domain to grade, e.g. yourdomain.com. URLs and email addresses are accepted."},"allowEmptyValue":true,"allowReserved":true},{"name":"selector","in":"query","required":false,"schema":{"type":"string","maxLength":130,"description":"Optional custom DKIM selector to check in addition to the common ones."},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"selector":{"anyOf":[{"type":"string"},{"type":"null"}]},"exists":{"type":"boolean"},"score":{"type":"integer","minimum":0,"maximum":100},"grade":{"enum":["A","B","C","D","F"],"type":"string"},"verdict":{"type":"string"},"mxFamily":{"enum":["google","microsoft","other","none"],"type":"string"},"mxLabel":{"type":"string"},"checkedAt":{"type":"string"},"durationMs":{"type":"number"},"cached":{"type":"boolean"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"status":{"enum":["pass","warn","fail","info"],"type":"string"},"points":{"type":"number"},"max":{"type":"number"},"summary":{"type":"string"},"details":{"type":"array","items":{"type":"string"}},"fix":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","label","status","points","max","summary","details","fix"]}}},"required":["domain","selector","exists","score","grade","verdict","mxFamily","mxLabel","checkedAt","durationMs","cached","checks"]}}}}}}},"/analytics/overview":{"get":{"operationId":"analytics.overview","summary":"Workspace dashboard: sends, replies, positive replies, bounces, won, mailbox health and when and where replies come from","description":"Counts for the last 7, 30 or 90 days plus the period before for trends. Positive replies and sentiment use the label each reply thread carries now.","tags":["Analytics"],"parameters":[{"name":"days","in":"query","schema":{"type":"number","default":30,"description":"7, 30 or 90 days"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"number"},"timezone":{"type":"string","description":"Workspace timezone: days in the series are calendar days here"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["date","sent","replied","positive","bounced","opened"]}},"totals":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"},"won":{"type":"number"}},"required":["sent","replied","positive","bounced","opened","won"]},"previous":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"},"won":{"type":"number"}},"required":["sent","replied","positive","bounced","opened","won"],"description":"The same counts for the period just before, for trends"},"tracksOpens":{"type":"boolean"},"mailboxes":{"type":"object","properties":{"total":{"type":"number","description":"Connected mailboxes, paused ones left out"},"healthy":{"type":"number","description":"Active and reading their inbox without errors"},"problems":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","status","reason"]}}},"required":["total","healthy","problems"]},"sentiment":{"type":"object","properties":{"positive":{"type":"number"},"negative":{"type":"number"},"neutral":{"type":"number"},"warning":{"type":"number"}},"required":["positive","negative","neutral","warning"]},"heatmap":{"type":"array","items":{"type":"array","items":{"type":"number"}},"description":"Replies by weekday (Monday first) and hour, in each lead's time zone"},"countries":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"ISO 3166-1 alpha-2"},"replies":{"type":"number"}},"required":["code","replies"]}},"repliesWithoutCountry":{"type":"number"},"sending":{"type":"boolean","description":"Something has ever been sent from this workspace"}},"required":["days","timezone","series","totals","previous","tracksOpens","mailboxes","sentiment","heatmap","countries","repliesWithoutCountry","sending"]}}}}}}},"/me":{"get":{"operationId":"workspace.me","summary":"Who am I: the user, workspace and plan behind this key or session","tags":["Workspace"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]},"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"]},"role":{"enum":["owner","admin","member"],"type":"string"},"auth":{"enum":["session","api_key","oauth"],"type":"string"},"billing":{"type":"object","properties":{"plan":{"anyOf":[{"type":"string"},{"type":"null"}]},"planName":{"anyOf":[{"type":"string"},{"type":"null"}]},"interval":{"anyOf":[{"enum":["month","year"],"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailsPerMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emailsSentThisPeriod":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"renewsAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["plan","planName","interval","status","emailsPerMonth","contacts","emailsSentThisPeriod","renewsAt","cancelAtPeriodEnd"]}},"required":["user","workspace","role","auth","billing"]}}}}}}},"/members":{"get":{"operationId":"workspace.members","summary":"Members of this workspace, and pending invites for owners and admins","tags":["Workspace"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"role":{"enum":["owner","admin","member"],"type":"string"},"createdAt":{"type":"string"},"user":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"}},"required":["name","email"]}},"required":["id","userId","role","createdAt","user"]}},"invitations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"type":"string"}},"required":["id","email","role","expiresAt"]}}},"required":["members","invitations"]}}}}}}},"/settings/sending":{"get":{"operationId":"workspace.sendingSettings","summary":"Workspace sending and reply settings shared by every campaign","tags":["Workspace"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"unsubscribeMode":{"enum":["link","reply_text"],"type":"string","description":"What {{unsubscribe}} becomes in every campaign: a one-click link, or a line asking to reply \"stop\""},"aiLabels":{"type":"boolean","description":"Label replies with AI (OpenAI, Google Gemini as fallback, or the workspace's own key from Integrations). Off: only out-of-office, auto-replies and unsubscribe requests are labeled, by rules."},"ownAiKey":{"anyOf":[{"enum":["openai","google"],"type":"string"},{"type":"null"}],"description":"The workspace's own AI key (Integrations): reply labels run on it, so reply text goes to that account, not Ballast's"}},"required":["unsubscribeMode","aiLabels","ownAiKey"]}}}}}},"patch":{"operationId":"workspace.updateSendingSettings","summary":"Change the workspace sending and reply settings","tags":["Workspace"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unsubscribeMode":{"enum":["link","reply_text"],"type":"string","description":"What {{unsubscribe}} becomes in every campaign: a one-click link, or a line asking to reply \"stop\""},"aiLabels":{"type":"boolean","description":"Label replies with AI (OpenAI, Google Gemini as fallback, or the workspace's own key from Integrations). Off: only out-of-office, auto-replies and unsubscribe requests are labeled, by rules."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"unsubscribeMode":{"enum":["link","reply_text"],"type":"string","description":"What {{unsubscribe}} becomes in every campaign: a one-click link, or a line asking to reply \"stop\""},"aiLabels":{"type":"boolean","description":"Label replies with AI (OpenAI, Google Gemini as fallback, or the workspace's own key from Integrations). Off: only out-of-office, auto-replies and unsubscribe requests are labeled, by rules."},"ownAiKey":{"anyOf":[{"enum":["openai","google"],"type":"string"},{"type":"null"}],"description":"The workspace's own AI key (Integrations): reply labels run on it, so reply text goes to that account, not Ballast's"}},"required":["unsubscribeMode","aiLabels","ownAiKey"]}}}}}}},"/api-keys":{"get":{"operationId":"apiKeys.list","summary":"List API keys of this workspace","tags":["API keys"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"start":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]}},"required":["id","name","start","createdAt","lastUsedAt","expiresAt","createdBy"]}}}}}}}},"/apiKeys/create":{"post":{"operationId":"apiKeys.create","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"expiresInDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}],"default":null}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"}},"required":["id","key"]}}}}}}},"/apiKeys/revoke":{"post":{"operationId":"apiKeys.revoke","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/connected-apps":{"get":{"operationId":"apiKeys.apps","summary":"AI apps connected to this workspace over OAuth","tags":["API keys"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"uri":{"anyOf":[{"type":"string"},{"type":"null"}]},"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"connectedAt":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"mine":{"type":"boolean"}},"required":["id","name","uri","user","connectedAt","lastUsedAt","mine"]}}}}}}}},"/connected-apps/{id}/disconnect":{"post":{"operationId":"apiKeys.disconnect","summary":"Disconnect an AI app","description":"Its tokens stop working at once.","tags":["API keys"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/billing":{"get":{"operationId":"billing.status","summary":"Plan, subscription status, emails and AI drafts used this period","tags":["Billing"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"anyOf":[{"type":"string"},{"type":"null"}]},"planName":{"anyOf":[{"type":"string"},{"type":"null"}]},"interval":{"anyOf":[{"enum":["month","year"],"type":"string"},{"type":"null"}]},"status":{"anyOf":[{"type":"string"},{"type":"null"}]},"emailsPerMonth":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"contacts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emailsSentThisPeriod":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"renewsAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelAtPeriodEnd":{"type":"boolean"},"enabled":{"type":"boolean"},"payerIsYou":{"type":"boolean"},"aiDrafts":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Drafts on Ballast's AI keys this month"},"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Monthly allowance of the plan; null with the workspace's own AI key (no allowance) or before a plan"},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resetsAt":{"type":"string","description":"When the count goes back to 0"},"ownKey":{"type":"boolean","description":"The workspace connected its own OpenAI or Gemini key"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when the allowance is used up"}},"required":["used","limit","remaining","resetsAt","ownKey","message"],"description":"Write with AI drafts this month: one draft = one write_sequence or website draft call"},"dedicatedIps":{"type":"object","properties":{"included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Dedicated sending IPs that come with the plan"},"addons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Dedicated sending IPs bought on top"},"inUse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Dedicated proxies serving the workspace now"},"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Fewest add-ons allowed: dedicated proxies in use beyond the included ones"},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"priceUsd":{"type":"number","description":"Price of one add-on per billing cycle of the plan"},"interval":{"enum":["month","year"],"type":"string"}},"required":["included","addons","inUse","min","max","priceUsd","interval"]}},"required":["plan","planName","interval","status","emailsPerMonth","contacts","emailsSentThisPeriod","renewsAt","cancelAtPeriodEnd","enabled","payerIsYou","aiDrafts","dedicatedIps"]}}}}}}},"/billing/checkout":{"post":{"operationId":"billing.checkout","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"enum":["starter","growth","pro","scale","agency"],"type":"string"},"interval":{"enum":["month","year"],"type":"string"},"returnTo":{"enum":["billing","onboarding"],"type":"string","default":"billing"}},"required":["plan","interval"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["url"]}}}}}}},"/billing/portal":{"post":{"operationId":"billing.portal","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}}}}},"/billing/sync":{"post":{"operationId":"billing.sync","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"found":{"type":"boolean"}},"required":["found"]}}}}}}},"/billing/setDedicatedIps":{"post":{"operationId":"billing.setDedicatedIps","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer","minimum":0,"maximum":50}},"required":["quantity"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"included":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Dedicated sending IPs that come with the plan"},"addons":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Dedicated sending IPs bought on top"},"inUse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Dedicated proxies serving the workspace now"},"min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Fewest add-ons allowed: dedicated proxies in use beyond the included ones"},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"priceUsd":{"type":"number","description":"Price of one add-on per billing cycle of the plan"},"interval":{"enum":["month","year"],"type":"string"}},"required":["included","addons","inUse","min","max","priceUsd","interval"]}}}}}}},"/onboarding/createWorkspace":{"post":{"operationId":"onboarding.createWorkspace","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"slug":{"type":"string"},"audience":{"enum":["own","clients"],"type":"string"},"sendingDomain":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]}},"required":["name","slug","audience"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}}}}}}},"/onboarding/save":{"post":{"operationId":"onboarding.save","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sendingDomain":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"expectedVolume":{"type":"integer","minimum":0,"maximum":100000000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/onboarding/draftOffer":{"post":{"operationId":"onboarding.draftOffer","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":3,"maxLength":300}},"required":["url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"company":{"type":"string","maxLength":120,"default":"","description":"Name of the sender's company"},"product":{"type":"string","maxLength":1000,"default":"","description":"What you sell, in a sentence or two"},"audience":{"type":"string","maxLength":1000,"default":"","description":"Who it is for: roles, company types, sizes"},"problem":{"type":"string","maxLength":1000,"default":"","description":"The problem it solves for them"},"proof":{"type":"string","maxLength":2000,"default":"","description":"Proof points with real numbers or customer names, one per line"},"cta":{"type":"string","maxLength":300,"default":"","description":"What you ask for, e.g. a 15 minute call or a reply"},"tone":{"enum":["plain","friendly","direct","formal"],"type":"string","default":"plain"},"avoid":{"type":"string","maxLength":1000,"default":"","description":"Things never to claim or mention, one per line"}}},"url":{"type":"string"}},"required":["profile","url"]}}}}}}},"/mailboxes":{"get":{"operationId":"mailboxes.list","summary":"List mailboxes","description":"Connected sending mailboxes with today's limit, ramp-up and the DNS health of their domain.","tags":["Mailboxes"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mailboxes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"domain":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"enum":["google_app","google_oauth","microsoft","smtp"],"type":"string"},"status":{"enum":["active","paused","error","quarantined"],"type":"string"},"statusReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"dailyLimit":{"type":"number"},"effectiveLimit":{"type":"number","description":"Today's limit after ramp-up"},"rampEnabled":{"type":"boolean"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"rampDay":{"type":"number","description":"Day of the ramp, starting at 1"},"rampDaysLeft":{"type":"number","description":"Days until the ramp reaches the daily limit"},"sentToday":{"type":"number"},"minGapS":{"type":"number"},"maxGapS":{"type":"number"},"timezone":{"type":"string"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}]},"smtp":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string"}},"required":["host","port","security","user"]},{"type":"null"}]},"imap":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string"}},"required":["host","port","security","user"]},{"type":"null"}]},"lastTestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last time the inbox was read for replies and bounces"},"syncError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the last inbox read failed, if it did"},"inboxPoll":{"type":"boolean","description":"Reads the inbox every 60 s instead of keeping an IMAP connection open"},"sendingIp":{"type":"object","properties":{"route":{"enum":["direct","shared","dedicated","own","waiting"],"type":"string","description":"direct = Microsoft Graph or Gmail API (the provider sends); waiting = no sending IP has room yet"},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["route","country","ip"],"description":"Where SMTP and IMAP connections leave from"},"warmup":{"type":"object","properties":{"enabled":{"type":"boolean"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Share of warmup emails in the inbox over 7 days, 0 to 100; null until there's enough data"},"sentToday":{"type":"number"},"targetToday":{"type":"number"},"target":{"type":"number"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"replyRate":{"type":"number"}},"required":["enabled","score","sentToday","targetToday","target","rampStart","rampIncrement","replyRate"]},"createdAt":{"type":"string"},"dns":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"grade":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"badges":{"type":"object","properties":{"mx":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"spf":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"dkim":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"dmarc":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"blacklists":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]}},"required":["mx","spf","dkim","dmarc","blacklists"]}},"required":["score","grade","checkedAt","badges"]},{"type":"null"}]}},"required":["id","email","domain","displayName","provider","status","statusReason","dailyLimit","effectiveLimit","rampEnabled","rampStart","rampIncrement","rampDay","rampDaysLeft","sentToday","minGapS","maxGapS","timezone","signature","smtp","imap","lastTestedAt","lastSyncedAt","syncError","inboxPoll","sendingIp","warmup","createdAt","dns"]}},"microsoftEnabled":{"type":"boolean"},"slotsLeft":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["mailboxes","microsoftEnabled","slotsLeft"]}}}}}},"post":{"operationId":"mailboxes.create","summary":"Connect a mailbox","description":"Tests SMTP and IMAP login first and saves only when both pass. Google needs an app password. Microsoft 365 connects with OAuth from the dashboard.","tags":["Mailboxes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"provider":{"const":"google_app"},"email":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":64},"dailyLimit":{"type":"integer","minimum":1,"maximum":500,"default":30},"displayName":{"type":"string","maxLength":120}},"required":["provider","email","password"]},{"type":"object","properties":{"provider":{"const":"smtp"},"email":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":512},"smtp":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]},"imap":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]},"dailyLimit":{"type":"integer","minimum":1,"maximum":500,"default":30},"displayName":{"type":"string","maxLength":120}},"required":["provider","email","password","smtp","imap"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mailbox":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"domain":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"enum":["google_app","google_oauth","microsoft","smtp"],"type":"string"},"status":{"enum":["active","paused","error","quarantined"],"type":"string"},"statusReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"dailyLimit":{"type":"number"},"effectiveLimit":{"type":"number","description":"Today's limit after ramp-up"},"rampEnabled":{"type":"boolean"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"rampDay":{"type":"number","description":"Day of the ramp, starting at 1"},"rampDaysLeft":{"type":"number","description":"Days until the ramp reaches the daily limit"},"sentToday":{"type":"number"},"minGapS":{"type":"number"},"maxGapS":{"type":"number"},"timezone":{"type":"string"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}]},"smtp":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string"}},"required":["host","port","security","user"]},{"type":"null"}]},"imap":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string"}},"required":["host","port","security","user"]},{"type":"null"}]},"lastTestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last time the inbox was read for replies and bounces"},"syncError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the last inbox read failed, if it did"},"inboxPoll":{"type":"boolean","description":"Reads the inbox every 60 s instead of keeping an IMAP connection open"},"sendingIp":{"type":"object","properties":{"route":{"enum":["direct","shared","dedicated","own","waiting"],"type":"string","description":"direct = Microsoft Graph or Gmail API (the provider sends); waiting = no sending IP has room yet"},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["route","country","ip"],"description":"Where SMTP and IMAP connections leave from"},"warmup":{"type":"object","properties":{"enabled":{"type":"boolean"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Share of warmup emails in the inbox over 7 days, 0 to 100; null until there's enough data"},"sentToday":{"type":"number"},"targetToday":{"type":"number"},"target":{"type":"number"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"replyRate":{"type":"number"}},"required":["enabled","score","sentToday","targetToday","target","rampStart","rampIncrement","replyRate"]},"createdAt":{"type":"string"},"dns":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"grade":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"badges":{"type":"object","properties":{"mx":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"spf":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"dkim":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"dmarc":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"blacklists":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]}},"required":["mx","spf","dkim","dmarc","blacklists"]}},"required":["score","grade","checkedAt","badges"]},{"type":"null"}]}},"required":["id","email","domain","displayName","provider","status","statusReason","dailyLimit","effectiveLimit","rampEnabled","rampStart","rampIncrement","rampDay","rampDaysLeft","sentToday","minGapS","maxGapS","timezone","signature","smtp","imap","lastTestedAt","lastSyncedAt","syncError","inboxPoll","sendingIp","warmup","createdAt","dns"]},{"type":"null"}]},"test":{"type":"object","properties":{"ok":{"type":"boolean"},"smtp":{"anyOf":[{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]},"imap":{"anyOf":[{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]}},"required":["ok","smtp","imap"]},"waiting":{"type":"boolean","description":"Saved, but no sending IP has room yet: it is tested and starts once one does, usually within a day"}},"required":["mailbox","test","waiting"]}}}}}}},"/mailboxes/detect":{"get":{"operationId":"mailboxes.detect","summary":"Suggest connection settings for an email address","tags":["Mailboxes"],"parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"provider":{"enum":["google","microsoft","other","none"],"type":"string"},"providerLabel":{"type":"string"},"smtp":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"}},"required":["host","port","security"]},{"type":"null"}]},"imap":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"}},"required":["host","port","security"]},{"type":"null"}]},"passwordHint":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}},"required":["text","url"]},{"type":"null"}],"description":"Where to make an app password, for providers that refuse the normal one"}},"required":["domain","provider","providerLabel","smtp","imap","passwordHint"]}}}}}}},"/mailboxes/test":{"post":{"operationId":"mailboxes.test","summary":"Test SMTP and IMAP login without saving","tags":["Mailboxes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"provider":{"const":"google_app"},"email":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":64},"dailyLimit":{"type":"integer","minimum":1,"maximum":500,"default":30},"displayName":{"type":"string","maxLength":120}},"required":["provider","email","password"]},{"type":"object","properties":{"provider":{"const":"smtp"},"email":{"type":"string"},"password":{"type":"string","minLength":1,"maxLength":512},"smtp":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]},"imap":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]},"dailyLimit":{"type":"integer","minimum":1,"maximum":500,"default":30},"displayName":{"type":"string","maxLength":120}},"required":["provider","email","password","smtp","imap"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"smtp":{"anyOf":[{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]},"imap":{"anyOf":[{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]}},"required":["ok","smtp","imap"]}}}}}}},"/mailboxes/import":{"post":{"operationId":"mailboxes.import","summary":"Import SMTP/IMAP mailboxes in bulk","description":"Up to 200 mailboxes per call. Each one is tested and saved only if SMTP and IMAP login pass.","tags":["Mailboxes"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rows":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","properties":{"email":{"type":"string"},"displayName":{"type":"string","maxLength":120},"password":{"type":"string","minLength":1,"maxLength":512},"smtp":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]},"imap":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]},"dailyLimit":{"type":"integer","minimum":1,"maximum":500}},"required":["email","password","smtp","imap"]}}},"required":["rows"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"status":{"enum":["added","exists","failed","skipped"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["email","status","error"]}}},"required":["added","results"]}}}}}}},"/mailboxes/{id}":{"patch":{"operationId":"mailboxes.update","summary":"Change a mailbox's limits, signature or status","tags":["Mailboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"displayName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"signature":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"timezone":{"type":"string","maxLength":64},"status":{"enum":["active","paused"],"type":"string","description":"Pause or resume sending from this mailbox"},"limits":{"type":"object","properties":{"dailyLimit":{"type":"integer","minimum":1,"maximum":500},"rampEnabled":{"type":"boolean"},"rampStart":{"type":"integer","minimum":1,"maximum":500},"rampIncrement":{"type":"integer","minimum":1,"maximum":100},"minGapS":{"type":"integer","minimum":30,"maximum":3600},"maxGapS":{"type":"integer","minimum":30,"maximum":7200}},"required":["dailyLimit","rampEnabled","rampStart","rampIncrement","minGapS","maxGapS"]},"restartRamp":{"type":"boolean","description":"Start the ramp again from day 1"},"inboxPoll":{"type":"boolean","description":"Read the inbox every 60 s instead of keeping a connection open (fewer simultaneous connections; offered for Google)"},"credentials":{"type":"object","properties":{"password":{"type":"string","minLength":1,"maxLength":512},"smtp":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]},"imap":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253,"pattern":"^[a-z0-9.-]+$"},"port":{"type":"integer","minimum":1,"maximum":65535},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string","minLength":1,"maxLength":320}},"required":["host","port","security","user"]}},"required":["password"],"description":"New password (and optionally servers). Tested before saving."}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mailbox":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"domain":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"provider":{"enum":["google_app","google_oauth","microsoft","smtp"],"type":"string"},"status":{"enum":["active","paused","error","quarantined"],"type":"string"},"statusReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"dailyLimit":{"type":"number"},"effectiveLimit":{"type":"number","description":"Today's limit after ramp-up"},"rampEnabled":{"type":"boolean"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"rampDay":{"type":"number","description":"Day of the ramp, starting at 1"},"rampDaysLeft":{"type":"number","description":"Days until the ramp reaches the daily limit"},"sentToday":{"type":"number"},"minGapS":{"type":"number"},"maxGapS":{"type":"number"},"timezone":{"type":"string"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}]},"smtp":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string"}},"required":["host","port","security","user"]},{"type":"null"}]},"imap":{"anyOf":[{"type":"object","properties":{"host":{"type":"string"},"port":{"type":"number"},"security":{"enum":["tls","starttls"],"type":"string"},"user":{"type":"string"}},"required":["host","port","security","user"]},{"type":"null"}]},"lastTestedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastSyncedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Last time the inbox was read for replies and bounces"},"syncError":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the last inbox read failed, if it did"},"inboxPoll":{"type":"boolean","description":"Reads the inbox every 60 s instead of keeping an IMAP connection open"},"sendingIp":{"type":"object","properties":{"route":{"enum":["direct","shared","dedicated","own","waiting"],"type":"string","description":"direct = Microsoft Graph or Gmail API (the provider sends); waiting = no sending IP has room yet"},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["route","country","ip"],"description":"Where SMTP and IMAP connections leave from"},"warmup":{"type":"object","properties":{"enabled":{"type":"boolean"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Share of warmup emails in the inbox over 7 days, 0 to 100; null until there's enough data"},"sentToday":{"type":"number"},"targetToday":{"type":"number"},"target":{"type":"number"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"replyRate":{"type":"number"}},"required":["enabled","score","sentToday","targetToday","target","rampStart","rampIncrement","replyRate"]},"createdAt":{"type":"string"},"dns":{"anyOf":[{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}]},"grade":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"badges":{"type":"object","properties":{"mx":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"spf":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"dkim":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"dmarc":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]},"blacklists":{"anyOf":[{"enum":["pass","warn","fail","info"],"type":"string"},{"type":"null"}]}},"required":["mx","spf","dkim","dmarc","blacklists"]}},"required":["score","grade","checkedAt","badges"]},{"type":"null"}]}},"required":["id","email","domain","displayName","provider","status","statusReason","dailyLimit","effectiveLimit","rampEnabled","rampStart","rampIncrement","rampDay","rampDaysLeft","sentToday","minGapS","maxGapS","timezone","signature","smtp","imap","lastTestedAt","lastSyncedAt","syncError","inboxPoll","sendingIp","warmup","createdAt","dns"]},"test":{"anyOf":[{"type":"object","properties":{"ok":{"type":"boolean"},"smtp":{"anyOf":[{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]},"imap":{"anyOf":[{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]}},"required":["ok","smtp","imap"]},{"type":"null"}]}},"required":["mailbox","test"]}}}}}},"delete":{"operationId":"mailboxes.remove","summary":"Disconnect a mailbox","tags":["Mailboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/mailboxes/{id}/test":{"post":{"operationId":"mailboxes.retest","summary":"Test a connected mailbox again","tags":["Mailboxes"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]}}}}}}},"/domains":{"get":{"operationId":"domains.list","summary":"List sending domains with their health","description":"Same checks and score as the public checker, re-run daily.","tags":["Domains"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"domain":{"type":"string"},"mailboxes":{"type":"number"},"report":{"anyOf":[{"type":"object","properties":{"domain":{"type":"string"},"selector":{"anyOf":[{"type":"string"},{"type":"null"}]},"exists":{"type":"boolean"},"score":{"type":"integer","minimum":0,"maximum":100},"grade":{"enum":["A","B","C","D","F"],"type":"string"},"verdict":{"type":"string"},"mxFamily":{"enum":["google","microsoft","other","none"],"type":"string"},"mxLabel":{"type":"string"},"checkedAt":{"type":"string"},"durationMs":{"type":"number"},"cached":{"type":"boolean"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"status":{"enum":["pass","warn","fail","info"],"type":"string"},"points":{"type":"number"},"max":{"type":"number"},"summary":{"type":"string"},"details":{"type":"array","items":{"type":"string"}},"fix":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","label","status","points","max","summary","details","fix"]}}},"required":["domain","selector","exists","score","grade","verdict","mxFamily","mxLabel","checkedAt","durationMs","cached","checks"]},{"type":"null"}]},"history":{"type":"array","items":{"type":"object","properties":{"score":{"type":"number"},"checkedAt":{"type":"string"}},"required":["score","checkedAt"]},"description":"Up to 30 earlier scores, oldest first"}},"required":["domain","mailboxes","report","history"]}}}}}}},"post":{"operationId":"domains.add","summary":"Add a sending domain and check it","description":"For setting up DNS before any mailbox is connected. Runs the full check (MX, SPF, DKIM, DMARC, blacklists) and returns the report with a fix for each problem.","tags":["Domains"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","maxLength":300}},"required":["domain"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"selector":{"anyOf":[{"type":"string"},{"type":"null"}]},"exists":{"type":"boolean"},"score":{"type":"integer","minimum":0,"maximum":100},"grade":{"enum":["A","B","C","D","F"],"type":"string"},"verdict":{"type":"string"},"mxFamily":{"enum":["google","microsoft","other","none"],"type":"string"},"mxLabel":{"type":"string"},"checkedAt":{"type":"string"},"durationMs":{"type":"number"},"cached":{"type":"boolean"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"status":{"enum":["pass","warn","fail","info"],"type":"string"},"points":{"type":"number"},"max":{"type":"number"},"summary":{"type":"string"},"details":{"type":"array","items":{"type":"string"}},"fix":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","label","status","points","max","summary","details","fix"]}}},"required":["domain","selector","exists","score","grade","verdict","mxFamily","mxLabel","checkedAt","durationMs","cached","checks"]}}}}}}},"/domains/check":{"post":{"operationId":"domains.check","summary":"Re-check a sending domain now","tags":["Domains"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string","maxLength":300}},"required":["domain"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"type":"string"},"selector":{"anyOf":[{"type":"string"},{"type":"null"}]},"exists":{"type":"boolean"},"score":{"type":"integer","minimum":0,"maximum":100},"grade":{"enum":["A","B","C","D","F"],"type":"string"},"verdict":{"type":"string"},"mxFamily":{"enum":["google","microsoft","other","none"],"type":"string"},"mxLabel":{"type":"string"},"checkedAt":{"type":"string"},"durationMs":{"type":"number"},"cached":{"type":"boolean"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"status":{"enum":["pass","warn","fail","info"],"type":"string"},"points":{"type":"number"},"max":{"type":"number"},"summary":{"type":"string"},"details":{"type":"array","items":{"type":"string"}},"fix":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","label","status","points","max","summary","details","fix"]}}},"required":["domain","selector","exists","score","grade","verdict","mxFamily","mxLabel","checkedAt","durationMs","cached","checks"]}}}}}}},"/domains/{domain}":{"delete":{"operationId":"domains.remove","summary":"Remove a domain no mailbox uses","tags":["Domains"],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","maxLength":300}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/link-domain":{"get":{"operationId":"linkDomains.get","summary":"Get the link domain","description":"The hostname that carries unsubscribe, click and open links in this workspace's emails, the CNAME record to add, and whether DNS and the certificate are ready.","tags":["Link domain"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's link domain, null when none is set"},"status":{"enum":["none","pending_dns","pending_tls","active","failed"],"type":"string","description":"active = links in emails use it"},"dns":{"enum":["ok","missing","wrong","unknown"],"type":"string","description":"What our resolver sees at the hostname"},"tls":{"enum":["active","pending","failed","none"],"type":"string","description":"Certificate on Cloudflare"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What to do next, null when active"},"record":{"anyOf":[{"type":"object","properties":{"type":{"const":"CNAME"},"name":{"type":"string","description":"Host to add the record on, e.g. links.acme.com"},"value":{"type":"string","description":"Where it points"}},"required":["type","name","value"]},{"type":"null"}],"description":"The DNS record to add"},"suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"links.<sending domain> when nothing is set yet"},"required":{"type":"boolean","description":"Campaigns can't launch without an active link domain on this server"},"verifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hostname","status","dns","tls","message","record","suggestion","required","verifiedAt","checkedAt"]}}}}}},"put":{"operationId":"linkDomains.set","summary":"Set the link domain","description":"Sets the subdomain (e.g. links.acme.com) that carries the links in this workspace's emails. Add the returned CNAME record at your DNS provider; we issue the certificate and switch it on once both are ready. Replacing an active one breaks the unsubscribe links in emails already sent, so it needs replace: true.","tags":["Link domain"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","maxLength":253,"description":"A subdomain of a domain you own, e.g. links.acme.com"},"replace":{"type":"boolean","description":"Confirm replacing an active link domain"}},"required":["hostname"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's link domain, null when none is set"},"status":{"enum":["none","pending_dns","pending_tls","active","failed"],"type":"string","description":"active = links in emails use it"},"dns":{"enum":["ok","missing","wrong","unknown"],"type":"string","description":"What our resolver sees at the hostname"},"tls":{"enum":["active","pending","failed","none"],"type":"string","description":"Certificate on Cloudflare"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What to do next, null when active"},"record":{"anyOf":[{"type":"object","properties":{"type":{"const":"CNAME"},"name":{"type":"string","description":"Host to add the record on, e.g. links.acme.com"},"value":{"type":"string","description":"Where it points"}},"required":["type","name","value"]},{"type":"null"}],"description":"The DNS record to add"},"suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"links.<sending domain> when nothing is set yet"},"required":{"type":"boolean","description":"Campaigns can't launch without an active link domain on this server"},"verifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hostname","status","dns","tls","message","record","suggestion","required","verifiedAt","checkedAt"]}}}}}},"delete":{"operationId":"linkDomains.remove","summary":"Remove the link domain","description":"Unsubscribe and tracked links in emails already sent stop working, and campaigns can't send until a new one is active.","tags":["Link domain"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/link-domain/check":{"post":{"operationId":"linkDomains.check","summary":"Check the link domain now","description":"Looks up the CNAME and asks Cloudflare for the certificate again. The worker also checks every minute for the first hour.","tags":["Link domain"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's link domain, null when none is set"},"status":{"enum":["none","pending_dns","pending_tls","active","failed"],"type":"string","description":"active = links in emails use it"},"dns":{"enum":["ok","missing","wrong","unknown"],"type":"string","description":"What our resolver sees at the hostname"},"tls":{"enum":["active","pending","failed","none"],"type":"string","description":"Certificate on Cloudflare"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"What to do next, null when active"},"record":{"anyOf":[{"type":"object","properties":{"type":{"const":"CNAME"},"name":{"type":"string","description":"Host to add the record on, e.g. links.acme.com"},"value":{"type":"string","description":"Where it points"}},"required":["type","name","value"]},{"type":"null"}],"description":"The DNS record to add"},"suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"links.<sending domain> when nothing is set yet"},"required":{"type":"boolean","description":"Campaigns can't launch without an active link domain on this server"},"verifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"checkedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hostname","status","dns","tls","message","record","suggestion","required","verifiedAt","checkedAt"]}}}}}}},"/check/link":{"get":{"operationId":"linkDomains.lookup","summary":"Check a link domain CNAME","description":"Whether links.<domain> has the CNAME to our link target. DNS only.","tags":["Link domain"],"parameters":[{"name":"domain","in":"query","required":true,"schema":{"type":"string","maxLength":300},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string"},"target":{"anyOf":[{"type":"string"},{"type":"null"}]},"dns":{"enum":["ok","missing","wrong","unknown"],"type":"string"}},"required":["hostname","target","dns"]}}}}}}},"/leads":{"get":{"operationId":"leads.list","summary":"List leads","description":"Paged, newest first by default. Filter by list, label, status, verification and ESP, or search email, name and company.","tags":["Leads"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"allowEmptyValue":true,"allowReserved":true},{"name":"listId","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"labelId","in":"query","schema":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"allowEmptyValue":true,"allowReserved":true},{"name":"status","in":"query","schema":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"verify","in":"query","schema":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"esp","in":"query","schema":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1},"allowEmptyValue":true,"allowReserved":true},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":10,"maximum":200,"default":50},"allowEmptyValue":true,"allowReserved":true},{"name":"sort","in":"query","schema":{"enum":["createdAt","email","name","company"],"type":"string","default":"createdAt"},"allowEmptyValue":true,"allowReserved":true},{"name":"dir","in":"query","schema":{"enum":["asc","desc"],"type":"string","default":"desc"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"mxHost":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifyStatus":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"},"verifyReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}},"createdAt":{"type":"string"}},"required":["id","email","firstName","lastName","company","title","country","timezone","esp","mxHost","verifyStatus","verifyReason","status","labels","createdAt"]}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["leads","total","page","pageSize"]}}}}}},"post":{"operationId":"leads.create","summary":"Add one lead","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"country":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"type":"string","maxLength":1000}},"email":{"type":"string","maxLength":320},"listId":{"type":"string"}},"required":["email"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"mxHost":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifyStatus":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"},"verifyReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}},"createdAt":{"type":"string"},"countrySource":{"anyOf":[{"enum":["timezone","phone","email","website"],"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"verifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["id","email","firstName","lastName","company","title","country","timezone","esp","mxHost","verifyStatus","verifyReason","status","labels","createdAt","countrySource","website","phone","linkedin","custom","lists","verifiedAt","updatedAt"]}}}}}}},"/leads/stats":{"get":{"operationId":"leads.stats","summary":"Lead counts by status, verification and ESP","tags":["Leads"],"parameters":[{"name":"listId","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"number"},"status":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"verify":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"esp":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"importing":{"type":"boolean","description":"An import is still checking domains or verifying"},"verifierEnabled":{"type":"boolean","description":"A verifier API is configured; without it only local checks run"}},"required":["total","status","verify","esp","importing","verifierEnabled"]}}}}}}},"/leads/{id}":{"get":{"operationId":"leads.get","summary":"Get a lead with custom fields, lists and labels","tags":["Leads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"mxHost":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifyStatus":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"},"verifyReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}},"createdAt":{"type":"string"},"countrySource":{"anyOf":[{"enum":["timezone","phone","email","website"],"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"verifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["id","email","firstName","lastName","company","title","country","timezone","esp","mxHost","verifyStatus","verifyReason","status","labels","createdAt","countrySource","website","phone","linkedin","custom","lists","verifiedAt","updatedAt"]}}}}}},"patch":{"operationId":"leads.update","summary":"Change a lead's fields or status","tags":["Leads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"country":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"type":"string","maxLength":1000}},"status":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"mxHost":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifyStatus":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"},"verifyReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}},"createdAt":{"type":"string"},"countrySource":{"anyOf":[{"enum":["timezone","phone","email","website"],"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"verifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["id","email","firstName","lastName","company","title","country","timezone","esp","mxHost","verifyStatus","verifyReason","status","labels","createdAt","countrySource","website","phone","linkedin","custom","lists","verifiedAt","updatedAt"]}}}}}}},"/leads/{id}/won":{"post":{"operationId":"leads.markWon","summary":"Mark a lead won","description":"The lead became a customer. Counts toward the won rate on the Overview and sends the lead.won webhook. Give the deal value to track revenue.","tags":["Leads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000},{"type":"null"}]},"campaignId":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"mxHost":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifyStatus":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"},"verifyReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}},"createdAt":{"type":"string"},"countrySource":{"anyOf":[{"enum":["timezone","phone","email","website"],"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"verifiedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedAt":{"type":"string"}},"required":["id","email","firstName","lastName","company","title","country","timezone","esp","mxHost","verifyStatus","verifyReason","status","labels","createdAt","countrySource","website","phone","linkedin","custom","lists","verifiedAt","updatedAt"]}}}}}}},"/leads/delete":{"post":{"operationId":"leads.remove","summary":"Delete leads","description":"Deletes leads with their list memberships and labels. Suppressions stay.","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]},{"type":"object","properties":{"filter":{"type":"object","properties":{"search":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"listId":{"type":"string"},"labelId":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"status":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"verify":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"esp":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}}}}},"required":["filter"]}]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"number"}},"required":["deleted"]}}}}}}},"/leads/lists/add":{"post":{"operationId":"leads.addToList","summary":"Add leads to a list","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]},{"type":"object","properties":{"filter":{"type":"object","properties":{"search":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"listId":{"type":"string"},"labelId":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"status":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"verify":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"esp":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}}}}},"required":["filter"]}]},"listId":{"type":"string"}},"required":["target","listId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"number"}},"required":["added"]}}}}}}},"/leads/lists/remove":{"post":{"operationId":"leads.removeFromList","summary":"Remove leads from a list (the leads stay)","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]},{"type":"object","properties":{"filter":{"type":"object","properties":{"search":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"listId":{"type":"string"},"labelId":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"status":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"verify":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"esp":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}}}}},"required":["filter"]}]},"listId":{"type":"string"}},"required":["target","listId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"number"}},"required":["removed"]}}}}}}},"/leads/labels/add":{"post":{"operationId":"leads.label","summary":"Apply a label to leads","description":"Runs the label's triggers that don't need a campaign: suppress, move to list, auto-remove and apply-after timers.","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]},{"type":"object","properties":{"filter":{"type":"object","properties":{"search":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"listId":{"type":"string"},"labelId":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"status":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"verify":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"esp":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}}}}},"required":["filter"]}]},"labelId":{"type":"string"}},"required":["target","labelId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"labeled":{"type":"number"}},"required":["labeled"]}}}}}}},"/leads/labels/remove":{"post":{"operationId":"leads.unlabel","summary":"Remove a label from leads","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]},{"type":"object","properties":{"filter":{"type":"object","properties":{"search":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"listId":{"type":"string"},"labelId":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"status":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"verify":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"esp":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}}}}},"required":["filter"]}]},"labelId":{"type":"string"}},"required":["target","labelId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"number"}},"required":["removed"]}}}}}}},"/leads/suppress":{"post":{"operationId":"leads.suppress","summary":"Never email these leads again","description":"Adds their addresses to the suppression list.","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]},{"type":"object","properties":{"filter":{"type":"object","properties":{"search":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"listId":{"type":"string"},"labelId":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"status":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"verify":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"esp":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}}}}},"required":["filter"]}]},"reason":{"type":"string","maxLength":200}},"required":["target"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"suppressed":{"type":"number"}},"required":["suppressed"]}}}}}}},"/leads/verify":{"post":{"operationId":"leads.verify","summary":"Verify lead addresses","description":"Runs in the background: mail server lookup, disposable and role checks, then the verifier API when configured. Poll get_lead or list_leads for the result.","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target":{"anyOf":[{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]},{"type":"object","properties":{"filter":{"type":"object","properties":{"search":{"type":"string","maxLength":200,"description":"Matches email, name and company"},"listId":{"type":"string"},"labelId":{"type":"string","description":"Only leads with this label; 'none' for leads without labels"},"status":{"type":"array","items":{"enum":["active","replied","interested","won","bounced","unsubscribed","suppressed"],"type":"string"}},"verify":{"type":"array","items":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"esp":{"type":"array","items":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"}}}}},"required":["filter"]}]}},"required":["target"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"number"},"api":{"type":"boolean","description":"False when only local checks run (no verifier configured)"}},"required":["queued","api"]}}}}}}},"/leads/import":{"post":{"operationId":"leads.import","summary":"Import leads in chunks","description":"Send up to 5,000 rows per call. The first call creates the import and returns its id; pass importId with every next chunk and final: true with the last. Addresses are deduped, suppressed ones skipped, invalid ones counted. ESP detection and verification run in the background after the final chunk.","tags":["Leads"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"importId":{"type":"string","description":"Leave out on the first call; pass the id it returns with every next chunk."},"fileName":{"type":"string","maxLength":200},"list":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]}],"description":"List to add every imported lead to: an existing id or a new name"},"existing":{"enum":["skip","update"],"type":"string","default":"skip","description":"Leads already in the workspace: leave them as they are, or fill in the new values"},"verify":{"type":"boolean","default":false,"description":"Verify the new addresses with the verifier API after import"},"clientInvalid":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"clientDuplicates":{"type":"integer","minimum":0,"maximum":9007199254740991,"default":0},"rows":{"type":"array","maxItems":5000,"items":{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"country":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"type":"string","maxLength":1000}},"email":{"type":"string","maxLength":320}},"required":["email"]}},"final":{"type":"boolean","default":true,"description":"Last chunk: starts ESP detection and verification"}},"required":["rows"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"listId":{"anyOf":[{"type":"string"},{"type":"null"}]},"listName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["importing","enriching","done","failed"],"type":"string"},"verify":{"type":"boolean"},"rows":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"duplicates":{"type":"number"},"suppressed":{"type":"number"},"invalid":{"type":"number"},"undeliverable":{"type":"number"},"createdAt":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrichedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","fileName","listId","listName","status","verify","rows","created","updated","skipped","duplicates","suppressed","invalid","undeliverable","createdAt","finishedAt","enrichedAt"]}}}}}}},"/leads/imports/{id}":{"get":{"operationId":"leads.getImport","summary":"Import progress and counts","tags":["Leads"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"listId":{"anyOf":[{"type":"string"},{"type":"null"}]},"listName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["importing","enriching","done","failed"],"type":"string"},"verify":{"type":"boolean"},"rows":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"duplicates":{"type":"number"},"suppressed":{"type":"number"},"invalid":{"type":"number"},"undeliverable":{"type":"number"},"createdAt":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrichedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","fileName","listId","listName","status","verify","rows","created","updated","skipped","duplicates","suppressed","invalid","undeliverable","createdAt","finishedAt","enrichedAt"]}}}}}}},"/leads/imports":{"get":{"operationId":"leads.recentImports","summary":"Recent imports","tags":["Leads"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"imports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"fileName":{"anyOf":[{"type":"string"},{"type":"null"}]},"listId":{"anyOf":[{"type":"string"},{"type":"null"}]},"listName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"enum":["importing","enriching","done","failed"],"type":"string"},"verify":{"type":"boolean"},"rows":{"type":"number"},"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number"},"duplicates":{"type":"number"},"suppressed":{"type":"number"},"invalid":{"type":"number"},"undeliverable":{"type":"number"},"createdAt":{"type":"string"},"finishedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrichedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","fileName","listId","listName","status","verify","rows","created","updated","skipped","duplicates","suppressed","invalid","undeliverable","createdAt","finishedAt","enrichedAt"]}}},"required":["imports"]}}}}}}},"/lists":{"get":{"operationId":"lists.list","summary":"Lead lists with counts","tags":["Lists"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"lists":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"total":{"type":"number"},"valid":{"type":"number"},"risky":{"type":"number"},"invalid":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","total","valid","risky","invalid","createdAt"]}},"totalLeads":{"type":"number"},"unlisted":{"type":"number"}},"required":["lists","totalLeads","unlisted"]}}}}}},"post":{"operationId":"lists.create","summary":"Create a list","tags":["Lists"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}}}}}},"/lists/{id}":{"patch":{"operationId":"lists.rename","summary":"Rename a list","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}}}}},"delete":{"operationId":"lists.remove","summary":"Delete a list","description":"The list goes; with deleteLeads its leads are deleted too, otherwise they stay in the workspace.","tags":["Lists"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"deleteLeads":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"deletedLeads":{"type":"number"}},"required":["ok","deletedLeads"]}}}}}}},"/labels":{"get":{"operationId":"labels.list","summary":"Labels with their triggers and lead counts","tags":["Labels"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiPrompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"},"triggers":{"type":"object","properties":{"suppress":{"type":"boolean","default":false},"pauseCampaign":{"type":"boolean","default":false},"removeFromCampaign":{"type":"boolean","default":false},"moveToListId":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"default":null},"notifyTeam":{"type":"boolean","default":false},"applyLabelAfter":{"anyOf":[{"type":"object","properties":{"labelId":{"type":"string"},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["labelId","days"]},{"type":"null"}],"default":null},"autoRemoveAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}],"default":null}}},"position":{"type":"number"},"system":{"type":"boolean","description":"Used by the engine: editable, not deletable"},"leads":{"type":"number"}},"required":["id","name","description","aiPrompt","type","triggers","position","system","leads"]}}},"required":["labels"]}}}}}},"post":{"operationId":"labels.create","summary":"Create a label","tags":["Labels"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"aiPrompt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"description":"Tells the reply classifier when to apply it. Empty = applied by hand only."},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"},"triggers":{"type":"object","properties":{"suppress":{"type":"boolean","default":false},"pauseCampaign":{"type":"boolean","default":false},"removeFromCampaign":{"type":"boolean","default":false},"moveToListId":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"default":null},"notifyTeam":{"type":"boolean","default":false},"applyLabelAfter":{"anyOf":[{"type":"object","properties":{"labelId":{"type":"string"},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["labelId","days"]},{"type":"null"}],"default":null},"autoRemoveAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}],"default":null}}}},"required":["name","type","triggers"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiPrompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"},"triggers":{"type":"object","properties":{"suppress":{"type":"boolean","default":false},"pauseCampaign":{"type":"boolean","default":false},"removeFromCampaign":{"type":"boolean","default":false},"moveToListId":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"default":null},"notifyTeam":{"type":"boolean","default":false},"applyLabelAfter":{"anyOf":[{"type":"object","properties":{"labelId":{"type":"string"},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["labelId","days"]},{"type":"null"}],"default":null},"autoRemoveAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}],"default":null}}},"position":{"type":"number"},"system":{"type":"boolean","description":"Used by the engine: editable, not deletable"},"leads":{"type":"number"}},"required":["id","name","description","aiPrompt","type","triggers","position","system","leads"]}}}}}}},"/labels/{id}":{"patch":{"operationId":"labels.update","summary":"Change a label, its AI prompt or triggers","tags":["Labels"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"aiPrompt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"description":"Tells the reply classifier when to apply it. Empty = applied by hand only."},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"},"triggers":{"type":"object","properties":{"suppress":{"type":"boolean","default":false},"pauseCampaign":{"type":"boolean","default":false},"removeFromCampaign":{"type":"boolean","default":false},"moveToListId":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"default":null},"notifyTeam":{"type":"boolean","default":false},"applyLabelAfter":{"anyOf":[{"type":"object","properties":{"labelId":{"type":"string"},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["labelId","days"]},{"type":"null"}],"default":null},"autoRemoveAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}],"default":null}}}},"required":["name","type","triggers"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"aiPrompt":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"},"triggers":{"type":"object","properties":{"suppress":{"type":"boolean","default":false},"pauseCampaign":{"type":"boolean","default":false},"removeFromCampaign":{"type":"boolean","default":false},"moveToListId":{"anyOf":[{"type":"string"},{"type":"null"}],"default":null},"webhookUrl":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"default":null},"notifyTeam":{"type":"boolean","default":false},"applyLabelAfter":{"anyOf":[{"type":"object","properties":{"labelId":{"type":"string"},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["labelId","days"]},{"type":"null"}],"default":null},"autoRemoveAfterDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":365},{"type":"null"}],"default":null}}},"position":{"type":"number"},"system":{"type":"boolean","description":"Used by the engine: editable, not deletable"},"leads":{"type":"number"}},"required":["id","name","description","aiPrompt","type","triggers","position","system","leads"]}}}}}},"delete":{"operationId":"labels.remove","summary":"Delete a label","description":"Removes it from every lead. Labels the engine relies on can't be deleted.","tags":["Labels"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/labels/reorder":{"post":{"operationId":"labels.reorder","summary":"Set the label order","tags":["Labels"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","maxItems":200,"items":{"type":"string"}}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/labels/test":{"post":{"operationId":"labels.testPrompt","summary":"Run the reply classifier on a sample reply","description":"Uses every label's AI prompt, with `draft` replacing one label's saved prompt, so a prompt can be tried before saving. Nothing is labeled.","tags":["Labels"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"reply":{"type":"string","minLength":1,"maxLength":8000},"draft":{"anyOf":[{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Label being edited; omit for a new one"},"name":{"type":"string","minLength":1,"maxLength":40},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"aiPrompt":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["name"]},{"type":"null"}]}},"required":["reply"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"labelId":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Null: no label fits well enough, a human decides. \"draft\" when the unsaved new label wins"},"labelName":{"anyOf":[{"type":"string"},{"type":"null"}]},"confidence":{"type":"number"},"reason":{"type":"string"},"source":{"type":"string","description":"\"rules\" for auto-replies caught without a model, else the model id"}},"required":["labelId","labelName","confidence","reason","source"]}}}}}}},"/suppressions":{"get":{"operationId":"suppressions.list","summary":"Suppressed addresses and domains","tags":["Suppressions"],"parameters":[{"name":"search","in":"query","schema":{"type":"string","maxLength":200},"allowEmptyValue":true,"allowReserved":true},{"name":"kind","in":"query","schema":{"enum":["all","email","domain"],"type":"string","default":"all"},"allowEmptyValue":true,"allowReserved":true},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":9007199254740991,"default":1},"allowEmptyValue":true,"allowReserved":true},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":10,"maximum":200,"default":50},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"suppressions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string","description":"An email address or @domain"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"source":{"enum":["manual","import","label","unsubscribe","bounce","api"],"type":"string"},"createdAt":{"type":"string"}},"required":["id","value","reason","source","createdAt"]}},"total":{"type":"number"},"emails":{"type":"number"},"domains":{"type":"number"}},"required":["suppressions","total","emails","domains"]}}}}}},"post":{"operationId":"suppressions.add","summary":"Suppress addresses or whole domains","description":"Up to 10,000 values per call: emails, or domains written as @acme.com. Matching leads are marked suppressed.","tags":["Suppressions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"values":{"type":"array","minItems":1,"maxItems":10000,"items":{"type":"string","maxLength":320}},"reason":{"type":"string","maxLength":200}},"required":["values"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"added":{"type":"number"},"existing":{"type":"number"},"invalid":{"type":"array","items":{"type":"string"}},"leadsSuppressed":{"type":"number"}},"required":["added","existing","invalid","leadsSuppressed"]}}}}}}},"/suppressions/remove":{"post":{"operationId":"suppressions.remove","summary":"Remove suppressions","description":"Leads covered by no other suppression become active again.","tags":["Suppressions"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"}}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"number"},"leadsReleased":{"type":"number"}},"required":["removed","leadsReleased"]}}}}}}},"/integrations":{"get":{"operationId":"integrations.list","summary":"List connected integrations","description":"The workspace's email verifier (its own account) with credits left at the last check, and its own AI provider key (OpenAI or Gemini) if connected. Keys are never returned.","tags":["Integrations"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"integrations":{"type":"array","items":{"type":"object","properties":{"provider":{"enum":["millionverifier","zerobounce","neverbounce","openai","google"],"type":"string","description":"openai and google (Gemini) are AI providers, the others email verifiers"},"kind":{"enum":["verifier","ai"],"type":"string"},"status":{"enum":["connected","error"],"type":"string"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"credits":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Verification credits left at the last check (verifiers only)"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Model the AI key was tested on (AI providers only)"},"models":{"anyOf":[{"type":"object","properties":{"write":{"anyOf":[{"type":"string"},{"type":"null"}]},"classify":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["write","classify"]},{"type":"null"}],"description":"AI providers only: the model picked for Write with AI and for reply labels; null = the default, cheapest model"},"keyHint":{"type":"string","description":"Last 4 characters of the key"},"connectedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["provider","kind","status","lastError","lastCheckedAt","credits","model","models","keyHint","connectedBy","createdAt"]}}},"required":["integrations"]}}}}}}},"/integrations/verifier":{"post":{"operationId":"integrations.connectVerifier","summary":"Connect an email verifier with the workspace's own API key","description":"Tests the key with the provider (no credits used) and saves it only when it works. Replaces any verifier connected before: one is active per workspace.","tags":["Integrations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"enum":["millionverifier","zerobounce","neverbounce"],"type":"string"},"apiKey":{"type":"string","maxLength":200}},"required":["provider","apiKey"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ok":{"const":true},"integration":{"type":"object","properties":{"provider":{"enum":["millionverifier","zerobounce","neverbounce","openai","google"],"type":"string","description":"openai and google (Gemini) are AI providers, the others email verifiers"},"kind":{"enum":["verifier","ai"],"type":"string"},"status":{"enum":["connected","error"],"type":"string"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"credits":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Verification credits left at the last check (verifiers only)"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Model the AI key was tested on (AI providers only)"},"models":{"anyOf":[{"type":"object","properties":{"write":{"anyOf":[{"type":"string"},{"type":"null"}]},"classify":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["write","classify"]},{"type":"null"}],"description":"AI providers only: the model picked for Write with AI and for reply labels; null = the default, cheapest model"},"keyHint":{"type":"string","description":"Last 4 characters of the key"},"connectedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["provider","kind","status","lastError","lastCheckedAt","credits","model","models","keyHint","connectedBy","createdAt"]}},"required":["ok","integration"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]}}}}}}},"/integrations/ai":{"post":{"operationId":"integrations.connectAi","summary":"Connect the workspace's own OpenAI or Gemini key","description":"Tests the key with a tiny request on the model Ballast would use and saves it only when it works. From then on reply labels and Write with AI run on this key (only this provider's models) and the monthly AI draft allowance no longer applies. Replaces any AI key connected before.","tags":["Integrations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"enum":["openai","google"],"type":"string"},"apiKey":{"type":"string","maxLength":500}},"required":["provider","apiKey"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ok":{"const":true},"integration":{"type":"object","properties":{"provider":{"enum":["millionverifier","zerobounce","neverbounce","openai","google"],"type":"string","description":"openai and google (Gemini) are AI providers, the others email verifiers"},"kind":{"enum":["verifier","ai"],"type":"string"},"status":{"enum":["connected","error"],"type":"string"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"credits":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Verification credits left at the last check (verifiers only)"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Model the AI key was tested on (AI providers only)"},"models":{"anyOf":[{"type":"object","properties":{"write":{"anyOf":[{"type":"string"},{"type":"null"}]},"classify":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["write","classify"]},{"type":"null"}],"description":"AI providers only: the model picked for Write with AI and for reply labels; null = the default, cheapest model"},"keyHint":{"type":"string","description":"Last 4 characters of the key"},"connectedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["provider","kind","status","lastError","lastCheckedAt","credits","model","models","keyHint","connectedBy","createdAt"]}},"required":["ok","integration"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]}}}}}}},"/integrations/ai/models":{"put":{"operationId":"integrations.setAiModels","summary":"Pick the models the workspace's own AI key runs","description":"Only with the workspace's own OpenAI or Gemini key (Ballast's keys always run the cheapest models). Per job: write (Write with AI) and classify (reply labels); null = the default, cheapest model. A new pick is tested with the key first. The default model stays as the fallback. OpenAI: gpt-6-luna, gpt-6.1-sol, gpt-6-astra. Gemini: gemini-3.5-flash-lite, gemini-3.8-flash, gemini-4-argon.","tags":["Integrations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"write":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"classify":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"ok":{"const":true},"integration":{"type":"object","properties":{"provider":{"enum":["millionverifier","zerobounce","neverbounce","openai","google"],"type":"string","description":"openai and google (Gemini) are AI providers, the others email verifiers"},"kind":{"enum":["verifier","ai"],"type":"string"},"status":{"enum":["connected","error"],"type":"string"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"credits":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Verification credits left at the last check (verifiers only)"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Model the AI key was tested on (AI providers only)"},"models":{"anyOf":[{"type":"object","properties":{"write":{"anyOf":[{"type":"string"},{"type":"null"}]},"classify":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["write","classify"]},{"type":"null"}],"description":"AI providers only: the model picked for Write with AI and for reply labels; null = the default, cheapest model"},"keyHint":{"type":"string","description":"Last 4 characters of the key"},"connectedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["provider","kind","status","lastError","lastCheckedAt","credits","model","models","keyHint","connectedBy","createdAt"]}},"required":["ok","integration"]},{"type":"object","properties":{"ok":{"const":false},"error":{"type":"string"}},"required":["ok","error"]}]}}}}}}},"/integrations/{provider}/check":{"post":{"operationId":"integrations.refresh","summary":"Test a connected key again (verifier credits left, or the AI key on its model)","tags":["Integrations"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"enum":["millionverifier","zerobounce","neverbounce","openai","google"],"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"enum":["millionverifier","zerobounce","neverbounce","openai","google"],"type":"string","description":"openai and google (Gemini) are AI providers, the others email verifiers"},"kind":{"enum":["verifier","ai"],"type":"string"},"status":{"enum":["connected","error"],"type":"string"},"lastError":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"credits":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Verification credits left at the last check (verifiers only)"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Model the AI key was tested on (AI providers only)"},"models":{"anyOf":[{"type":"object","properties":{"write":{"anyOf":[{"type":"string"},{"type":"null"}]},"classify":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["write","classify"]},{"type":"null"}],"description":"AI providers only: the model picked for Write with AI and for reply labels; null = the default, cheapest model"},"keyHint":{"type":"string","description":"Last 4 characters of the key"},"connectedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["provider","kind","status","lastError","lastCheckedAt","credits","model","models","keyHint","connectedBy","createdAt"]}}}}}}},"/integrations/{provider}":{"delete":{"operationId":"integrations.disconnect","summary":"Disconnect an integration and delete its key","description":"Disconnecting the AI key moves reply labels and Write with AI back to Ballast's keys, with the plan's monthly draft allowance.","tags":["Integrations"],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"enum":["millionverifier","zerobounce","neverbounce","openai","google"],"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/campaigns":{"get":{"operationId":"campaigns.list","summary":"List campaigns","description":"Newest first, with lead counts by progress.","tags":["Campaigns"],"parameters":[{"name":"status","in":"query","schema":{"type":"array","items":{"enum":["draft","running","paused","completed"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"steps":{"type":"number"},"mailboxes":{"type":"number"},"leads":{"type":"number"},"contacted":{"type":"number","description":"Leads that got at least one email"},"sent":{"type":"number","description":"Emails sent, all time"},"replied":{"type":"number"},"bounced":{"type":"number"},"opened":{"type":"number"},"trackOpens":{"type":"boolean"},"reached":{"type":"array","items":{"type":"number"}},"activeMailboxes":{"type":"number","description":"Picked mailboxes that can send"},"windowStart":{"type":"number"},"windowEnd":{"type":"number"},"days":{"type":"number"},"timezoneFallback":{"type":"string"},"startOn":{"anyOf":[{"type":"string"},{"type":"null"}]},"endOn":{"anyOf":[{"type":"string"},{"type":"null"}]},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","name","status","pausedReason","steps","mailboxes","leads","contacted","sent","replied","bounced","opened","trackOpens","reached","activeMailboxes","windowStart","windowEnd","days","timezoneFallback","startOn","endOn","startedAt","createdAt"]}}},"required":["campaigns"]}}}}}},"post":{"operationId":"campaigns.create","summary":"Create a draft campaign","description":"Starts with one empty email. Use set_sequence to write the emails, then add leads and mailboxes.","tags":["Campaigns"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"default":"Untitled campaign"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}}},"/campaigns/stats":{"get":{"operationId":"campaigns.stats","summary":"Daily emails sent, replies, bounces and opens","description":"For all campaigns, or one with campaignId. Days are calendar days in the workspace's timezone.","tags":["Campaigns"],"parameters":[{"name":"days","in":"query","schema":{"type":"number","default":90,"description":"7, 30 or 90 days"},"allowEmptyValue":true,"allowReserved":true},{"name":"campaignId","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"number"},"timezone":{"type":"string","description":"Days are calendar days in this timezone"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["date","sent","replied","positive","bounced","opened"]}},"totals":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies whose thread is labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]},"tracksOpens":{"type":"boolean","description":"Some campaign in scope tracks opens"}},"required":["days","timezone","series","totals","tracksOpens"]}}}}}}},"/campaigns/analytics":{"get":{"operationId":"campaigns.analytics","summary":"Sends, replies and bounces by campaign, mailbox and email provider, plus reply sentiment","tags":["Campaigns"],"parameters":[{"name":"days","in":"query","schema":{"type":"number","default":30,"description":"7, 30 or 90 days"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"number"},"byCampaign":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"counts":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]}},"required":["id","name","status","counts"]}},"byMailbox":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"counts":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]}},"required":["id","email","counts"]}},"byEsp":{"type":"array","items":{"type":"object","properties":{"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"counts":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]}},"required":["esp","counts"]}},"sentiment":{"type":"object","properties":{"positive":{"type":"number"},"negative":{"type":"number"},"neutral":{"type":"number"},"warning":{"type":"number"}},"required":["positive","negative","neutral","warning"],"description":"Replies by the type of the label their thread carries now"}},"required":["days","byCampaign","byMailbox","byEsp","sentiment"]}}}}}}},"/campaigns/{id}/breakdown":{"get":{"operationId":"campaigns.breakdown","summary":"One campaign's results by step, A/B variant, mailbox and email provider","description":"Since the campaign started. Replies count against the email they answered; the winner per step needs 50+ sends on each variant.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string"},"position":{"type":"number"},"counts":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]},"variants":{"type":"array","items":{"type":"object","properties":{"variantId":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"active":{"type":"boolean"},"weight":{"type":"number"},"counts":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]},"winner":{"type":"boolean","description":"Best reply rate with 50+ sends each, ahead of the runner-up"}},"required":["variantId","label","subject","active","weight","counts","winner"]}}},"required":["stepId","position","counts","variants"]}},"byMailbox":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"counts":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]}},"required":["id","email","counts"]}},"byEsp":{"type":"array","items":{"type":"object","properties":{"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"counts":{"type":"object","properties":{"sent":{"type":"number"},"replied":{"type":"number"},"positive":{"type":"number","description":"Replies labeled positive now"},"bounced":{"type":"number"},"opened":{"type":"number"}},"required":["sent","replied","positive","bounced","opened"]}},"required":["esp","counts"]}},"sentiment":{"type":"object","properties":{"positive":{"type":"number"},"negative":{"type":"number"},"neutral":{"type":"number"},"warning":{"type":"number"}},"required":["positive","negative","neutral","warning"]}},"required":["steps","byMailbox","byEsp","sentiment"]}}}}}}},"/campaigns/{id}":{"get":{"operationId":"campaigns.get","summary":"Get a campaign with its sequence, schedule and settings","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}},"patch":{"operationId":"campaigns.update","summary":"Rename a campaign or change its schedule, mailboxes and options","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"mailboxIds":{"type":"array","maxItems":500,"items":{"type":"string"},"description":"Replaces the campaign's mailboxes"},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}},"delete":{"operationId":"campaigns.remove","summary":"Delete a campaign","description":"Its leads stay in the workspace.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/campaigns/{id}/duplicate":{"post":{"operationId":"campaigns.duplicate","summary":"Copy a campaign's sequence, schedule and mailboxes into a new draft (no leads)","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}}},"/campaigns/{id}/steps":{"post":{"operationId":"campaigns.addStep","summary":"Add a follow-up step at the end","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}}},"/campaigns/{id}/steps/{stepId}":{"patch":{"operationId":"campaigns.updateStep","summary":"Change a step's wait time or threading","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"waitDays":{"type":"integer","minimum":0,"maximum":60},"sameThread":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}},"delete":{"operationId":"campaigns.removeStep","summary":"Delete a step","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}}},"/campaigns/{id}/steps/{stepId}/move":{"post":{"operationId":"campaigns.moveStep","summary":"Move a step up or down","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["to"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}}},"/campaigns/{id}/steps/{stepId}/variants":{"post":{"operationId":"campaigns.addVariant","summary":"Add an A/B variant to a step, optionally copying another","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"copyFrom":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}}},"/campaigns/{id}/variants/{variantId}":{"patch":{"operationId":"campaigns.updateVariant","summary":"Change a variant's subject, body, weight or on/off","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"variantId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"subject":{"type":"string","maxLength":300},"body":{"type":"string","maxLength":50000,"description":"HTML or plain text; sanitized on save"},"weight":{"type":"integer","minimum":0,"maximum":100},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"body":{"type":"string","description":"The body as saved (sanitized)"}},"required":["ok","body"]}}}}}},"delete":{"operationId":"campaigns.removeVariant","summary":"Delete a variant","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"variantId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}}},"/campaigns/{id}/sequence":{"put":{"operationId":"campaigns.setSequence","summary":"Replace the whole sequence","description":"Steps in order, each with 1 to 5 variants. Bodies may be plain text (blank lines split paragraphs) or simple HTML. Use {{first_name}} style variables, {{first_name|there}} for a fallback, {Hi|Hello} spintax, and put {{unsubscribe}} in the first email. Only drafts and paused campaigns.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"object","properties":{"waitDays":{"type":"integer","minimum":0,"maximum":60,"default":3},"sameThread":{"type":"boolean","default":true},"variants":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"object","properties":{"subject":{"type":"string","maxLength":300,"default":""},"body":{"type":"string","maxLength":50000},"weight":{"type":"integer","minimum":0,"maximum":100,"default":1},"active":{"type":"boolean","default":true}},"required":["body"]}}},"required":["variants"]}}},"required":["steps"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]}}}}}}},"/campaigns/{id}/write":{"post":{"operationId":"campaigns.write","summary":"Write emails with AI from the offer profile","description":"Drafts a whole sequence (mode sequence) or a new version of one variant (rewrite, shorter, angle), using only facts from the workspace's offer profile and lead fields. Results are saved as new variants and never overwrite existing text; an empty campaign gets the drafted steps. Each email is checked against the content checklist; anything still failing comes back in problems. Needs a saved offer profile (update_offer_profile).","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"enum":["sequence","rewrite","shorter","angle"],"type":"string","default":"sequence","description":"sequence = draft every step; rewrite, shorter, angle = a new version of one variant"},"steps":{"type":"integer","minimum":1,"maximum":5,"default":3,"description":"sequence mode: how many emails"},"variantId":{"type":"string","description":"rewrite, shorter, angle: the variant to start from (required)"},"angle":{"type":"string","maxLength":500,"description":"Optional angle or notes, e.g. 'lead with the cost of manual payroll'"},"persona":{"type":"string","maxLength":300,"description":"Optional target persona, e.g. 'operations managers at restaurant groups'"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["draft","running","paused","completed"],"type":"string"},"pausedReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezoneFallback":{"type":"string","description":"IANA timezone for leads without one"},"windowStart":{"type":"integer","minimum":0,"maximum":1440,"description":"Minutes after midnight"},"windowEnd":{"type":"integer","minimum":0,"maximum":1440},"days":{"type":"integer","minimum":0,"maximum":127,"description":"Bitmask, bit 0 = Monday ... bit 6 = Sunday"},"dailyCap":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}],"description":"First emails a day for the campaign; null = only mailbox limits"},"bounceThreshold":{"anyOf":[{"type":"number","minimum":0.5,"maximum":20},{"type":"null"}],"description":"Pause at this bounce rate (%); null = workspace default"},"espMatching":{"type":"boolean"},"stopOnReply":{"type":"boolean"},"trackClicks":{"type":"boolean"},"trackOpens":{"type":"boolean"},"startOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional first sending day (YYYY-MM-DD, in timezoneFallback). Null = start when launched"},"endOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"Optional last sending day (YYYY-MM-DD, in timezoneFallback). After it nothing goes out and the campaign pauses. Null = no end"},"stopForCompany":{"type":"boolean","description":"When a lead replies, stop the sequence for everyone at the same company domain (free-mail domains excluded)"},"skipRisky":{"type":"boolean","description":"Leave out risky and catch-all leads: skipped when added and before their first email"},"startedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"0 = first email"},"waitDays":{"type":"number","description":"Days after the previous step"},"sameThread":{"type":"boolean"},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"subject":{"type":"string"},"body":{"type":"string","description":"Minimal HTML with {{variables}} and {spin|tax}"},"weight":{"type":"number"},"active":{"type":"boolean"}},"required":["id","label","subject","body","weight","active"]}}},"required":["id","position","waitDays","sameThread","variants"]}},"mailboxIds":{"type":"array","items":{"type":"string"}},"leadCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"},"description":"Campaign leads by status"},"reached":{"type":"array","items":{"type":"number"},"description":"Leads that reached each step (index = step position)"},"activeMailboxes":{"type":"number"},"workspace":{"type":"object","properties":{"customKeys":{"type":"array","items":{"type":"string"},"description":"Custom lead fields usable as {{variables}}"},"bounceThreshold":{"type":"number"},"unsubscribeMode":{"enum":["link","reply_text"],"type":"string"},"defaultTimezone":{"type":"string"},"linkDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The workspace's active link domain, which carries unsubscribe and tracking links"},"linkDomainRequired":{"type":"boolean","description":"Tracking and launching need an active link domain on this server"}},"required":["customKeys","bounceThreshold","unsubscribeMode","defaultTimezone","linkDomain","linkDomainRequired"]}},"required":["id","name","status","pausedReason","timezoneFallback","windowStart","windowEnd","days","dailyCap","bounceThreshold","espMatching","stopOnReply","trackClicks","trackOpens","startOn","endOn","stopForCompany","skipRisky","startedAt","createdAt","updatedAt","steps","mailboxIds","leadCounts","reached","activeMailboxes","workspace"]},"created":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string"},"variantId":{"type":"string"},"position":{"type":"number"},"label":{"type":"string"},"problems":{"type":"array","items":{"type":"string"},"description":"Checks the email still fails after one retry; empty = passed"}},"required":["stepId","variantId","position","label","problems"]}},"skipped":{"type":"array","items":{"type":"string"},"description":"Emails that had nowhere to go (step already has 5 variants, or 10 steps)"}},"required":["campaign","created","skipped"]}}}}}}},"/campaigns/{id}/leads":{"get":{"operationId":"campaigns.leads","summary":"Leads in a campaign with their progress","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"array","items":{"enum":["not_contacted","contacted","completed","replied","rescheduled","unsubscribed","bounced","skipped","stopped"],"type":"string"}},"style":"deepObject","explode":true,"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","maxLength":200},"allowEmptyValue":true,"allowReserved":true},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"maximum":100000,"default":1},"allowEmptyValue":true,"allowReserved":true},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":10,"maximum":200,"default":50},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"enum":["not_contacted","contacted","completed","replied","rescheduled","unsubscribed","bounced","skipped","stopped"],"type":"string"},"currentStep":{"type":"number"},"nextDueAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"addedAt":{"type":"string"},"lastSentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"sending":{"type":"boolean","description":"An email to this lead is with the provider right now"},"problem":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why the last email failed, bounced or may not have arrived"},"mailboxEmail":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The mailbox the sequence comes from (sticky after the first email)"},"lead":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"esp":{"enum":["google","microsoft","yahoo","proton","icloud","zoho","other","unknown"],"type":"string"},"mxHost":{"anyOf":[{"type":"string"},{"type":"null"}]},"verifyStatus":{"enum":["unknown","verifying","valid","risky","invalid","catch_all"],"type":"string"}},"required":["id","email","firstName","lastName","company","esp","mxHost","verifyStatus"]}},"required":["id","status","currentStep","nextDueAt","addedAt","lastSentAt","sending","problem","mailboxEmail","lead"]}},"total":{"type":"number"},"page":{"type":"number"},"pageSize":{"type":"number"}},"required":["leads","total","page","pageSize"]}}}}}},"post":{"operationId":"campaigns.addLeads","summary":"Add leads from lists (or by id) to a campaign","description":"Skips leads already in the campaign, unsubscribed, bounced or suppressed leads, and addresses verification found invalid.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"listIds":{"type":"array","maxItems":50,"items":{"type":"string"}},"leadIds":{"type":"array","maxItems":5000,"items":{"type":"string"}},"allLeads":{"type":"boolean","description":"Every lead in the workspace"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"matched":{"type":"number"},"added":{"type":"number"},"alreadyIn":{"type":"number"},"suppressed":{"type":"number","description":"Unsubscribed, bounced or on the suppression list"},"invalid":{"type":"number","description":"Verification said the address doesn't exist"},"risky":{"type":"number","description":"Risky or catch-all, left out because the campaign skips risky leads"}},"required":["matched","added","alreadyIn","suppressed","invalid","risky"]}}}}}}},"/campaigns/{id}/leads/{campaignLeadId}/sends":{"get":{"operationId":"campaigns.leadSends","summary":"Emails sent to one lead in a campaign","description":"Every step that went out, with its rendered subject and body, status and any error.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"campaignLeadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"sends":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","description":"Step position when sent, 0 = first email"},"variantLabel":{"anyOf":[{"type":"string"},{"type":"null"}]},"subject":{"type":"string"},"html":{"type":"string"},"status":{"enum":["sending","sent","failed","unknown","bounced"],"type":"string"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"mailboxEmail":{"anyOf":[{"type":"string"},{"type":"null"}]},"messageId":{"type":"string"},"sentAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","position","variantLabel","subject","html","status","error","mailboxEmail","messageId","sentAt","createdAt"]}}},"required":["sends"]}}}}}}},"/campaigns/{id}/leads/remove":{"post":{"operationId":"campaigns.removeLeads","summary":"Take leads out of a campaign (they stay in the workspace)","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"string"},"description":"Campaign lead ids"}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"number"}},"required":["removed"]}}}}}}},"/campaigns/{id}/preview":{"get":{"operationId":"campaigns.preview","summary":"Render every step and variant for one lead","description":"Shows the emails exactly as that lead would get them, with spintax resolved the way it will be for them. Defaults to the first lead in the campaign.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"leadId","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"lead":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"linkedin":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"custom":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["id","email","firstName","lastName","company","title","website","phone","linkedin","country","custom"]},{"type":"null"}]},"sender":{"anyOf":[{"type":"object","properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"type":"string"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["name","email","signature"]},{"type":"null"}]},"unsubscribe":{"type":"string"},"emails":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string"},"position":{"type":"number"},"variantId":{"type":"string"},"label":{"type":"string"},"picked":{"type":"boolean","description":"The variant this lead gets at this step"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"missing":{"type":"array","items":{"type":"string"},"description":"Variables this lead has no value for"}},"required":["stepId","position","variantId","label","picked","subject","html","text","missing"]}},"picker":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","name"]}},"pickerTotal":{"type":"number"}},"required":["lead","sender","unsubscribe","emails","picker","pickerTotal"]}}}}}}},"/campaigns/{id}/checklist":{"get":{"operationId":"campaigns.checklist","summary":"What has to be fixed before launch","description":"Required items block the launch; warnings are advice.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"state":{"enum":["pass","fail","warn"],"type":"string"},"detail":{"type":"string"},"required":{"type":"boolean"},"fix":{"type":"string"}},"required":["key","label","state","detail","required"]}},"canLaunch":{"type":"boolean"}},"required":["items","canLaunch"]}}}}}}},"/campaigns/{id}/launch":{"post":{"operationId":"campaigns.launch","summary":"Launch or resume a campaign","description":"Runs the launch checklist first and refuses when a required item fails. The worker then sends inside the schedule window.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"enum":["draft","running","paused","completed"],"type":"string"},"items":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"state":{"enum":["pass","fail","warn"],"type":"string"},"detail":{"type":"string"},"required":{"type":"boolean"},"fix":{"type":"string"}},"required":["key","label","state","detail","required"]}}},"required":["status","items"]}}}}}}},"/campaigns/{id}/pause":{"post":{"operationId":"campaigns.pause","summary":"Pause a running campaign","description":"Nothing more is sent until it is launched again. Emails already handed to the provider still arrive.","tags":["Campaigns"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"enum":["draft","running","paused","completed"],"type":"string"}},"required":["status"]}}}}}}},"/offer-profile":{"get":{"operationId":"offer.get","summary":"Get the offer profile","description":"What the workspace sells, who to, the problem, proof points and things never to claim. write_sequence uses only these facts.","tags":["Offer profile"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"anyOf":[{"type":"object","properties":{"company":{"type":"string","maxLength":120,"default":"","description":"Name of the sender's company"},"product":{"type":"string","maxLength":1000,"default":"","description":"What you sell, in a sentence or two"},"audience":{"type":"string","maxLength":1000,"default":"","description":"Who it is for: roles, company types, sizes"},"problem":{"type":"string","maxLength":1000,"default":"","description":"The problem it solves for them"},"proof":{"type":"string","maxLength":2000,"default":"","description":"Proof points with real numbers or customer names, one per line"},"cta":{"type":"string","maxLength":300,"default":"","description":"What you ask for, e.g. a 15 minute call or a reply"},"tone":{"enum":["plain","friendly","direct","formal"],"type":"string","default":"plain"},"avoid":{"type":"string","maxLength":1000,"default":"","description":"Things never to claim or mention, one per line"}}},{"type":"null"}],"description":"Null until someone saves one"},"ready":{"type":"boolean","description":"Has what a useful email needs: product, audience, problem"},"aiAvailable":{"type":"boolean","description":"This server has an AI key, or the workspace connected its own"},"drafts":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Drafts on Ballast's AI keys this month"},"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Monthly allowance of the plan; null with the workspace's own AI key (no allowance) or before a plan"},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resetsAt":{"type":"string","description":"When the count goes back to 0"},"ownKey":{"type":"boolean","description":"The workspace connected its own OpenAI or Gemini key"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when the allowance is used up"}},"required":["used","limit","remaining","resetsAt","ownKey","message"],"description":"Write with AI drafts this month: one draft = one write_sequence or website draft call"},"sendingDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Domain from onboarding, offered for the website draft"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["profile","ready","aiAvailable","drafts","sendingDomain","updatedAt"]}}}}}},"put":{"operationId":"offer.update","summary":"Save the offer profile","description":"Replaces the whole profile. Put only true facts here: proof points must be real numbers or customers.","tags":["Offer profile"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"company":{"type":"string","maxLength":120,"default":"","description":"Name of the sender's company"},"product":{"type":"string","maxLength":1000,"default":"","description":"What you sell, in a sentence or two"},"audience":{"type":"string","maxLength":1000,"default":"","description":"Who it is for: roles, company types, sizes"},"problem":{"type":"string","maxLength":1000,"default":"","description":"The problem it solves for them"},"proof":{"type":"string","maxLength":2000,"default":"","description":"Proof points with real numbers or customer names, one per line"},"cta":{"type":"string","maxLength":300,"default":"","description":"What you ask for, e.g. a 15 minute call or a reply"},"tone":{"enum":["plain","friendly","direct","formal"],"type":"string","default":"plain"},"avoid":{"type":"string","maxLength":1000,"default":"","description":"Things never to claim or mention, one per line"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"anyOf":[{"type":"object","properties":{"company":{"type":"string","maxLength":120,"default":"","description":"Name of the sender's company"},"product":{"type":"string","maxLength":1000,"default":"","description":"What you sell, in a sentence or two"},"audience":{"type":"string","maxLength":1000,"default":"","description":"Who it is for: roles, company types, sizes"},"problem":{"type":"string","maxLength":1000,"default":"","description":"The problem it solves for them"},"proof":{"type":"string","maxLength":2000,"default":"","description":"Proof points with real numbers or customer names, one per line"},"cta":{"type":"string","maxLength":300,"default":"","description":"What you ask for, e.g. a 15 minute call or a reply"},"tone":{"enum":["plain","friendly","direct","formal"],"type":"string","default":"plain"},"avoid":{"type":"string","maxLength":1000,"default":"","description":"Things never to claim or mention, one per line"}}},{"type":"null"}],"description":"Null until someone saves one"},"ready":{"type":"boolean","description":"Has what a useful email needs: product, audience, problem"},"aiAvailable":{"type":"boolean","description":"This server has an AI key, or the workspace connected its own"},"drafts":{"type":"object","properties":{"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Drafts on Ballast's AI keys this month"},"limit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Monthly allowance of the plan; null with the workspace's own AI key (no allowance) or before a plan"},"remaining":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"resetsAt":{"type":"string","description":"When the count goes back to 0"},"ownKey":{"type":"boolean","description":"The workspace connected its own OpenAI or Gemini key"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Set when the allowance is used up"}},"required":["used","limit","remaining","resetsAt","ownKey","message"],"description":"Write with AI drafts this month: one draft = one write_sequence or website draft call"},"sendingDomain":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Domain from onboarding, offered for the website draft"},"updatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["profile","ready","aiAvailable","drafts","sendingDomain","updatedAt"]}}}}}}},"/offer-profile/draft":{"post":{"operationId":"offer.draftFromWebsite","summary":"Draft an offer profile from a website","description":"Reads the homepage and drafts the profile from what it says. Nothing is saved: review it, then call update_offer_profile.","tags":["Offer profile"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":3,"maxLength":300,"description":"Homepage, e.g. acme.com"}},"required":["url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"company":{"type":"string","maxLength":120,"default":"","description":"Name of the sender's company"},"product":{"type":"string","maxLength":1000,"default":"","description":"What you sell, in a sentence or two"},"audience":{"type":"string","maxLength":1000,"default":"","description":"Who it is for: roles, company types, sizes"},"problem":{"type":"string","maxLength":1000,"default":"","description":"The problem it solves for them"},"proof":{"type":"string","maxLength":2000,"default":"","description":"Proof points with real numbers or customer names, one per line"},"cta":{"type":"string","maxLength":300,"default":"","description":"What you ask for, e.g. a 15 minute call or a reply"},"tone":{"enum":["plain","friendly","direct","formal"],"type":"string","default":"plain"},"avoid":{"type":"string","maxLength":1000,"default":"","description":"Things never to claim or mention, one per line"}}},"url":{"type":"string"}},"required":["profile","url"]}}}}}}},"/unibox/filters":{"get":{"operationId":"unibox.filters","summary":"Unibox counts by label, mailbox and campaign","tags":["Unibox"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"all":{"type":"number"},"unread":{"type":"number"},"unlabeled":{"type":"number"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"},"threads":{"type":"number"}},"required":["id","name","type","threads"]}},"mailboxes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"threads":{"type":"number"}},"required":["id","email","threads"]}},"campaigns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"threads":{"type":"number"}},"required":["id","name","threads"]}},"aiLabels":{"type":"boolean","description":"Whether replies are labeled by AI in this workspace"}},"required":["all","unread","unlabeled","labels","mailboxes","campaigns","aiLabels"]}}}}}}},"/unibox/threads":{"get":{"operationId":"unibox.threads","summary":"Reply threads, newest first","description":"Filter by unread, label, mailbox or campaign. Page with `cursor` from the previous answer.","tags":["Unibox"],"parameters":[{"name":"view","in":"query","schema":{"enum":["all","unread"],"type":"string","default":"all"},"allowEmptyValue":true,"allowReserved":true},{"name":"labelId","in":"query","schema":{"type":"string","description":"A label id, or \"none\" for threads without a label"},"allowEmptyValue":true,"allowReserved":true},{"name":"mailboxId","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"campaignId","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true},{"name":"search","in":"query","schema":{"type":"string","maxLength":100,"description":"Matches the lead's email, name or company, and the subject"},"allowEmptyValue":true,"allowReserved":true},{"name":"cursor","in":"query","schema":{"type":"string"},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"threads":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"snippet":{"type":"string"},"unread":{"type":"boolean"},"lastMessageAt":{"type":"string"},"messages":{"type":"number","description":"Replies and answers, campaign emails not counted"},"label":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]},{"type":"null"}]},"labelSource":{"anyOf":[{"enum":["ai","rules","user","api"],"type":"string"},{"type":"null"}]},"lead":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","name","company"]},"mailbox":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"}},"required":["id","email"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]}},"required":["id","subject","snippet","unread","lastMessageAt","messages","label","labelSource","lead","mailbox","campaign"]}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["threads","nextCursor"]}}}}}}},"/unibox/threads/{id}":{"get":{"operationId":"unibox.thread","summary":"A thread with every message, the campaign emails and the lead","tags":["Unibox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"snippet":{"type":"string"},"unread":{"type":"boolean"},"lastMessageAt":{"type":"string"},"messages":{"type":"number","description":"Replies and answers, campaign emails not counted"},"label":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]},{"type":"null"}]},"labelSource":{"anyOf":[{"enum":["ai","rules","user","api"],"type":"string"},{"type":"null"}]},"lead":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}}},"required":["id","email","name","company","title","website","country","status","labels"]},"mailbox":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"}},"required":["id","email","displayName","status"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"]},{"type":"null"}]},"labelReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"enum":["in","out"],"type":"string"},"kind":{"enum":["campaign","reply","auto","manual"],"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"type":"string"},"toEmail":{"type":"string"},"subject":{"type":"string"},"text":{"type":"string"},"fullText":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"type":"string"},"status":{"type":"string","description":"sent, failed, bounced, sending"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"step":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Campaign step position (0 = first email)"}},"required":["id","direction","kind","fromName","fromEmail","toEmail","subject","text","fullText","sentAt","status","error","step"]}},"sequence":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"},"currentStep":{"type":"number"},"steps":{"type":"number"},"nextDueAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","currentStep","steps","nextDueAt"]},{"type":"null"}],"description":"Where the lead is in the campaign"},"replyTo":{"type":"string"},"replySubject":{"type":"string"}},"required":["id","subject","snippet","unread","lastMessageAt","messages","label","labelSource","lead","mailbox","campaign","labelReason","items","sequence","replyTo","replySubject"]}}}}}}},"/unibox/threads/{id}/read":{"post":{"operationId":"unibox.markRead","summary":"Mark a thread read or unread","tags":["Unibox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"unread":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/unibox/threads/{id}/label":{"post":{"operationId":"unibox.label","summary":"Set or clear a thread's label","description":"The lead gets the label for the thread's campaign and the label's triggers run (suppress, stop in campaign, pause campaign, move to list). null clears it.","tags":["Unibox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"labelId":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["labelId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"snippet":{"type":"string"},"unread":{"type":"boolean"},"lastMessageAt":{"type":"string"},"messages":{"type":"number","description":"Replies and answers, campaign emails not counted"},"label":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]},{"type":"null"}]},"labelSource":{"anyOf":[{"enum":["ai","rules","user","api"],"type":"string"},{"type":"null"}]},"lead":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}}},"required":["id","email","name","company","title","website","country","status","labels"]},"mailbox":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"}},"required":["id","email","displayName","status"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"]},{"type":"null"}]},"labelReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"enum":["in","out"],"type":"string"},"kind":{"enum":["campaign","reply","auto","manual"],"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"type":"string"},"toEmail":{"type":"string"},"subject":{"type":"string"},"text":{"type":"string"},"fullText":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"type":"string"},"status":{"type":"string","description":"sent, failed, bounced, sending"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"step":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Campaign step position (0 = first email)"}},"required":["id","direction","kind","fromName","fromEmail","toEmail","subject","text","fullText","sentAt","status","error","step"]}},"sequence":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"},"currentStep":{"type":"number"},"steps":{"type":"number"},"nextDueAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","currentStep","steps","nextDueAt"]},{"type":"null"}],"description":"Where the lead is in the campaign"},"replyTo":{"type":"string"},"replySubject":{"type":"string"}},"required":["id","subject","snippet","unread","lastMessageAt","messages","label","labelSource","lead","mailbox","campaign","labelReason","items","sequence","replyTo","replySubject"]}}}}}}},"/unibox/threads/{id}/reply":{"post":{"operationId":"unibox.reply","summary":"Answer a thread","description":"Sends from the mailbox the conversation is on, in the same thread (In-Reply-To and References), to whoever wrote last. The previous message is quoted below.","tags":["Unibox"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":20000}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"subject":{"type":"string"},"snippet":{"type":"string"},"unread":{"type":"boolean"},"lastMessageAt":{"type":"string"},"messages":{"type":"number","description":"Replies and answers, campaign emails not counted"},"label":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]},{"type":"null"}]},"labelSource":{"anyOf":[{"enum":["ai","rules","user","api"],"type":"string"},{"type":"null"}]},"lead":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"company":{"anyOf":[{"type":"string"},{"type":"null"}]},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"website":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"enum":["positive","negative","neutral","warning"],"type":"string"}},"required":["id","name","type"]}}},"required":["id","email","name","company","title","website","country","status","labels"]},"mailbox":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string"}},"required":["id","email","displayName","status"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"]},{"type":"null"}]},"labelReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"direction":{"enum":["in","out"],"type":"string"},"kind":{"enum":["campaign","reply","auto","manual"],"type":"string"},"fromName":{"anyOf":[{"type":"string"},{"type":"null"}]},"fromEmail":{"type":"string"},"toEmail":{"type":"string"},"subject":{"type":"string"},"text":{"type":"string"},"fullText":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"type":"string"},"status":{"type":"string","description":"sent, failed, bounced, sending"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"step":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Campaign step position (0 = first email)"}},"required":["id","direction","kind","fromName","fromEmail","toEmail","subject","text","fullText","sentAt","status","error","step"]}},"sequence":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"},"currentStep":{"type":"number"},"steps":{"type":"number"},"nextDueAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","currentStep","steps","nextDueAt"]},{"type":"null"}],"description":"Where the lead is in the campaign"},"replyTo":{"type":"string"},"replySubject":{"type":"string"}},"required":["id","subject","snippet","unread","lastMessageAt","messages","label","labelSource","lead","mailbox","campaign","labelReason","items","sequence","replyTo","replySubject"]}}}}}}},"/webhooks":{"get":{"operationId":"webhooks.list","summary":"List webhook endpoints","description":"With delivery counts for the last 7 days. Signing secrets are never listed.","tags":["Webhooks"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"enum":["lead.replied","lead.labeled","lead.bounced","lead.unsubscribed","lead.won","campaign.paused"],"type":"string"}},"enabled":{"type":"boolean"},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why Ballast turned it off, when it did"},"lastDeliveryAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastStatus":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"HTTP status of the last attempt, 0 when the endpoint didn't answer"},"delivered":{"type":"number"},"failed":{"type":"number"},"pending":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","url","description","events","enabled","disabledReason","lastDeliveryAt","lastStatus","delivered","failed","pending","createdAt"]}},"events":{"type":"array","items":{"type":"object","properties":{"type":{"enum":["lead.replied","lead.labeled","lead.bounced","lead.unsubscribed","lead.won","campaign.paused"],"type":"string"}},"required":["type"]}}},"required":["webhooks","events"]}}}}}},"post":{"operationId":"webhooks.create","summary":"Add a webhook endpoint","description":"Ballast POSTs JSON to the URL for each chosen event, signed with the returned secret (header Ballast-Signature: t=<unix>,v1=<HMAC-SHA256 hex of \"<t>.<body>\">). The secret is shown once here; reveal it later in Settings.","tags":["Webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","maxLength":120},"events":{"type":"array","minItems":1,"items":{"enum":["lead.replied","lead.labeled","lead.bounced","lead.unsubscribed","lead.won","campaign.paused"],"type":"string"}}},"required":["url","events"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"enum":["lead.replied","lead.labeled","lead.bounced","lead.unsubscribed","lead.won","campaign.paused"],"type":"string"}},"enabled":{"type":"boolean"},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why Ballast turned it off, when it did"},"lastDeliveryAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastStatus":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"HTTP status of the last attempt, 0 when the endpoint didn't answer"},"delivered":{"type":"number"},"failed":{"type":"number"},"pending":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","url","description","events","enabled","disabledReason","lastDeliveryAt","lastStatus","delivered","failed","pending","createdAt"]},"secret":{"type":"string"}},"required":["webhook","secret"]}}}}}}},"/webhooks/{id}":{"patch":{"operationId":"webhooks.update","summary":"Change a webhook's URL, events or on/off","description":"Turning an endpoint back on clears the failure count.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":500},"description":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"events":{"type":"array","minItems":1,"items":{"enum":["lead.replied","lead.labeled","lead.bounced","lead.unsubscribed","lead.won","campaign.paused"],"type":"string"}},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"events":{"type":"array","items":{"enum":["lead.replied","lead.labeled","lead.bounced","lead.unsubscribed","lead.won","campaign.paused"],"type":"string"}},"enabled":{"type":"boolean"},"disabledReason":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Why Ballast turned it off, when it did"},"lastDeliveryAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastStatus":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"HTTP status of the last attempt, 0 when the endpoint didn't answer"},"delivered":{"type":"number"},"failed":{"type":"number"},"pending":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","url","description","events","enabled","disabledReason","lastDeliveryAt","lastStatus","delivered","failed","pending","createdAt"]}}}}}},"delete":{"operationId":"webhooks.remove","summary":"Remove a webhook endpoint","description":"Pending deliveries to it are dropped.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/webhooks/{id}/secret":{"get":{"operationId":"webhooks.revealSecret","summary":"Show a webhook's signing secret","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}}}}}},"post":{"operationId":"webhooks.rollSecret","summary":"Replace a webhook's signing secret","description":"The old secret stops working at once.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"secret":{"type":"string"}},"required":["secret"]}}}}}}},"/webhooks/{id}/test":{"post":{"operationId":"webhooks.test","summary":"Send a test event now","description":"POSTs a signed sample lead.replied event (marked test: true) and returns the endpoint's answer. Not retried.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"delivered":{"type":"boolean"},"status":{"type":"number"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"body":{"type":"string"},"ms":{"type":"number"}},"required":["delivered","status","error","body","ms"]}}}}}}},"/webhooks/{id}/deliveries":{"get":{"operationId":"webhooks.deliveries","summary":"Recent deliveries to an endpoint","description":"Newest first, the last 30 days, with the payload as sent.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"allowEmptyValue":true,"allowReserved":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"deliveries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eventId":{"type":"string"},"type":{"type":"string"},"status":{"enum":["pending","delivered","failed"],"type":"string"},"attempts":{"type":"number"},"responseStatus":{"anyOf":[{"type":"number"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"deliveredAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"payload":{}},"required":["id","eventId","type","status","attempts","responseStatus","error","createdAt","deliveredAt"]}}},"required":["deliveries"]}}}}}}},"/webhooks/deliveries/{id}/redeliver":{"post":{"operationId":"webhooks.redeliver","summary":"Send a failed delivery again","description":"Queues it with a fresh set of retries.","tags":["Webhooks"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}}}}},"/warmup":{"get":{"operationId":"warmup.list","summary":"Warmup for every mailbox","description":"Each mailbox's warmup settings, today's volume and its warmup health score (inbox vs spam over 7 days, by provider). Warmup counts inside the mailbox's daily limit.","tags":["Warmup"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mailboxes":{"type":"array","items":{"type":"object","properties":{"mailboxId":{"type":"string"},"email":{"type":"string"},"supported":{"type":"boolean","description":"Google OAuth mailboxes can't warm up yet"},"enabled":{"type":"boolean"},"target":{"type":"number","description":"Warmup emails a day once the ramp is done"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"rampDaysLeft":{"type":"number"},"replyRate":{"type":"number","description":"Percent of this mailbox's warmup emails that get a reply"},"todayTarget":{"type":"number"},"sentToday":{"type":"number"},"receivedToday":{"type":"number"},"dailyLimit":{"type":"number","description":"The mailbox's daily limit, which warmup counts inside"},"health":{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Share of warmup emails that landed in the inbox over 7 days (0 to 100); null below 10 emails"},"total":{"type":"number"},"inbox":{"type":"number"},"spam":{"type":"number"},"missing":{"type":"number"},"byProvider":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"total":{"type":"number"},"inbox":{"type":"number"},"spam":{"type":"number"},"missing":{"type":"number"},"score":{"type":"number"}},"required":["provider","total","inbox","spam","missing","score"]}}},"required":["score","total","inbox","spam","missing","byProvider"]}},"required":["mailboxId","email","supported","enabled","target","rampStart","rampIncrement","rampDaysLeft","replyRate","todayTarget","sentToday","receivedToday","dailyLimit","health"]}}},"required":["mailboxes"]}}}}}}},"/warmup/{mailboxId}":{"get":{"operationId":"warmup.get","summary":"Warmup for one mailbox","description":"Settings, health by provider and the last 14 days (sent, inbox, spam, missing).","tags":["Warmup"],"parameters":[{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mailboxId":{"type":"string"},"email":{"type":"string"},"supported":{"type":"boolean","description":"Google OAuth mailboxes can't warm up yet"},"enabled":{"type":"boolean"},"target":{"type":"number","description":"Warmup emails a day once the ramp is done"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"rampDaysLeft":{"type":"number"},"replyRate":{"type":"number","description":"Percent of this mailbox's warmup emails that get a reply"},"todayTarget":{"type":"number"},"sentToday":{"type":"number"},"receivedToday":{"type":"number"},"dailyLimit":{"type":"number","description":"The mailbox's daily limit, which warmup counts inside"},"health":{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Share of warmup emails that landed in the inbox over 7 days (0 to 100); null below 10 emails"},"total":{"type":"number"},"inbox":{"type":"number"},"spam":{"type":"number"},"missing":{"type":"number"},"byProvider":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"total":{"type":"number"},"inbox":{"type":"number"},"spam":{"type":"number"},"missing":{"type":"number"},"score":{"type":"number"}},"required":["provider","total","inbox","spam","missing","score"]}}},"required":["score","total","inbox","spam","missing","byProvider"]},"days":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"sent":{"type":"number"},"inbox":{"type":"number"},"spam":{"type":"number"},"missing":{"type":"number"}},"required":["day","sent","inbox","spam","missing"]}}},"required":["mailboxId","email","supported","enabled","target","rampStart","rampIncrement","rampDaysLeft","replyRate","todayTarget","sentToday","receivedToday","dailyLimit","health","days"]}}}}}},"patch":{"operationId":"warmup.update","summary":"Turn warmup on or off and tune it","description":"Warmup emails go to other mailboxes in the pool (other workspaces too) and count inside the daily limit.","tags":["Warmup"],"parameters":[{"name":"mailboxId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"target":{"type":"integer","minimum":1,"maximum":50},"rampStart":{"type":"integer","minimum":1,"maximum":20},"rampIncrement":{"type":"integer","minimum":1,"maximum":10},"replyRate":{"type":"integer","minimum":0,"maximum":80},"restartRamp":{"type":"boolean","description":"Start the warmup ramp again from day 1"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"mailboxId":{"type":"string"},"email":{"type":"string"},"supported":{"type":"boolean","description":"Google OAuth mailboxes can't warm up yet"},"enabled":{"type":"boolean"},"target":{"type":"number","description":"Warmup emails a day once the ramp is done"},"rampStart":{"type":"number"},"rampIncrement":{"type":"number"},"rampDaysLeft":{"type":"number"},"replyRate":{"type":"number","description":"Percent of this mailbox's warmup emails that get a reply"},"todayTarget":{"type":"number"},"sentToday":{"type":"number"},"receivedToday":{"type":"number"},"dailyLimit":{"type":"number","description":"The mailbox's daily limit, which warmup counts inside"},"health":{"type":"object","properties":{"score":{"anyOf":[{"type":"number"},{"type":"null"}],"description":"Share of warmup emails that landed in the inbox over 7 days (0 to 100); null below 10 emails"},"total":{"type":"number"},"inbox":{"type":"number"},"spam":{"type":"number"},"missing":{"type":"number"},"byProvider":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"total":{"type":"number"},"inbox":{"type":"number"},"spam":{"type":"number"},"missing":{"type":"number"},"score":{"type":"number"}},"required":["provider","total","inbox","spam","missing","score"]}}},"required":["score","total","inbox","spam","missing","byProvider"]}},"required":["mailboxId","email","supported","enabled","target","rampStart","rampIncrement","rampDaysLeft","replyRate","todayTarget","sentToday","receivedToday","dailyLimit","health"]}}}}}}},"/sending-ip":{"get":{"operationId":"sendingIp.get","summary":"Where your mailboxes connect from","description":"SMTP/IMAP mailboxes connect through the Deliverability Network: the shared network on every plan, dedicated IPs, or your own proxy (API and MCP only). Microsoft and Gmail API mailboxes need none.","tags":["Deliverability Network"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"required":{"type":"boolean","description":"False only in development: mailboxes may then connect directly"},"own":{"anyOf":[{"type":"object","properties":{"address":{"type":"string"},"status":{"type":"string"},"statusReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"exitIp":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"ipType":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastCheckedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["address","status","statusReason","exitIp","country","ipType","lastCheckedAt"]},{"type":"null"}]},"proxies":{"type":"array","items":{"type":"object","properties":{"route":{"enum":["shared","dedicated","own"],"type":"string"},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"ip":{"anyOf":[{"type":"string"},{"type":"null"}]},"mailboxes":{"type":"number"}},"required":["route","country","ip","mailboxes"]}},"waiting":{"type":"number","description":"Mailboxes waiting for a sending IP"},"direct":{"type":"number","description":"Microsoft and Gmail API mailboxes, which need no proxy"},"dedicated":{"type":"object","properties":{"allowed":{"type":"number"},"used":{"type":"number"},"addonPriceUsd":{"type":"number"},"addons":{"type":"number"}},"required":["allowed","used","addonPriceUsd","addons"]}},"required":["required","own","proxies","waiting","direct","dedicated"]}}}}}}},"/sending-ip/own/test":{"post":{"operationId":"sendingIp.testOwn","summary":"Test your own proxy without saving","description":"Logs one of your SMTP/IMAP mailboxes in through it (or checks Gmail answers through it when you have none) and reads its IP type from IPinfo.","tags":["Deliverability Network"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":3,"maxLength":500,"description":"socks5://user:pass@host:port or http://user:pass@host:port"}},"required":["url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"exitIp":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"ipType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"IPinfo network type: isp is what you want; hosting means a datacenter"},"login":{"anyOf":[{"type":"object","properties":{"email":{"type":"string"},"smtp":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]},"imap":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]}},"required":["email","smtp","imap"]},{"type":"null"}],"description":"SMTP AUTH and IMAP LOGIN of one of your mailboxes through the proxy"},"handshake":{"anyOf":[{"type":"object","properties":{"smtp":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]},"imap":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]}},"required":["smtp","imap"]},{"type":"null"}],"description":"Gmail's SMTP 587 and IMAP 993 answering through the proxy"}},"required":["ok","error","exitIp","country","ipType","login","handshake"]}}}}}}},"/sending-ip/own":{"put":{"operationId":"sendingIp.setOwn","summary":"Use your own proxy","description":"Tested first; saved only when it passes. Every SMTP/IMAP mailbox of the workspace then connects through it instead of the pool. Free on every plan.","tags":["Deliverability Network"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":3,"maxLength":500}},"required":["url"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"saved":{"type":"boolean"},"test":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"exitIp":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"ipType":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"IPinfo network type: isp is what you want; hosting means a datacenter"},"login":{"anyOf":[{"type":"object","properties":{"email":{"type":"string"},"smtp":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]},"imap":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]}},"required":["email","smtp","imap"]},{"type":"null"}],"description":"SMTP AUTH and IMAP LOGIN of one of your mailboxes through the proxy"},"handshake":{"anyOf":[{"type":"object","properties":{"smtp":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]},"imap":{"type":"object","properties":{"ok":{"type":"boolean"},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["ok","error"]}},"required":["smtp","imap"]},{"type":"null"}],"description":"Gmail's SMTP 587 and IMAP 993 answering through the proxy"}},"required":["ok","error","exitIp","country","ipType","login","handshake"]}},"required":["saved","test"]}}}}}},"delete":{"operationId":"sendingIp.removeOwn","summary":"Stop using your own proxy","description":"Your SMTP/IMAP mailboxes go back to the shared pool (they wait if it has no room).","tags":["Deliverability Network"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"waiting":{"type":"number"}},"required":["ok","waiting"]}}}}}}}}}