/api/webhooks/adfADF/XML lead intake — OEM and lead-provider webhook
Standard ADF/XML POST receiver for OEM lead programs and third-party providers (Cars.com, AutoTrader, HomeNet, Edmunds). Per-dealer token in the query string identifies the lead source. Optional HMAC signature provides defense-in-depth for high-trust vendors. Lead processing runs on the same production pipeline as our inbound-email path — two intake surfaces, one downstream.
- Authentication
- Per-dealer ADF token in query string (?token=...). When ADF_WEBHOOK_SECRET is configured on a dealer, the x-adf-signature header is REQUIRED on every request — a missing signature is treated as an attack.
- Headers
Content-Typerequiredapplication/xml or text/xmlx-adf-signatureoptionalHex-encoded HMAC-SHA256 of the raw body, signed with the dealer's ADF_WEBHOOK_SECRET. Required when HMAC is enabled on the lead source.- Caching
- Never cached. Each POST creates a real Lead row and downstream LeadActivity events.
- Rate limits
- No published rate limit. Behind Vercel's edge protection. Sustained > 10 RPS per token will trigger graylisting — contact developers@gladiuscrm.com if you need a higher tier.
- Error responses
400Empty request body.401Missing token / invalid token / missing signature header / invalid HMAC signature.500Internal pipeline error. Response includes { error: string }. Safe to retry with exponential backoff.- Notes
- HMAC signature scheme: hex(HMAC-SHA256(secret, raw_request_body)). The constant-time comparison is performed in src/app/api/webhooks/adf/route.ts. Raw body MUST be passed byte-for-byte — re-serializing the XML between signing and POSTing will break the signature.
Example request
curl -X POST \
"https://gladiuscrm.com/api/webhooks/adf?token=lds_REPLACE_WITH_YOUR_TOKEN" \
-H "Content-Type: application/xml" \
-H "x-adf-signature: <hex-sha256-hmac-of-body>" \
--data-binary @lead.xmlExample response
{
"success": true,
"leadId": "clxyz123abc456def789",
"parseOk": true,
"autoAssigned": true
}