API RecipesBy Zapinner1 min read
Validate CRM Data Before Import
Reject malformed records at the boundary with a clear reason, so only clean data reaches your CRM.
Problem
You're about to import records into a CRM and want to reject the malformed ones up front rather than clean up after.
Request
bash
curl -X POST https://zapinner.com/api/v1/guard \
-H "Authorization: Bearer $ZAPINNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"records": [
{ "email": "sales@acme.com", "phone": "+17045551234" },
{ "email": "not-an-email", "phone": "" }
],
"expect": { "email": "email", "phone": "phone" }
}'Output
json
{
"results": [
{ "passed": true },
{ "passed": false, "failures": [{ "field": "email", "reason": "invalid_format" }] }
]
}Explanation
Guard checks each record against the expectations you declare and returns a per-record pass/fail with the specific reason a field failed — deterministically.
Error handling
A failing record isn't an API error — it's a result with passed: false. Reserve error handling for malformed requests (400) and auth/limit responses (401/429).
Production considerations
- Route failures to a review queue instead of dropping them.
- Pair with Map to reshape before validating, and Repair to fix accepted records.
Related APIs
Map (reshape first), Repair (fix accepted records).
Fix messy data before it breaks your workflow.
Start free with 1,000 credits a month across every capability — no credit card required.
