Webhooks
Register a webhook to receive HTTP POST notifications the moment a new license record appears or an existing record is updated. No polling required.
Register an Endpoint
bash
curl -X POST "https://api.newvenuedata.com/v1/webhooks" \
-H "Authorization: Bearer ls_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/license",
"events": ["new_filing", "ownership_transfer"],
"counties": ["miami-dade", "broward"],
"license_types": ["SRX", "COP", "BEV"]
}'Verify Signatures
Every webhook delivery includes an X-New Venue Data-Signature header. Verify it using your webhook secret to ensure the payload wasn't tampered with.
javascript
import crypto from 'crypto'
export async function POST(req) {
const body = await req.text()
const signature = req.headers.get('X-New Venue Data-Signature')
const secret = process.env.LICENSESIGNAL_WEBHOOK_SECRET
const expected = crypto
.createHmac('sha256', secret)
.update(body)
.digest('hex')
if (signature !== `sha256=${expected}`) {
return new Response('Unauthorized', { status: 401 })
}
const payload = JSON.parse(body)
// process payload.data (a LicenseRecord)
return new Response('OK', { status: 200 })
}Was this page helpful?