होमप्राइसिंग

डेवलपर्स

वेबहुक

कोई रिकॉर्ड बदलने पर आपके URL पर एक साइन किया हुआ POST।

सेटअप

SettingsDevelopersWebhooksवर्कस्पेस के मालिक और एडमिन
  1. 1

    अपना URL जोड़िए

    एक सार्वजनिक https:// पता। निजी और आंतरिक पते स्वीकार नहीं होते।

  2. 2

    इवेंट चुनिए

    सिर्फ़ आपके चुने हुए इवेंट भेजे जाते हैं।

  3. 3

    सीक्रेट सँभालिए

    whsec_… साइनिंग सीक्रेट सिर्फ़ एक बार दिखता है।

  • Send test एक ping इवेंट भेजता है।
  • हाल की डिलीवरी: पिछले 14 दिन।

इवेंट

रिकॉर्डcreatedupdateddeleted
contactcontact.createdcontact.updatedcontact.deleted
companycompany.createdcompany.updatedcompany.deleted
dealdeal.createddeal.updateddeal.deleted
notenote.creatednote.updatednote.deleted
tasktask.createdtask.updatedtask.deleted
इनसे हुए बदलावों पर भेजे जाते हैंऐपAPIइंपोर्टवर्कफ़्लो

अनुरोध

POSThttps://your-app.example.com/webhooks/promptlab
हेडरउदाहरण
PromptLab-Eventdeal.updated
PromptLab-Deliveryevt_…
PromptLab-Signaturet=1700000000,v1=<hex>
User-AgentPromptLab-Webhooks/1.0
Content-Typeapplication/json
बॉडी
{
  "id": "evt_…",
  "type": "deal.updated",
  "createdAt": "2026-10-22T08:15:51.000Z",
  "data": {
    "id": "<record id>",
    "object": "deal",
    "name": "API deal",
    "changes": [
      { "field": "stage", "from": "NEW", "to": "QUALIFIED" }
    ]
  },
  "actor": { "type": "user", "id": "<user id>" }
}
  • changes सिर्फ़ updated इवेंट में आता है।
  • changes में सिर्फ़ वे फ़ील्ड होते हैं जो API लौटाता है।
  • name पता हो तो शामिल होता है।
  • इवेंट छोटे होते हैं: पूरा रिकॉर्ड API से लीजिए।
  • निजी टास्क, और किसी प्रोजेक्ट के नोट्स व टास्क के लिए कोई इवेंट नहीं आता।
actor.typeuserintegrationsystem
REST API

सिग्नेचर जाँचिए

  1. 1PromptLab-Signature से t और v1 पढ़िए।
  2. 2अपने सीक्रेट से <t>.<raw body> का HMAC-SHA256, hex में।
  3. 3v1 से कॉन्स्टेंट टाइम में मिलाइए।
  4. 4t 5 मिनट से पुराना हो तो अस्वीकार कीजिए।
Node.js
import crypto from "node:crypto";

// rawBody: the request body exactly as received (a string or Buffer)
export function verify(rawBody, header, secret) {
  if (typeof header !== "string") return false;
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > 5 * 60) return false;

  const expected = crypto
    .createHmac("sha256", secret)
    .update(`${t}.${rawBody}`)
    .digest("hex");

  const a = Buffer.from(expected);
  const b = Buffer.from(parts.v1 ?? "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// Express: read the body raw, so it is signed exactly as sent
// app.post("/webhooks/promptlab", express.raw({ type: "application/json" }), (req, res) => {
//   if (!verify(req.body, req.get("PromptLab-Signature"), process.env.PROMPTLAB_WEBHOOK_SECRET)) return res.sendStatus(400);
//   const event = JSON.parse(req.body);
//   res.sendStatus(200);
// });
Python
import hashlib, hmac, time

# raw_body: the request body exactly as received (bytes)
def verify(raw_body: bytes, header: str, secret: str) -> bool:
    try:
        parts = dict(p.split("=", 1) for p in (header or "").split(","))
        t = int(parts.get("t", 0))
    except ValueError:
        return False
    if not t or abs(time.time() - t) > 5 * 60:
        return False

    signed = f"{t}.".encode() + raw_body
    expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, parts.get("v1", ""))

दोबारा कोशिश

10 सेकंड
हर कोशिश का टाइमआउट
6
लगभग 30 मिनट में प्रयास
20
लगातार विफल इवेंट वेबहुक बंद कर देते हैं
  • 2xx के अलावा कोई भी जवाब या टाइमआउट होने पर, एक्सपोनेंशियल बैकऑफ़ के साथ दोबारा भेजा जाता है।
  • डुप्लिकेट छोड़ने के लिए इवेंट की id इस्तेमाल कीजिए।
  • बंद हो गया? Settings में फिर से चालू कीजिए।