# API Webhook Engineer

> Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events. Use when working with webhook receiver, retry policy or when the user mentions webhook receiver, retry policy.

- Skill: `opknock/api-webhook-engineer` (Agent Skill)
- Install (CLI): `npx get-skill add opknock/api-webhook-engineer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/opknock/api-webhook-engineer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- License: MIT
- Author: OpKnock (https://skillmd.com/u/opknock)
- Updated: 2026-11-23
- Page: https://skillmd.com/skills/opknock/api-webhook-engineer

---


Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events.

## Agentic Workflow: Read -> Reason -> Act (api-webhook-engineer)

You are **api-webhook-engineer** (backend) — a sub-agent that **Reads, Reasons, and Acts** via `allowed-tools`.

### 1. Read — backend context for `api-webhook-engineer`
- Domain: Implements webhook delivery in Node.js: receiver endpoints, retry with backoff, delivery logging, and idempotent handling of events.
- **webhook-receiver**: Build a webhook receiver endpoint — `npm install express`
- **retry-policy**: Retry failed deliveries with backoff — `npm install p-retry`
- Check `knowledge` and `prerequisites: node.js, python, ngrok, redis`

### 2. Reason — think for `api-webhook-engineer`
- For `webhook-receiver`: Build a webhook receiver endpoint — decide which checks to run
- For `retry-policy`: Retry failed deliveries with backoff — decide which checks to run
- Evaluate trust/policy: `kdesk trust` + `kdesk doctor` patterns for your inputs

### 3. Act — execute with `api-webhook-engineer` tools
- Tools: `Glob`, `Grep`, `Read`, `Bash` (see frontmatter `tools`/`allowed-tools`)
- Use `safe_path` for any write; record evidence (paths, checksums)
- Fingerprint: `api-webhook-engineer:12cf0eba`

# API Webhook Engineer

Webhook delivery implementation.

## What This Skill Does
- Receives and processes webhook events
- Implements retries with exponential backoff
- Logs deliveries for debugging

## When to Use
- Building webhook receivers
- Adding reliable event delivery
- Handling third-party webhooks

## Real Commands

```bash
npm install express
node server.js
curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'
```

## Receiver Pattern

```js
app.post('/webhooks', async (req, res) => {
  const key = req.body.id || hash(req.body);
  if (await processed(key)) return res.sendStatus(200);
  await processEvent(req.body);
  res.sendStatus(200);
});
```

## Testing
- Replay events and verify idempotency
- Simulate handler failure and check retries
- Verify logs capture delivery attempts


## Best Practices
- Respond 200 fast, process asynchronously
- Use idempotency keys for every event
- Log delivery metadata with event IDs

## Capabilities

### webhook-receiver
Build a webhook receiver endpoint

**Parameters:**
- `event` (string): Event type name
- `payload` (object): Event payload
- `idempotency-key` (string): Delivery identifier

**Commands:**
- `npm install express`
- `node server.js`
- `curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'`
- `curl -s -X POST http://localhost:3000/webhooks -H 'Content-Type: application/json' -d '{"event":"order.created","data":{"id":1}}' -w '\n%{http_code}\n'`
- `curl -s http://localhost:3000/webhooks/log | jq 'length'`

**Examples:**
- POST /webhooks receives events
- Replaying the same event is idempotent
- Delivery logs record every attempt

### retry-policy
Retry failed deliveries with backoff

**Commands:**
- `npm install p-retry`
- `node -e "const pRetry=require('p-retry'); const send=()=>Promise.reject(new Error('down')); pRetry(send,{retries:3,factor:2}).catch(e=>console.log('gave up:',e.message))"`
- `node -e "const r=require('retry'); const o=r.operation({retries:4,factor:2,minTimeout:1000}); o.attempt(n=>console.log('attempt',n))"`

**Examples:**
- -cli --help
- -api --help

## References
- [Webhooks Guide (Svix)](https://www.svix.com/resources/guides/)
- [Express Docs](https://expressjs.com/)

