Scraper API
Webhooks
Be told when a run ends: endpoints, events, the signed request and how to verify it, retries and the delivery log.
A webhook tells your server that a run has ended, so you do not have to keep asking. You give us an https URL;
when a run of yours ends, we send that URL a signed POST with the run in it.
There are two ways to get one:
- An endpoint on your account: a URL that is told about every run that ends with one of the events it asked for. Add one on the Webhooks page of the console, or with the API below.
- A
webhook_urlon one run: named when you start the run, told about that run only.
Both are sent the same event, signed the same way.
Add an endpoint#
curl -X POST "https://api.enrichednow.com/v1/webhooks" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/hooks/enrichednow","events":["run.succeeded","run.partial","run.failed"]}'import json
import os
import urllib.request
body = {
"url": "https://example.com/hooks/enrichednow",
"events": ["run.succeeded", "run.partial", "run.failed"],
}
request = urllib.request.Request(
"https://api.enrichednow.com/v1/webhooks",
method="POST",
data=json.dumps(body).encode(),
headers={
"Authorization": f"Bearer {os.environ['ENRICHEDNOW_API_KEY']}",
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(request, timeout=90) as response:
print(json.dumps(json.load(response), indent=2))Nothing to install. Save as run.py and run python3 run.py
const response = await fetch("https://api.enrichednow.com/v1/webhooks", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ENRICHEDNOW_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://example.com/hooks/enrichednow",
events: ["run.succeeded", "run.partial", "run.failed"],
}),
});
console.log(JSON.stringify(await response.json(), null, 2));Nothing to install. Save as run.mjs and run node run.mjs
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{"url":"https://example.com/hooks/enrichednow","events":["run.succeeded","run.partial","run.failed"]}`)
request, err := http.NewRequest("POST", "https://api.enrichednow.com/v1/webhooks", body)
if err != nil {
panic(err)
}
request.Header.Set("Authorization", "Bearer "+os.Getenv("ENRICHEDNOW_API_KEY"))
request.Header.Set("Content-Type", "application/json")
response, err := http.DefaultClient.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
answer, err := io.ReadAll(response.Body)
if err != nil {
panic(err)
}
fmt.Println(response.Status)
fmt.Println(string(answer))
}Nothing to install. Save as run.go and run go run run.go
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Run {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.enrichednow.com/v1/webhooks"))
.header("Authorization", "Bearer " + System.getenv("ENRICHEDNOW_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("{\"url\":\"https://example.com/hooks/enrichednow\",\"events\":[\"run.succeeded\",\"run.partial\",\"run.failed\"]}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}Nothing to install. Save as Run.java and run java Run.java
The answer is the endpoint and its signing secret:
{
"id": "whk_3f0c1d9a7b2e4c6d8e0f1a2b",
"url": "https://example.com/hooks/enrichednow",
"description": "",
"events": ["run.succeeded", "run.partial", "run.failed"],
"enabled": true,
"disabled_reason": null,
"disabled_at": null,
"last_success_at": null,
"last_failure_at": null,
"created_at": "2026-11-18T10:00:00.000000Z",
"secret": "whsec_…"
}What the URL must be:
https. Plainhttpis refused.- A public host. A URL whose host is
localhost, a name that is not a public one, or a private, loopback or link-local address is refused with422invalid_inputonurl. The check is made again each time something is sent: a name that resolves to an address that is not public gets nothing. - Without a user name or a password in it. A token in the path or the query is fine.
An account has at most 10 endpoints. Managing them works with an API key and from the console alike:
| Call | Does |
|---|---|
GET /v1/webhooks | Lists your endpoints, and says whether the account has a secret for a run's own webhook_url. |
POST /v1/webhooks | Adds an endpoint. The only answer that carries its secret. |
GET /v1/webhooks/{id} | One endpoint. |
PATCH /v1/webhooks/{id} | Changes url, events, description or enabled. |
DELETE /v1/webhooks/{id} | Deletes it. Nothing more is sent to it. |
POST /v1/webhooks/{id}/rotate-secret | Replaces its secret and returns the new one, once. |
POST /v1/webhooks/run-secret | Makes, or replaces, the secret for a run's own webhook_url. |
GET /v1/webhooks/deliveries | The delivery log. |
POST /v1/webhooks/deliveries/{id}/resend | Sends a delivery again. |
Events#
One event for each way a run can end:
| Event | Run status | Sent when |
|---|---|---|
run.succeeded | ok | The run ended and its records are ready. |
run.partial | partial | The run ended with some of its records; reason says what was left out. |
run.failed | failed | The run ended with no records; reason says why. |
run.unsupported | unsupported | The target is one we cannot read yet. |
run.cancelled | cancelled | The run was cancelled. |
An endpoint is sent only the events in its events. A run's own webhook_url is sent whichever one the run ends
with. Results and statuses says what each status and reason means.
An endpoint can also ask for a playbook's events: formula_run.finished, formula_run.failed,
rows.new (a saved playbook's new rows, at most 500 to an event) and saved_formula.paused.
Saved playbooks and schedules says when each is sent. They are signed as below and
tried 6 times over 24 hours; a rows.new delivery whose rows were all suppressed before it went is cancelled,
rows_suppressed.
The request we send#
POST /hooks/enrichednow HTTP/1.1
Host: example.com
Content-Type: application/json
User-Agent: EnrichedNow-Webhooks/1
X-Webhook-Id: evt_8d1f0a3b5c7e9f1a2b4c6d8e
X-Webhook-Delivery: whd_1a2b3c4d5e6f7a8b9c0d1e2f
X-Webhook-Event: run.succeeded
X-Webhook-Attempt: 1
X-Webhook-Timestamp: 1794996004
X-Webhook-Signature: v1=5f2c…e91a{
"id": "evt_8d1f0a3b5c7e9f1a2b4c6d8e",
"type": "run.succeeded",
"created_at": "2026-11-16T22:37:51.063245Z",
"data": {
"run": { …the run, exactly as GET /v1/runs/{id} returns it… }
}
}data.run is the whole run. For the run the other pages follow, it is the body of this answer:
{
"id": "run_841742f37553189ff9c27ba1",
"scraper_id": "ats.board",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"board_url": "https://boards.greenhouse.io/acme"
},
"record_count": 21,
"units": 1,
"units_per_request": 1,
"units_per_record": null,
"units_per_page": null,
"diagnostics": {
"requests": 1,
"bytes": 259214,
"wall_ms": 885,
"facts": {
"careers_url": "https://boards.greenhouse.io/acme",
"discovery": "supplied",
"ats": "greenhouse",
"pages_read": 1,
"renders_refused": 0
}
},
"created_at": "2026-11-16T22:37:50.170950Z",
"started_at": "2026-11-16T22:37:50.178331Z",
"finished_at": "2026-11-16T22:37:51.066313Z"
}| Part | Meaning |
|---|---|
id, X-Webhook-Id | The event's id. The same on every attempt, and when you resend it: use it to recognise an event you already handled. |
type, X-Webhook-Event | The event — see Events. |
created_at | When the run ended. |
data.run | The run, exactly as GET /v1/runs/{id} returns it — see Run. It carries what the run cost, units, and the rate it ran at: units_per_request, units_per_record or units_per_page. |
X-Webhook-Delivery | The id of this delivery in the delivery log. A resend is a new delivery of the same event. |
X-Webhook-Attempt | 1 for the first attempt, 2 for the first retry, and so on. |
X-Webhook-Timestamp | When this attempt was signed, in seconds since 1970 (UTC). |
X-Webhook-Signature | v1= and the signature — see below. |
The records are not in the event. Fetch them with GET /v1/runs/{id}/records, in
any format.
Answer with any 2xx status within 10 seconds, and do the work after you have answered. Anything else — another
status, a redirect, no answer in time — counts as a failed attempt. A redirect is never followed: give the final
URL. Nothing of your answer's body is kept.
Verify the signature#
Anybody who learns your URL can post to it. The signature is how you know a request came from us: it is the
HMAC-SHA256, written in hexadecimal after v1=, of the timestamp, a dot, and the body exactly as it arrived,
under the endpoint's secret.
X-Webhook-Signature = "v1=" + hex( HMAC-SHA256( secret, X-Webhook-Timestamp + "." + body ) )Three things to get right:
- Sign the raw bytes of the body, before any JSON parsing. A body that was parsed and written out again is not the same bytes.
- Compare in constant time (
hmac.compare_digest,crypto.timingSafeEqual), not with==. - Refuse a timestamp more than 5 minutes from now. The timestamp is signed too, so a request somebody recorded cannot be played back to you later.
import hashlib
import hmac
import time
def verify_webhook(secret: str, timestamp: str, body: bytes, signature: str, tolerance_s: int = 300) -> bool:
"""secret: the endpoint's signing secret. timestamp, signature: the X-Webhook-Timestamp and
X-Webhook-Signature headers. body: the request body as raw bytes."""
try:
sent = int(timestamp)
except (TypeError, ValueError):
return False
if abs(time.time() - sent) > tolerance_s:
return False
expected = "v1=" + hmac.new(secret.encode(), f"{sent}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, signature or "")const crypto = require("node:crypto");
/**
* secret: the endpoint's signing secret. timestamp, signature: the X-Webhook-Timestamp and
* X-Webhook-Signature headers. body: the request body as a Buffer of the raw bytes.
*/
function verifyWebhook(secret, timestamp, body, signature, toleranceSeconds = 300) {
if (!/^\d+$/.test(String(timestamp))) return false;
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSeconds) return false;
const mac = crypto.createHmac("sha256", secret).update(`${timestamp}.`).update(body).digest("hex");
const expected = Buffer.from(`v1=${mac}`);
const given = Buffer.from(String(signature || ""));
return given.length === expected.length && crypto.timingSafeEqual(given, expected);
}In a web framework, read the body before it is parsed: request.get_data() in Flask, await request.body() in
FastAPI, express.raw({ type: "application/json" }) in Express. Answer 400 to a request that does not verify,
and do nothing with it.
Each package has this check built in, and a second function that also returns the event:
| Check | Check and read the event | |
|---|---|---|
| Python | verify_webhook(secret, timestamp, body, signature) | parse_webhook(...) |
| JavaScript | verifyWebhook(secret, timestamp, body, signature) | parseWebhook(...) |
| JavaScript, Web Crypto (edge runtimes, browsers) | await verifyWebhookAsync(...) | await parseWebhookAsync(...) |
| Go | enrichednow.VerifyWebhook(secret, r.Header, body) | enrichednow.ParseWebhook(secret, r.Header, body) |
| Java | Webhooks.verify(secret, timestamp, body, signature) | Webhooks.parse(...) |
Each takes a tolerance other than 5 minutes as a last argument, and the parse function throws (raises, returns an error) when the request does not verify. With the JavaScript package, in Express:
import express from "express";
import { parseWebhook, WebhookVerificationError } from "enrichednow";
const app = express();
app.post("/hooks/enrichednow", express.raw({ type: "application/json" }), (req, res) => {
let event;
try {
event = parseWebhook(
process.env.WEBHOOK_SECRET,
req.get("X-Webhook-Timestamp"),
req.body, // a Buffer of the raw bytes
req.get("X-Webhook-Signature"),
);
} catch (error) {
if (error instanceof WebhookVerificationError) return res.sendStatus(400);
throw error;
}
res.sendStatus(204); // answer first, then do the work
const { run } = event.data;
console.log(event.type, run.id, run.record_count, "records,", run.units, "units");
});On an edge runtime (a Cloudflare Worker, a Next.js handler on the edge runtime), read the body with
await request.arrayBuffer() and use parseWebhookAsync, which checks the signature with Web Crypto.
The command-line tool checks one by hand: enrichednow webhooks verify --timestamp … --signature … --file body.json.
When you replace a secret, every attempt made from then on is signed with the new one, deliveries that were already waiting included.
A webhook for one run#
Name a URL when you start a run and that run's end is posted there, whichever way it ends, beside your endpoints:
curl -X POST "https://api.enrichednow.com/v1/scrapers/careers.company/runs" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"domain":"ramp.com"},"webhook_url":"https://example.com/hooks/run-done"}'import json
import os
import urllib.request
body = {
"input": {"domain": "ramp.com"},
"webhook_url": "https://example.com/hooks/run-done",
}
request = urllib.request.Request(
"https://api.enrichednow.com/v1/scrapers/careers.company/runs",
method="POST",
data=json.dumps(body).encode(),
headers={
"Authorization": f"Bearer {os.environ['ENRICHEDNOW_API_KEY']}",
"Content-Type": "application/json",
},
)
with urllib.request.urlopen(request, timeout=90) as response:
print(json.dumps(json.load(response), indent=2))Nothing to install. Save as run.py and run python3 run.py
const response = await fetch("https://api.enrichednow.com/v1/scrapers/careers.company/runs", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.ENRICHEDNOW_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: { domain: "ramp.com" },
webhook_url: "https://example.com/hooks/run-done",
}),
});
console.log(JSON.stringify(await response.json(), null, 2));Nothing to install. Save as run.mjs and run node run.mjs
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
body := strings.NewReader(`{"input":{"domain":"ramp.com"},"webhook_url":"https://example.com/hooks/run-done"}`)
request, err := http.NewRequest("POST", "https://api.enrichednow.com/v1/scrapers/careers.company/runs", body)
if err != nil {
panic(err)
}
request.Header.Set("Authorization", "Bearer "+os.Getenv("ENRICHEDNOW_API_KEY"))
request.Header.Set("Content-Type", "application/json")
response, err := http.DefaultClient.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
answer, err := io.ReadAll(response.Body)
if err != nil {
panic(err)
}
fmt.Println(response.Status)
fmt.Println(string(answer))
}Nothing to install. Save as run.go and run go run run.go
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Run {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.enrichednow.com/v1/scrapers/careers.company/runs"))
.header("Authorization", "Bearer " + System.getenv("ENRICHEDNOW_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("{\"input\":{\"domain\":\"ramp.com\"},\"webhook_url\":\"https://example.com/hooks/run-done\"}"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}Nothing to install. Save as Run.java and run java Run.java
A run names a URL, not an endpoint, so what is sent there is signed with a secret of the account's. Make it once, before the first such run:
curl -X POST "https://api.enrichednow.com/v1/webhooks/run-secret" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"import json
import os
import urllib.request
request = urllib.request.Request(
"https://api.enrichednow.com/v1/webhooks/run-secret",
method="POST",
headers={"Authorization": f"Bearer {os.environ['ENRICHEDNOW_API_KEY']}"},
)
with urllib.request.urlopen(request, timeout=90) as response:
print(json.dumps(json.load(response), indent=2))Nothing to install. Save as run.py and run python3 run.py
const response = await fetch("https://api.enrichednow.com/v1/webhooks/run-secret", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.ENRICHEDNOW_API_KEY}` },
});
console.log(JSON.stringify(await response.json(), null, 2));Nothing to install. Save as run.mjs and run node run.mjs
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
request, err := http.NewRequest("POST", "https://api.enrichednow.com/v1/webhooks/run-secret", nil)
if err != nil {
panic(err)
}
request.Header.Set("Authorization", "Bearer "+os.Getenv("ENRICHEDNOW_API_KEY"))
response, err := http.DefaultClient.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
answer, err := io.ReadAll(response.Body)
if err != nil {
panic(err)
}
fmt.Println(response.Status)
fmt.Println(string(answer))
}Nothing to install. Save as run.go and run go run run.go
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Run {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.enrichednow.com/v1/webhooks/run-secret"))
.header("Authorization", "Bearer " + System.getenv("ENRICHEDNOW_API_KEY"))
.POST(HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}Nothing to install. Save as Run.java and run java Run.java
The answer is {"secret": "whsec_…"}, shown once. Asking again replaces it. Until the account has one, a run with
a webhook_url is refused with 422 invalid_input on webhook_url; so is a URL that is not https or whose
host is not a public one. The same rules, the same event and the same retries apply as for an endpoint.
When a delivery fails#
A failed attempt is tried again: 10 attempts over 24 hours. After the first, the waits are 30 seconds, 2 minutes, 10 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 8 hours, and a last one a little over 8 hours later.
The delivery log says how the last attempt of each delivery went. status is pending while attempts are left,
succeeded after a 2xx, failed when the attempts are used up, and cancelled when its endpoint was switched
off or deleted first. error says what went wrong:
| Error | The attempt |
|---|---|
http_error | was answered with a status that is not 2xx; response_status has it. |
redirect_refused | was answered with a redirect. Redirects are not followed. |
timeout | got no complete answer within 10 seconds. |
connection_failed | could not connect, or the connection broke. |
tls_error | found a certificate that is not valid for the host. |
dns_failed | could not resolve the host's name. |
address_not_allowed | found that the host resolves to an address that is not a public one. Nothing was sent. |
url_not_allowed | found the URL is no longer one we send to. Nothing was sent. |
endpoint_disabled | was not made: the endpoint was switched off first. |
endpoint_deleted | was not made: the endpoint was deleted first. |
An endpoint that keeps failing is switched off. When a delivery has used up its attempts and nothing sent to
that endpoint has succeeded since the delivery was queued, the endpoint's enabled becomes false and
disabled_reason says why — for example Every delivery failed for a day. The last one ended with `timeout`.
Nothing more is queued for it, and what was waiting for it is cancelled. Fix your side, then switch it on again
with PATCH /v1/webhooks/{id} and {"enabled": true}, or on the console's Webhooks page.
Send one again. POST /v1/webhooks/deliveries/{id}/resend queues a new delivery of the same event — the same
id in the body, the same X-Webhook-Id — to where the endpoint is now, with a full set of attempts. A delivery
that is still pending cannot be resent, and neither can one whose endpoint is off or deleted.
curl "https://api.enrichednow.com/v1/webhooks/deliveries?status=failed&limit=20" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"import json
import os
import urllib.request
request = urllib.request.Request(
"https://api.enrichednow.com/v1/webhooks/deliveries?status=failed&limit=20",
headers={"Authorization": f"Bearer {os.environ['ENRICHEDNOW_API_KEY']}"},
)
with urllib.request.urlopen(request, timeout=90) as response:
print(json.dumps(json.load(response), indent=2))Nothing to install. Save as run.py and run python3 run.py
const response = await fetch("https://api.enrichednow.com/v1/webhooks/deliveries?status=failed&limit=20", {
headers: { Authorization: `Bearer ${process.env.ENRICHEDNOW_API_KEY}` },
});
console.log(JSON.stringify(await response.json(), null, 2));Nothing to install. Save as run.mjs and run node run.mjs
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
request, err := http.NewRequest("GET", "https://api.enrichednow.com/v1/webhooks/deliveries?status=failed&limit=20", nil)
if err != nil {
panic(err)
}
request.Header.Set("Authorization", "Bearer "+os.Getenv("ENRICHEDNOW_API_KEY"))
response, err := http.DefaultClient.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
answer, err := io.ReadAll(response.Body)
if err != nil {
panic(err)
}
fmt.Println(response.Status)
fmt.Println(string(answer))
}Nothing to install. Save as run.go and run go run run.go
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Run {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.enrichednow.com/v1/webhooks/deliveries?status=failed&limit=20"))
.header("Authorization", "Bearer " + System.getenv("ENRICHEDNOW_API_KEY"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}Nothing to install. Save as Run.java and run java Run.java
endpoint_id, run_id and status narrow the log; it pages with cursor like every list. A delivery stays in
the log for 30 days after it ended.
What to expect#
- At least once. An event can arrive more than once — after a retry whose first answer was lost, or a resend.
Keep the
X-Webhook-Idof what you handled and skip one you have seen. - In no promised order. Two runs that end close together can be delivered either way round; a retry arrives
after newer events.
created_atand the run's own times say what happened when. - Never instead of the API. The run is always there to be read with
GET /v1/runs/{id}. If your server was down for longer than a day, list your runs and catch up. - A run is never held up by a webhook. Sending happens after the run has ended and been charged; a receiver that is slow or down changes nothing about the run.