Examples
Copy-paste-ready snippets for common languages and tools.
cURL
cURL
curl https://zapinner.com/api/v1/leads/recovery \
-H "Authorization: Bearer $ZAPINNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"industry": "roofing",
"status": "estimate_sent",
"lead_age_days": 28,
"estimate_value": 12000,
"explicit_rejection": false
}'Node.js
node.js
// Node 18+ (global fetch)
const res = await fetch("https://zapinner.com/api/v1/leads/recovery", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ZAPINNER_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
industry: "roofing",
status: "estimate_sent",
lead_age_days: 28,
estimate_value: 12000,
}),
})
if (!res.ok) {
const { error } = await res.json()
throw new Error(`${error.code}: ${error.message}`)
}
const result = await res.json()
console.log(result.recovery_score, result.priority)Python
python
import os, requests
resp = requests.post(
"https://zapinner.com/api/v1/leads/recovery",
headers={"Authorization": f"Bearer {os.environ['ZAPINNER_API_KEY']}"},
json={
"industry": "roofing",
"status": "estimate_sent",
"lead_age_days": 28,
"estimate_value": 12000,
},
timeout=15,
)
resp.raise_for_status()
data = resp.json()
print(data["recovery_score"], data["priority"])TypeScript SDK (coming soon)
A lightweight typed SDK is on the way. It is not yet published to npm, so for now use the fetch example above — the API is plain HTTPS and JSON and needs no dependency. This preview shows the planned shape.
typescript (planned)
// Coming soon: npm install @zapinner/sdk
// The SDK is not yet published — use the fetch example above today.
// Once released, the typed client will look like this:
import { Zapinner } from "@zapinner/sdk"
const zapinner = new Zapinner({ apiKey: process.env.ZAPINNER_API_KEY })
const result = await zapinner.leads.recovery({
industry: "roofing",
status: "estimate_sent",
estimateValue: 12000,
leadAgeDays: 28,
})
console.log(result.recovery_score, result.priority)Batch
cURL
curl https://zapinner.com/api/v1/leads/recovery/batch \
-H "Authorization: Bearer $ZAPINNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"leads": [
{ "industry": "hvac", "status": "no_response", "lead_age_days": 190 },
{ "industry": "roofing", "status": "estimate_sent", "lead_age_days": 28, "estimate_value": 12000 }
]
}'