Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement Clay webhook receivers and HTTP API column callbacks for real-time data flow. Use when setting up webhook endpoints, handling enrichment callbacks from Clay, or building event-driven integrations with Clay tables. Trigger with phrases like "clay webhook", "clay events", "clay callback", "handle clay data", "clay notifications", "clay HTTP API column".
.claude/skills/jeremylongshore-clay-webhooks-events/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 22% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 239% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 118% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 104% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 80% | 0% |
Clay's event-driven architecture has two webhook patterns: (1) Inbound webhooks -- you POST data into Clay tables via unique webhook URLs, and (2) Outbound HTTP API columns -- Clay POSTs enriched data to your endpoint after enrichment completes. This skill covers both patterns with production-ready handlers.
Every Clay table has a unique webhook URL. When you POST JSON to this URL, a new row appears in the table.
typescript// src/clay/inbound.ts — send data into Clay tables class ClayInboundWebhook { constructor( private webhookUrl: string, private submissionCount: number = 0, private readonly LIMIT: number = 50_000, ) {} async sendRow(data: Record<string, unknown>): Promise<void> { if (this.submissionCount >= this.LIMIT) { throw new Error(`Webhook exhausted (${this.LIMIT} submissions). Create a new webhook in Clay.`); } const res = await fetch(this.webhookUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data), }); if (!res.ok) { throw new Error(`Clay webhook failed: ${res.status} ${res.statusText}`); } this.submissionCount++; } async sendBatch(rows: Record<string, unknown>[], delayMs = 200): Promise<{ sent: number; failed: number }> { let sent = 0, failed = 0; for (const row of rows) { try { await this.sendRow(row); sent++; } catch { failed++; } await new Promise(r => setTimeout(r, delayMs)); } return { sent, failed }; } } // Usage const webhook = new ClayInboundWebhook(process.env.CLAY_WEBHOOK_URL!); await webhook.sendRow({ email: 'cto@acme.com', domain: 'acme.com', first_name: 'Jane', last_name: 'Doe', source: 'website-form', });
Clay's HTTP API enrichment column POSTs data to your endpoint after enrichment runs. Set up a handler:
typescript// src/clay/outbound-handler.ts — receive enriched data from Clay import express from 'express'; import crypto from 'crypto'; const app = express(); app.use(express.json({ limit: '1mb' })); // Signature verification middleware function verifyClaySignature(req: any, res: any, next: any) { const signature = req.headers['x-clay-signature']; const secret = process.env.CLAY_WEBHOOK_SECRET; if (secret && signature) { const expected = crypto.createHmac('sha256', secret) .update(JSON.stringify(req.body)) .digest('hex'); if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) { return res.status(401).json({ error: 'Invalid signature' }); } } next(); } // Main callback endpoint app.post('/api/clay/enriched', verifyClaySignature, async (req, res) => { // Respond 200 immediately — Clay expects fast response res.json({ received: true, timestamp: new Date().toISOString() }); // Process enriched data async try { await processEnrichedLead(req.body); } catch (err) { console.error('Failed to process enriched lead:', err); } }); interface EnrichedLead { email?: string; first_name?: string; last_name?: string; company_name?: string; job_title?: string; employee_count?: number; industry?: string; linkedin_url?: string; icp_score?: number; personalized_opener?: string; } async function processEnrichedLead(lead: EnrichedLead): Promise<void> { // Route based on ICP score if (lead.icp_score && lead.icp_score >= 80 && lead.email) { await pushToOutreachSequence(lead); } else if (lead.icp_score && lead.icp_score >= 50) { await addToNurtureCampaign(lead); } else { console.log(`Low-score lead skipped: ${lead.email} (score: ${lead.icp_score})`); } }
In your Clay table, add an HTTP API enrichment column:
https://your-app.com/api/clay/enrichedContent-Type: application/jsonX-Clay-Signature: {{shared-secret-hash}} (optional)json{ "email": "{{Work Email}}", "first_name": "{{first_name}}", "last_name": "{{last_name}}", "company_name": "{{Company Name}}", "job_title": "{{Job Title}}", "employee_count": "{{Employee Count}}", "industry": "{{Industry}}", "linkedin_url": "{{LinkedIn URL}}", "icp_score": "{{ICP Score}}", "personalized_opener": "{{Personalized Opener}}" }
ISNOTEMPTY(Work Email) AND ICP Score >= 50Clay may retry failed HTTP API calls. Ensure idempotent handling:
typescript// src/clay/idempotency.ts const processedSet = new Set<string>(); function getIdempotencyKey(lead: EnrichedLead): string { return crypto.createHash('sha256') .update(`${lead.email}:${lead.company_name}:${Date.now().toString().slice(0, -4)}`) .digest('hex'); } async function processIdempotent(lead: EnrichedLead): Promise<boolean> { const key = getIdempotencyKey(lead); if (processedSet.has(key)) { console.log(`Duplicate callback skipped: ${lead.email}`); return false; } processedSet.add(key); await processEnrichedLead(lead); return true; }
typescript// src/clay/integrations.ts — push enriched leads to downstream tools // Zapier webhook trigger async function triggerZapier(lead: EnrichedLead): Promise<void> { await fetch(process.env.ZAPIER_WEBHOOK_URL!, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(lead), }); } // Slack notification for high-value leads async function notifySlack(lead: EnrichedLead): Promise<void> { if (!lead.icp_score || lead.icp_score < 90) return; await fetch(process.env.SLACK_WEBHOOK_URL!, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: `Hot lead from Clay: ${lead.first_name} ${lead.last_name} (${lead.job_title}) at ${lead.company_name} - ICP Score: ${lead.icp_score}`, }), }); }
| Issue | Cause | Solution | |-------|-------|----------| | Webhook returns 404 | URL expired or table deleted | Re-create webhook in Clay table | | HTTP API column shows error | Your endpoint unreachable | Verify HTTPS URL is publicly accessible | | Duplicate callbacks | Clay retried failed request | Implement idempotency (Step 4) | | Webhook 50K limit hit | High volume usage | Create new webhook on same table | | Callback timeout | Slow processing | Respond 200 immediately, process async |
For performance optimization, see clay-performance-tuning.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→fail | 20,451 | 14,089 | -31% | 1 | 1 | 0% | 4,061 | 4,937 | +22% | 0 | 0 | — |
case-15 | pass→pass | 25,906 | 14,579 | -44% | 1 | 1 | 0% | 3,628 | 5,076 | +40% | 0 | 0 | — |
case-01 | fail→pass | 14,706 | 9,426 | -36% | 1 | 1 | 0% | 3,455 | 4,212 | +22% | 0 | 0 | — |
case-03 | pass→pass | 14,831 | 15,014 | +1% | 1 | 1 | 0% | 2,133 | 4,084 | +91% | 0 | 0 | — |
case-04 | pass→pass | 9,703 | 6,905 | -29% | 1 | 1 | 0% | 1,521 | 3,103 | +104% | 0 | 0 | — |
case-05 | pass→fail | 13,773 | 19,010 | +38% | 1 | 1 | 0% | 2,413 | 5,726 | +137% | 0 | 0 | — |
case-06 | pass→pass | 14,908 | 14,304 | -4% | 1 | 1 | 0% | 2,722 | 4,745 | +74% | 0 | 0 | — |
case-07 | pass→pass | 13,184 | 6,798 | -48% | 1 | 1 | 0% | 1,944 | 3,394 | +75% | 0 | 0 | — |
case-08 | fail→pass | 32,047 | 14,472 | -55% | 1 | 1 | 0% | 1,557 | 5,276 | +239% | 0 | 0 | — |
case-09 | fail→pass | 8,233 | 5,893 | -28% | 1 | 1 | 0% | 1,475 | 3,209 | +118% | 0 | 0 | — |
case-10 | fail→pass | 8,161 | 5,009 | -39% | 1 | 1 | 0% | 1,465 | 2,992 | +104% | 0 | 0 | — |
case-11 | fail→fail | 12,312 | 9,109 | -26% | 1 | 1 | 0% | 2,360 | 3,873 | +64% | 0 | 0 | — |
case-12 | pass→pass | 12,462 | 7,549 | -39% | 1 | 1 | 0% | 2,100 | 3,462 | +65% | 0 | 0 | — |
case-13 | fail→pass | 12,229 | 7,775 | -36% | 1 | 1 | 0% | 2,002 | 3,608 | +80% | 0 | 0 | — |
case-14 | fail→fail | 14,781 | 10,327 | -30% | 1 | 1 | 0% | 2,432 | 3,914 | +61% | 0 | 0 | — |
case-16 | fail→fail | 10,924 | 8,573 | -22% | 1 | 1 | 0% | 2,111 | 3,951 | +87% | 0 | 0 | — |
case-17 | pass→pass | 5,842 | 2,889 | -51% | 1 | 1 | 0% | 783 | 2,559 | +227% | 0 | 0 | — |
case-18 | pass→pass | 9,895 | 8,409 | -15% | 1 | 1 | 0% | 1,582 | 3,495 | +121% | 0 | 0 | — |
case-19 | fail→pass | 5,164 | 2,241 | -57% | 1 | 1 | 0% | 762 | 2,501 | +228% | 0 | 0 | — |
case-20 | pass→pass | 5,602 | 1,891 | -66% | 1 | 1 | 0% | 1,115 | 2,496 | +124% | 0 | 0 | — |
case-21 | pass→pass | 9,795 | 6,147 | -37% | 1 | 1 | 0% | 1,680 | 3,152 | +88% | 0 | 0 | — |
case-22 | pass→pass | 13,482 | 13,196 | -2% | 1 | 1 | 0% | 2,202 | 4,486 | +104% | 0 | 0 | — |
case-23 | pass→pass | 7,724 | 2,308 | -70% | 1 | 1 | 0% | 1,196 | 2,448 | +105% | 0 | 0 | — |
case-24 | fail→pass | 9,806 | 3,449 | -65% | 1 | 1 | 0% | 1,569 | 2,750 | +75% | 0 | 0 | — |
case-25 | pass→pass | 16,918 | 10,744 | -36% | 1 | 1 | 0% | 3,248 | 4,145 | +28% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted, and 24 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +24 percentage points is the difference between those two pass rates over the 24 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.