Deploy Instantly integrations to Vercel, Fly.io, and Cloud Run platforms.
Use when deploying Instantly-powered applications to production,
configuring platform-specific secrets, or setting up deployment pipelines.
Trigger with phrases like "deploy instantly", "instantly Vercel",
"instantly production deploy", "instantly Cloud Run", "instantly Fly.io".
Deploy Instantly API v2 integrations — primarily webhook receivers and automation services — to cloud platforms. Instantly webhooks require a public HTTPS endpoint that responds within 30 seconds (3 retries on failure). This skill covers Vercel serverless functions, Google Cloud Run containers, and Fly.io deployments.
Prerequisites
Completed instantly-install-auth setup
Working Instantly integration tested locally (see instantly-local-dev-loop)
Cloud platform account (Vercel, GCP, or Fly.io)
Domain or HTTPS URL for webhook endpoint
Instructions
Option A: Vercel Serverless Functions
// api/webhooks/instantly.ts — Vercel serverless function
import type { VercelRequest, VercelResponse } from "@vercel/node";
export default async function handler(req: VercelRequest, res: VercelResponse) {
if (req.method !== "POST") {
return res.status(405).json({ error: "Method not allowed" });
}
// Validate webhook secret
const secret = req.headers["x-webhook-secret"];
if (secret !== process.env.INSTANTLY_WEBHOOK_SECRET) {
return res.status(401).json({ error: "Unauthorized" });
}
const { event_type, data } = req.body;
// Respond immediately — Instantly expects 2xx within 30s
res.status(200).json({ received: true });
// Process event asynchronously
try {
switch (event_type) {
case "reply_received":
await syncReplyToCRM(data);
break;
case "email_bounced":
await handleBounce(data);
break;
case "lead_interested":
await notifySalesTeam(data);
break;
case "lead_unsubscribed":
await addToBlockList(data);
break;
}
} catch (err) {
console.error(`Webhook processing error: ${event_type}`, err);
}
}
async function addToBlockList(data: { lead_email: string }) {
await fetch("https://api.instantly.ai/api/v2/block-lists-entries", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.INSTANTLY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ bl_value: data.lead_email }),
});
}