API reference

Base URL: /api/v1. Authenticate with x-api-key: to_live_… (or Authorization: Bearer). Webhooks also accept ?api_key= for tools that can't set headers. Get a key in the workspace.

POST /check

Evaluate a proposed send. Rules run in order: global suppression (exact email, then email domain) → active deal → contact cooldown → account cooldown → send caps (inbox 24h → sending domain 24h → account 7d) → VIP approval → AI-agent approval. Every check writes an audit receipt.

{ "email": "jane@acme.com", "tool": "Instantly", "actor": "sdr@you.com", "sequence": "Q4", "touch_type": "sequence_step",
  "sender_email": "sdr@mail.you.com",      // optional: enables inbox + domain daily caps
  "sender_domain": "mail.you.com",         // optional: derived from sender_email when omitted
  "is_ai_generated": false, "record_touch": true, "send_at": "optional ISO time" }
→ { "decision": "allow" | "block" | "suppress" | "needs_approval", "reason_code": "contact_cooldown", "reason": "…",
    "block_reason": "global_suppression",  // only on decision "block"
    "suppression": { "id": "sup_…", "scope": "email", "value": "jane@acme.com", "reason": "unsubscribe", "source_tool": "HubSpot" },
    "cap": { "type": "sender_inbox_daily_cap", "current": 50, "limit": 50, "window_hours": 24 },
    "conflicting_touch": { "tool": "Apollo", "occurred_at": "…" }, "cooldown_until": "…", "receipt_id": "rcpt_…", "approval_id": null }
curl -X POST https://gettouchonce.com/api/v1/check \
  -H "x-api-key: $TOUCHONCE_KEY" -H "content-type: application/json" \
  -d '{"email":"jane@acme.com","tool":"Instantly","sequence":"Q4 Outbound","sender_email":"sdr@mail.you.com"}'

Block reasons (decision: "block")

reason_codeWhenExtra fields
global_suppressionThe email, or its domain, is on the workspace suppression list. Checked before every other rule; replies included.suppression
sender_inbox_daily_capsender_email already sent ≥ sender_inbox_daily_cap outbound touches in the rolling 24h (default 50).cap
sender_domain_daily_capAll inboxes on sender_domain sent ≥ sender_domain_daily_cap in the rolling 24h (default 150).cap
account_weekly_capThe prospect's company domain already received ≥ account_weekly_cap touches in the rolling 7 days (default 5; free-mail domains ignored).cap

Caps never apply to replies. Set any cap to 0 for unlimited. Collision rules keep returning decision: "suppress" (contact_cooldown, domain_cooldown, active_deal).

NEW Global suppression · /suppressions

One suppression list for every tool and AI agent: "stop once, stop everywhere". scope is email or domain; reason is unsubscribe | hard_bounce | opt_out | complaint | manual. Values are lowercased and unique per workspace + scope. Every add/remove writes an audit receipt.

GET    /suppressions?search=acme&scope=email|domain&reason=unsubscribe&limit=500&offset=0
       → { "total": 12, "suppressions": [{ "id": "sup_…", "scope": "email", "value": "jane@acme.com", "reason": "unsubscribe",
                                           "source_tool": "HubSpot", "notes": "…", "created_at": "…" }] }
POST   /suppressions  { "scope": "email", "value": "jane@acme.com", "reason": "unsubscribe", "source_tool": "HubSpot", "notes": "optional" }
       → 201 { "suppression": {…}, "created": true, "receipt_id": "rcpt_…" }   (200 + created:false if already listed)
POST   /suppressions  [ {…}, {…} ]   or   { "suppressions": [ … ] }     (bulk, max 5000)
       → 201 { "added": 2, "existing": 1, "errors": 0, "results": [ … ] }
DELETE /suppressions/:id  → { "ok": true, "receipt_id": "rcpt_…" }
curl -X POST https://gettouchonce.com/api/v1/suppressions \
  -H "x-api-key: $TOUCHONCE_KEY" -H "content-type: application/json" \
  -d '[{"scope":"email","value":"optout@acme.com","reason":"unsubscribe","source_tool":"HubSpot"},
       {"scope":"domain","value":"competitor.io","reason":"manual","notes":"Never prospect"}]'

curl "https://gettouchonce.com/api/v1/suppressions?scope=domain&search=competitor" -H "x-api-key: $TOUCHONCE_KEY"

curl -X DELETE https://gettouchonce.com/api/v1/suppressions/sup_123 -H "x-api-key: $TOUCHONCE_KEY"

NEW Send-cap guardrails · /rules

Burnout protection for your deliverability. All fields are optional on PUT/PATCH /rules.

{ "global_suppression_enabled": true,      // enforce the suppression list on /check
  "auto_suppress_on_bounce": true,         // webhook bounce / hard_bounce events → suppression
  "auto_suppress_on_unsubscribe": true,    // unsubscribe, opt_out, spam_complaint, not_interested → suppression
  "sender_inbox_daily_cap": 50,            // per sender_email, rolling 24h (0 = unlimited)
  "sender_domain_daily_cap": 150,          // per sender_domain, rolling 24h (0 = unlimited)
  "account_weekly_cap": 5 }                // touches per prospect company domain, rolling 7d (0 = unlimited)
curl -X PATCH https://gettouchonce.com/api/v1/rules \
  -H "x-api-key: $TOUCHONCE_KEY" -H "content-type: application/json" \
  -d '{"sender_inbox_daily_cap":40,"sender_domain_daily_cap":120,"account_weekly_cap":4}'

GET /metrics adds suppressions_count, suppressions_by_reason, auto_suppressions, block_reasons (counts per block reason) and sender_caps_usage (top sending inboxes and domains in the last 24h vs. cap, with pct and status ok | near_cap | at_cap).

POST /touches

Record a touch that already happened (single object or {"touches":[…]}, max 1000). Returns any collision it caused.

{ "email": "jane@acme.com", "tool": "Gmail", "actor": "Dana", "touch_type": "cold_email", "direction": "outbound", "deal_stage": "Discovery", "occurred_at": "…",
  "sender_email": "dana@acme-mail.com", "sender_domain": "acme-mail.com" }   // sender fields count toward send caps

POST /webhooks/:provider

Providers: instantly, apollo, hubspot, clay, smartlead, generic. Accepts one event, an array, or {events|data|results:[…]}. HubSpot dealstage opens or closes deals automatically.

Auto-suppression: when an event's type/action (event_type, event, type, action or status) is bounce, hard_bounce, unsubscribe, unsubscribed, opt_out, spam_complaint or not_interested (provider variants like EMAIL_BOUNCE or lead_unsubscribed included; soft bounces ignored), the email is upserted into the global suppression list (scope email, with source tool and reason) instead of the touch ledger, and an auto_suppression receipt is written. Controlled by auto_suppress_on_bounce / auto_suppress_on_unsubscribe.

curl -X POST "https://gettouchonce.com/api/v1/webhooks/instantly?api_key=$TOUCHONCE_KEY" \
  -H "content-type: application/json" \
  -d '{"events":[{"event_type":"email_sent","lead_email":"ok@acme.com","campaign_name":"Q4"},
                 {"event_type":"lead_unsubscribed","lead_email":"bye@acme.com"}]}'
→ { "provider": "instantly", "received": 2, "recorded": 1, "auto_suppressed": 1,
    "results": [ { "touch_id": "tch_…", … }, { "email": "bye@acme.com", "auto_suppressed": true, "reason": "unsubscribe", "suppression_id": "sup_…", "receipt_id": "rcpt_…" } ] }

POST /audit/csv no auth

Run the 30-day collision audit. Body {"files":[{"name":"apollo.csv","content":"…"}],"options":{"cooldown_days":14,"domain_window_days":7,"domain_max_contacts":3}} or a raw text/csv body. Columns are auto-mapped (email, date, tool, owner/sender, sequence, deal stage). GET /audit/sample returns the report for the sample dataset.

Approvals, rules and audit

GET  /approvals?status=pending|approved|rejected|suppressed_contact|suppressed_domain|all
POST /approvals/:id/approve | reject | suppress_contact | suppress_domain   {"note":"optional"}
GET  /rules        PUT /rules  {"contact_cooldown_days":14,"domain_max_contacts":3,"vip_domains":["acme.com"],…}
GET  /suppressions POST /suppressions {"scope":"email|domain","value":"…","reason":"…"}  DELETE /suppressions/:id
GET  /deals        POST /deals {"domain":"acme.com","stage":"Proposal Sent","owner":"Dana"}
GET  /touches?q=&tool=&touch_type=&collision=true&limit=&offset=
GET  /receipts?q=&kind=&decision=     GET /receipts/verify   GET /metrics?days=7
GET  /keys  POST /keys {"label":"…"}  DELETE /keys/:id      POST /workspaces {"name":"…"} (no auth)
GET  /health (no auth)