> ## Documentation Index
> Fetch the complete documentation index at: https://docs.introlink.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Follow asks with webhooks

> Hear the moment an ask leaves your Gmail, check the signature, then follow it with the API until the intro happens.

IntroLink can tell your system the moment one of your asks is sent. Your
endpoint checks that the delivery came from IntroLink, then asks the API where
the ask stands, and drafts a nudge when one is due.

| Step | REST | MCP tool |
| - | - | - |
| 1. An ask is sent | the `ask.sent` webhook | |
| 2. Where it stands | `GET /v1/asks/{id}` | `list_asks` |
| 3. What's waiting on you | `GET /v1/asks?filter=waiting_on_you` | `list_asks` |
| 4. Draft a nudge | `POST /v1/asks/{id}/followup` | |

Webhooks are REST only. In Claude or ChatGPT, ask "Which of my asks are waiting
on me?" and the assistant answers from `list_asks`.

> [!NOTE]
>
> The calls below ran against IntroLink's preview workspace: Pat Preview's
> made-up network, with one ask sent to Dana Reyes about Tom Hale six days
> earlier. Ids are shortened.

## 1. Run an endpoint

This receiver checks every delivery's signature, answers at once, skips
repeats, and on `ask.sent` asks the API where the ask stands. Node 18 or later,
no packages.

```js receiver.mjs theme={null}
// receiver.mjs: run with `node receiver.mjs` (Node 18 or later, no packages).
import { createServer } from "node:http";
import { createHmac, timingSafeEqual } from "node:crypto";

const SECRET = process.env.INTROLINK_WEBHOOK_SECRET; // whsec_… from Settings → API → Webhooks
const API_KEY = process.env.INTROLINK_API_KEY; // il_live_… from Settings → API
const API = process.env.INTROLINK_API ?? "https://app.introlink.ai/v1";
const seen = new Set(); // webhook-ids already handled; use your database in production

function verified(headers, rawBody) {
  const id = headers["webhook-id"];
  const ts = headers["webhook-timestamp"];
  const sigs = headers["webhook-signature"];
  if (!id || !ts || !sigs || !/^\d+$/.test(ts)) return false;
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // older than 5 minutes: a replay
  const key = Buffer.from(SECRET.slice("whsec_".length), "base64");
  const want = Buffer.from(createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest("base64"));
  return sigs.split(" ").some((s) => {
    const got = Buffer.from(s.startsWith("v1,") ? s.slice(3) : "");
    return got.length === want.length && timingSafeEqual(got, want);
  });
}

createServer((req, res) => {
  let raw = "";
  req.on("data", (chunk) => (raw += chunk));
  req.on("end", async () => {
    if (!verified(req.headers, raw)) {
      res.writeHead(401).end();
      return;
    }
    res.writeHead(204).end(); // answer within 10 seconds; do the work after
    const id = req.headers["webhook-id"];
    if (seen.has(id)) return; // a retry of an event you already handled
    seen.add(id);

    const event = JSON.parse(raw);
    if (event.type !== "ask.sent") return;
    const { ask, target, connector } = event.data;
    console.log(`Sent: ${ask.subject} (to ${connector?.name ?? target.name})`);

    // Where it stands now, from the API.
    const r = await fetch(`${API}/asks/${ask.id}`, { headers: { Authorization: `Bearer ${API_KEY}` } });
    const now = await r.json();
    console.log(`${now.text} Next: ${now.next_step?.label ?? "nothing yet"}`);
  });
}).listen(8080, () => console.log("Listening on :8080"));
```

IntroLink only delivers to a public `https://` address. To try it from your
laptop, put a tunnel in front of port 8080 (`cloudflared tunnel --url
http://localhost:8080`, or ngrok) and use the address it prints.

## 2. Point IntroLink at it

In IntroLink, open **Settings → API**. Under **Webhooks**:

1. **Send events to**: your endpoint's `https://` address.
2. **Events**: tick **An ask left your Gmail** (`ask.sent`). Tick the intro
   request events too if founders ask you for intros through your intro page.
3. **Signing secret**: choose **Reveal** and copy it.

Start the receiver with the secret and a key:

```bash theme={null}
export INTROLINK_WEBHOOK_SECRET=whsec_…
export INTROLINK_API_KEY=il_live_…
node receiver.mjs
```

Then choose **Send a test**. IntroLink sends a signed `webhook.test` event and
shows what your endpoint answered: "Delivered. Your endpoint answered 204 in …
ms." Each person sets their own webhook, and it carries their own events only.

## 3. An ask is sent

When an ask leaves your Gmail, from IntroLink's composer or from Gmail itself,
IntroLink posts `ask.sent`:

```http theme={null}
POST /introlink HTTP/1.1
content-type: application/json
user-agent: IntroLink-Webhooks/1.0
webhook-id: evt_9d8bc2f35974ba151b50807bd78c4679
webhook-timestamp: 1795901794
webhook-signature: v1,nTcT2i20KmLIg8g1JFAmLBvvNqlxLt8+gB4rr3O9bSc=
```

```json theme={null}
{
  "type": "ask.sent",
  "timestamp": "2026-11-28T21:36:33.000Z",
  "data": {
    "ask": {
      "id": "5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90",
      "subject": "Intro to Tom Hale at Keelhaven Equity?",
      "sent_at": "2026-11-28T21:36:33.000Z",
      "url": "https://app.introlink.ai/asks?ask=5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90"
    },
    "target": { "id": "p_ZC1Q5G…", "name": "Tom Hale", "role": "Investor, Keelhaven Equity", "url": "https://app.introlink.ai/open?person=p_ZC1Q5G…" },
    "connector": { "id": "p_MyndDR…", "name": "Dana Reyes", "role": "Investor, Keelhaven Equity", "url": "https://app.introlink.ai/open?person=p_MyndDR…" }
  }
}
```

`ask.id` is the id the API takes, and the people carry the same ids as the API
gives the person who set up the webhook. Your receiver checks the signature,
answers `204`, prints `Sent: Intro to Tom Hale at Keelhaven Equity? (to Dana
Reyes)`, and then prints where the ask stands, from the API. A tampered body or
a timestamp more than five minutes old gets `401`, and a retry with the same
`webhook-id` is skipped.

## 4. Follow it

Six days later, ask where it stands again:

```bash theme={null}
curl -s "https://app.introlink.ai/v1/asks/5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90" \
  -H "Authorization: Bearer $INTROLINK_API_KEY"
```

```json theme={null}
{
  "object": "ask",
  "id": "5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90",
  "person": { "id": "p_ZC1Q5G…", "name": "Tom Hale", "role": "Investor, Keelhaven Equity" },
  "via": { "id": "p_MyndDR…", "name": "Dana Reyes" },
  "stage": "sent",
  "stage_label": "Sent",
  "headline": "No reply",
  "step": 1,
  "bucket": "waiting",
  "waiting_on": "you",
  "reminder_due": true,
  "closed_reason": null,
  "next_step": { "label": "Send a nudge", "url": "https://app.introlink.ai/asks/5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90/nudge" },
  "thread_url": "https://mail.google.com/mail/u/0/#all/…",
  "url": "https://app.introlink.ai/asks?ask=5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90",
  "text": "Tom Hale, asked Dana Reyes: No reply. No reply in 6 days."
}
```

IntroLink reads the ask's Gmail thread to know this: no reply from Dana in six
days, so a nudge is due. `GET /v1/asks?filter=waiting_on_you` lists every ask
like this one at once. Draft the nudge:

```bash theme={null}
curl -s "https://app.introlink.ai/v1/asks/5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90/followup" \
  -H "Authorization: Bearer $INTROLINK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind": "nudge"}'
```

```json theme={null}
{
  "object": "followup_draft",
  "saved": false,
  "kind": "nudge",
  "ask": { "id": "5f0c2a7e-3b1d-4c8e-9a6f-2d7b8e1c4a90", "…": "…" },
  "subject": "Re: Intro to Tom Hale at Keelhaven Equity?",
  "body": "Hi Dana,\nFollowing up on my note below about Tom Hale. If you don't know Tom well enough to introduce me, or the timing is wrong, that is completely fine. A quick reply either way would help.\nThanks,\nPat",
  "thread_url": "https://mail.google.com/mail/u/0/#all/…",
  "gmail_drafts_url": null,
  "problem": null,
  "text": "A nudge to Dana Reyes, not saved. Send \"save\": true to put it in your Gmail drafts, as a reply in the ask's thread."
}
```

Send `"save": true` to put it in your Gmail drafts, as a reply in the same
thread. It is never sent: you send it from Gmail. Once the intro has happened,
`{"kind": "thanks"}` drafts the thank-you, and
`POST /v1/asks/{id}/close` with `{"reason": "done"}` closes the ask.

## In Python

The same signature check, for a Python endpoint. Pass the raw body, before any
JSON parsing:

```python theme={null}
import base64, hashlib, hmac, time


def verified(secret: str, headers: dict, raw_body: bytes) -> bool:
    msg_id = headers.get("webhook-id")
    ts = headers.get("webhook-timestamp")
    sigs = headers.get("webhook-signature")
    if not msg_id or not ts or not sigs or not ts.isdigit():
        return False
    if abs(time.time() - int(ts)) > 300:
        return False
    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{msg_id}.{ts}.".encode() + raw_body
    want = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    return any(
        s.startswith("v1,") and hmac.compare_digest(s[3:], want) for s in sigs.split(" ")
    )
```

Deliveries follow [Standard Webhooks](https://www.standardwebhooks.com), so
that project's libraries check them too.

## Answers and retries

Answer any `2xx` within 10 seconds. No answer, a timeout, `408`, `429` or a
`5xx` is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6
hours, with the same `webhook-id`. Any other answer, a redirect included, marks
the delivery failed. Settings shows the last delivery and how it went.

More in [Webhooks](https://docs.introlink.ai/public-api/webhooks.md) and [Asks](https://docs.introlink.ai/public-api/asks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.