API RecipesBy Zapinner1 min read
Transform Webhook Data
Reshape an inbound webhook payload into the exact schema your application expects, with field renames and type conversion.
Problem
A webhook sends fields with source-specific names and formats. Your app expects a fixed schema, and you don't want bespoke mapping code for every provider.
Request
bash
curl -X POST https://zapinner.com/api/v1/map \
-H "Authorization: Bearer $ZAPINNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"records": [{ "Full Name": "Jane Doe", "Company Name": "Acme", "Amount": "$1,200" }],
"target": { "name": "Full Name", "company": "Company Name", "amount": "Amount" }
}'Output
json
{ "data": [{ "name": "Jane Doe", "company": "Acme", "amount": 1200 }] }Explanation
Map expresses the field mapping as declarative configuration — renames, coalescing from fallbacks, and type conversion — so absorbing a new provider is a config change, not new code.
Error handling
Handle the structured error for malformed payloads. Combine with Guard to reject records that don't meet your contract after mapping.
Production considerations
- Keep one mapping config per source, reviewable in version control.
- Map first to fix shape, then Normalize values and Guard the result.
Related APIs
Normalize (values after reshaping), Guard (validate the result).
Fix messy data before it breaks your workflow.
Start free with 1,000 credits a month across every capability — no credit card required.
