Documentation
API reference
One endpoint. Send a form submission, get back a category. Use the same key across every website and form you own.
Authentication
Every request needs your API key in the Authorization header as a bearer token. Create and manage keys from your dashboard.
Authorization
Authorization: Bearer ig_live_your_keyPOST /api/v1/check
Submit a single form submission for classification. Only email is required, but more context yields better categorization.
curl
curl https://sendworth.dev/api/v1/check \
-H "Authorization: Bearer ig_live_your_key" \
-H "Content-Type: application/json" \
-d '{
"email": "jane@example.com",
"name": "Jane Doe",
"subject": "Question about pricing",
"message": "Hi, do you offer annual billing?"
}'fetch.ts
const res = await fetch("https://sendworth.dev/api/v1/check", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SENDWORTH_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
email: form.email,
name: form.name,
subject: form.subject,
message: form.message,
}),
})
const result = await res.json()
// { category, isSpam, confidence, reason, signals }Response
200 OK
{
"category": "lead",
"isSpam": false,
"confidence": 0.88,
"reason": "Genuine pre-sales question about billing options.",
"signals": {
"disposableDomain": false,
"senderReputation": "clean",
"aiChecked": true
}
}Categories
Every account starts with these four categories. Pro accounts can add custom categories and enable or disable any of them.
Using it with Resend
The whole point: branch on the category so you never spend a Resend send on junk.
form-handler.ts
import { Resend } from "resend"
const resend = new Resend(process.env.RESEND_API_KEY)
const check = await fetch("https://sendworth.dev/api/v1/check", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SENDWORTH_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify(submission),
}).then((r) => r.json())
// Only spend a Resend send on things worth sending.
if (check.category === "lead" || check.category === "support-request") {
await resend.emails.send({
from: "forms@yourdomain.com",
to: "you@yourdomain.com",
subject: `New ${check.category}: ${submission.subject}`,
text: submission.message,
})
}Errors & limits
401— missing or invalid API key.422— the request body failed validation (e.g. no email).429— monthly check quota exceeded. Upgrade or wait for the reset.