# Webhooks

> For the complete documentation index, see [llms.txt](https://bordfeed.com/llms.txt).

Post new jobs from your feed straight to your job board, hourly, daily or weekly.

## How delivery works

Webhooks keep a job board stocked without manual work. Point a feed at a URL on
your site, and Bordfeed posts the new matching jobs there on the schedule you
pick. Your site saves them and publishes them.

Each request is one `feed.delivery` event, the only event Bordfeed sends.
Webhooks are available on every plan, including pay as you go.

Bordfeed checks for due deliveries every hour. A feed is due when at least 90%
of its frequency has passed since its last delivery. The first delivery goes out
on the first check after you set it up. If no new jobs match, no request is
sent.

A delivery carries up to 100 active jobs, newest first: the jobs that match the
feed's filters and are new since the last delivery (by the feed's since field,
first visible by default). The first delivery includes all current matches, up
to 100. If more than 100 new jobs match in one window, the extra jobs are not
carried over to the next delivery. Pick a shorter frequency, or
[export](https://bordfeed.com/docs/export) the feed, if you need every job.

## Set up a webhook feed

Choose webhook delivery when you create a feed in the dashboard, or set the
feed's `delivery` through the API with a URL, a secret and a frequency. To
change the URL, secret or frequency of an existing feed, use the API
(`PATCH /api/v1/feeds/{id}`); the dashboard can pause and resume the feed.

```json
{
  "mode": "webhook",
  "url": "https://example.com/hooks/bordfeed",
  "secret": "a-random-string-of-at-least-16-chars",
  "frequency": "daily"
}
```

| Field       | Rule                                                                 |
| ----------- | -------------------------------------------------------------------- |
| `url`       | Required. Must be HTTPS and must not resolve to a private address.   |
| `secret`    | Required. At least 16 characters. Used to sign every request.        |
| `frequency` | Required. `hourly`, `daily` or `weekly`.                             |
| `events`    | Optional. Only `["feed.delivery"]` is accepted.                      |

The URL is checked when you save it and again, with a DNS lookup, before every
delivery.

## Request

Bordfeed sends a `POST` with a JSON body and these headers:

| Header                  | Value                                      |
| ----------------------- | ------------------------------------------ |
| `Content-Type`          | `application/json`                         |
| `X-Bordfeed-Signature`  | Hex HMAC-SHA256 of the raw body            |
| `X-Bordfeed-Feed-Id`    | The feed's id                              |

The request times out after 10 seconds. Redirects are followed for up to 5 hops,
and only within the original origin over HTTPS.

## Payload

```json
{
  "event": "feed.delivery",
  "feed_id": "0b9f0f4e-6a54-4c63-9a3e-1a3f5c2d7e11",
  "feed_name": "Remote writing jobs",
  "jobs": [
    {
      "id": "6c1d2f0a-3b7e-4d11-8f55-0e9a7c4b2d10",
      "title": "Senior Editor",
      "company": { "id": null, "name": "Example Co", "slug": null },
      "apply_url": "https://example.com/careers/senior-editor",
      "status": "active"
    }
  ],
  "delivered_at": "2026-10-07T09:01:12.000Z"
}
```

The example shows a few fields of each job. Each entry in `jobs` is the full Job
object from the [API Reference](https://bordfeed.com/docs/api), the same shape the feed jobs
endpoint returns. The payload has exactly these top-level fields: `event`,
`feed_id`, `feed_name`, `jobs` and `delivered_at`.

## Verify the signature

`X-Bordfeed-Signature` is the lowercase hex HMAC-SHA256 of the raw request body,
keyed with your feed secret. Compute it over the exact bytes you received, not a
re-serialized object.

```js
import { createHmac, timingSafeEqual } from "node:crypto";

function isValid(rawBody, signature, secret) {
  const expected = createHmac("sha256", secret).update(rawBody).digest("hex");
  const a = Buffer.from(signature, "hex");
  const b = Buffer.from(expected, "hex");
  return a.length === b.length && timingSafeEqual(a, b);
}

// Express: use express.raw({ type: "application/json" }) so req.body is a Buffer.
app.post("/hooks/bordfeed", (req, res) => {
  const signature = req.get("X-Bordfeed-Signature") ?? "";
  if (!isValid(req.body, signature, process.env.BORDFEED_SECRET)) {
    return res.sendStatus(401);
  }
  const event = JSON.parse(req.body.toString("utf8"));
  // event.jobs ...
  res.sendStatus(200);
});
```

The signature does not include a timestamp. Deduplicate on job `id` if you need
to guard against replays.

## Failures and retries

A delivery succeeds when your endpoint returns a 2xx status. Any other status, a
timeout, a blocked URL or a network error is a failure. An error on Bordfeed's
side while preparing a delivery is recorded as a failure too.

- After a failure, the same jobs are sent again on the next hourly check, so
  your board does not miss any.
- Each feed counts consecutive failures. A success resets the count to 0.
- After 5 consecutive failures the feed is disabled and stops delivering until
  you enable it again.

Bordfeed records every attempt with its HTTP status or error. A failed request
is not retried within the same check.

## Credits

Each new job a webhook delivers costs $0.01 on pay as you go, charged once per
workspace.
A job you already received, from a webhook, the [API](https://bordfeed.com/docs/api), an
[export](https://bordfeed.com/docs/export) or MCP, is free to get again. When your credit runs out,
deliveries send what your balance covers, and the workspace owner is emailed
a link to top up. Deliveries resume after you top up.
