# EventForge Quickstart

From an API key to a delivery your endpoint verifies and replays, with curl. Every call is described in the [API reference](https://event-forge.app/docs/api.md).

## Before you start

The API lives at `https://event-forge.app/api/v1` and speaks JSON. No account yet? [Sign up](https://event-forge.app/register) and confirm your email address. Create an API key on [Settings](https://event-forge.app/settings) with **Full access** or **Read with optional permissions** with the project, rule and replay permissions needed for this guide, and send it as a bearer token. Read grants all GET operations; optional capabilities grant specific writes. Project creation returns its webhook secret.

Creating, renaming or revoking a key requires a signed-in session; creating one also requires your current password. An API key cannot manage keys. For programmatic setup, the API reference documents login, its session and CSRF cookies, and `POST /api/v1/api-keys`. Use test data and a receiving endpoint you control.

```sh
export EVENTFORGE_API_KEY="efk_..."   # the key from /settings
curl https://event-forge.app/api/v1/projects \
  -H "Authorization: Bearer $EVENTFORGE_API_KEY"
```

An error answers `{"error": "...", "message": "..."}`: branch on `error` and the status. For `429 rate_limited`, wait for the seconds in `Retry-After`. API key request and failed-key IP limits are process-local, so slots have separate budgets and a restart resets them. An exhausted IP can temporarily delay valid keys behind the same NAT. For `429 quota_exceeded`, there is no Retry-After: the webhook was not stored; contact the inbox owner or try after the next UTC month begins. Changing plans does not reset usage.

## Create a project

`POST /api/v1/projects`

```sh
curl https://event-forge.app/api/v1/projects \
  -H "Authorization: Bearer $EVENTFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Shop"}'
```

The answer:

```json
{
  "id": "7f8e9d0c-1b2a-4c3d-8e9f-0a1b2c3d4e5f",
  "name": "Shop",
  "publicId": "proj_3f9a1c2b7d4e5f60",
  "webhookSecret": "whsec_...",
  "createdAt": "2026-10-09T12:00:00Z",
  "updatedAt": "2026-10-09T12:00:00Z"
}
```

Webhooks for the project go to `https://event-forge.app/inbox/` and its `publicId`. `webhookSecret` signs the deliveries: an API key sees it only in this answer, so keep it for your endpoint. A signed-in owner can reveal it later on the project page. Never send the API key or webhook secret to the inbox.

```sh
export PROJECT_ID="7f8e9d0c-1b2a-4c3d-8e9f-0a1b2c3d4e5f"
export PUBLIC_ID="proj_3f9a1c2b7d4e5f60"
export EVENTFORGE_WEBHOOK_SECRET="whsec_..."   # your endpoint needs it
```

## Create a rule

`POST /api/v1/projects/{projectId}/rules`

Replace `https://example.com/webhooks` with the public URL of your receiving endpoint.

```sh
curl https://event-forge.app/api/v1/projects/$PROJECT_ID/rules \
  -H "Authorization: Bearer $EVENTFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Everything to my app", "targetUrl": "https://example.com/webhooks"}'
```

A rule forwards the webhooks it matches to `targetUrl`. Without `conditionType` it matches every webhook (`all`); `header_equals` compares a header, its name in any letter case, and `path_prefix` the path after the inbox URL: a provider that sends to `https://event-forge.app/inbox/$PUBLIC_ID/github` matches a rule with `conditionValue` `/github`. Every enabled rule that matches forwards the webhook; `priority` only orders the list. The target must be a public http or https address: private and loopback addresses are refused. For local development, expose your receiver through a public HTTPS tunnel. A request inspector alone does not verify the signature.

## Send a webhook

`POST /inbox/{publicId}`

```sh
curl https://event-forge.app/inbox/$PUBLIC_ID \
  -H "Content-Type: application/json" \
  -d '{"type": "order.paid", "orderId": 1042}'
```

```json
{"eventId": "0b6c2d8e-5f1a-4c3b-9d7e-2a1f0c9b8e7d", "message": "Webhook received"}
```

The inbox needs no key: give its URL to the provider that sends your webhooks, as it is or with a path of your own after it, such as `/github`, to route on. It takes JSON, form, XML or other text in UTF-8, up to 5 MB; a binary body gets `400`. Each accepted webhook counts toward your monthly event quota.

## What your endpoint receives

The method and the body as the inbox got them, and the headers the sender sent, each with its first value. Every delivery, retry and Replay omits both proxy header prefixes and this fixed infrastructure/client-address list, case-insensitively: `X-Forwarded-*`, `X-Original-Forwarded-*`, `Forwarded`, `X-Real-Ip`, `True-Client-Ip`, `Via`, `CF-Connecting-IP`, `CF-Connecting-IPv6`, `CF-Pseudo-IPv4`, `Fastly-Client-IP`, `Fly-Client-IP`, `X-Client-IP`, `X-Cluster-Client-IP`, `X-Envoy-External-Address`. Unknown suffixes of either prefix are omitted too. This bounded policy does not remove every identifying or custom header. Application and tracing headers such as `traceparent`, `tracestate` and `CF-Ray` are preserved subject to credential and hop-by-hop rules. A delivery also leaves out connection headers (including `Host` and Connection-nominated headers), `Accept-Encoding`, `X-Webhook-Signature` and `X-Webhook-Timestamp`, and the sender's credentials: `Authorization`, `Cookie`, `Proxy-Authorization`, `X-Api-Key`, `Api-Key`, `X-Auth-Token`, `X-Access-Token` and `X-Gitlab-Token`. An EventForge API key in another header keeps only its first characters (`efk_12345678[redacted]`), a webhook secret becomes `whsec_[redacted]`, and a request without `Content-Type` goes out with `application/json`. A delivery adds these:

```http
POST /webhooks HTTP/1.1
Host: example.com
Content-Type: application/json
webhook-id: msg_6f9e3c2a-1b4d-4e5f-8a7b-0c1d2e3f4a5b
webhook-timestamp: 1791547200
webhook-signature: v1,...
X-EventForge-Event-ID: 0b6c2d8e-5f1a-4c3b-9d7e-2a1f0c9b8e7d
X-EventForge-Delivery-ID: 3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a
X-EventForge-Attempt: 1
X-EventForge-Hops: 1

{"type": "order.paid", "orderId": 1042}
```

Answer with a `2xx` status. A delivery that gets a network error, a timeout or a 408, 425, 429 or 5xx answer is retried, as [Retries in the API reference](https://event-forge.app/docs/api.md#retries) describes; other answers are not. A retry carries the same `webhook-id`, so skip a message you have already handled. If the sender signed its request with Standard Webhooks headers of its own, they arrive as `X-Original-Webhook-Id`, `X-Original-Webhook-Timestamp` and `X-Original-Webhook-Signature`. EventForge's signature proves that a delivery came through your inbox, not who sent the webhook there, and a sender's token in the credential headers above does not arrive, so check a sender that signs the body, such as GitHub (`X-Hub-Signature-256`), Stripe or Shopify, by its own signature, as [Signed deliveries in the API reference](https://event-forge.app/docs/api.md#signed-deliveries) describes.

## Verify the signature

Every delivery is signed as [Standard Webhooks](https://www.standardwebhooks.com) describes, with the project's `webhookSecret`. Verify against the raw body, before any JSON parsing: a body parsed and serialized again does not match. The libraries also refuse a `webhook-timestamp` more than 5 minutes from your clock, and after a rotation they accept either of the two signatures.

### Node.js

```javascript
// npm install express standardwebhooks
const express = require("express");
const { Webhook } = require("standardwebhooks");

const wh = new Webhook(process.env.EVENTFORGE_WEBHOOK_SECRET); // whsec_...
const app = express();

// express.raw keeps the body as bytes, as sent: the signature covers them.
// The inbox takes up to 5 MB, so the endpoint does too.
app.post("/webhooks", express.raw({ type: "*/*", limit: "5mb" }), (req, res) => {
  try {
    // jsonParse: false checks the signature only; the body may be any text.
    wh.verify(req.body, req.headers, { jsonParse: false });
  } catch (err) {
    return res.status(400).send("invalid signature");
  }
  // webhook-id names the message: skip one you have already handled.
  console.log("verified", req.headers["webhook-id"], req.headers["content-type"], req.body.length, "bytes");
  res.sendStatus(204);
});

app.listen(3000);

```

### Python

```python
# pip install flask standardwebhooks
# Save as verify.py, then: flask --app verify run --port 3000
import os

from flask import Flask, request
from standardwebhooks.webhooks import Webhook, WebhookVerificationError

wh = Webhook(os.environ["EVENTFORGE_WEBHOOK_SECRET"])  # whsec_...
app = Flask(__name__)


@app.post("/webhooks")
def webhooks():
    # get_data() is the body as sent: the signature covers these bytes.
    payload = request.get_data()
    try:
        # json_parse=False checks the signature only; the body may be any text.
        wh.verify(payload, dict(request.headers), json_parse=False)
    except (WebhookVerificationError, ValueError):
        # ValueError: a malformed webhook-signature header.
        return "invalid signature", 400
    # webhook-id names the message: skip one you have already handled.
    print("verified", request.headers["webhook-id"], request.content_type, len(payload), "bytes")
    return "", 204

```

### Go

```go
// go get github.com/standard-webhooks/standard-webhooks/libraries
package main

import (
	"errors"
	"io"
	"log"
	"net/http"
	"os"

	standardwebhooks "github.com/standard-webhooks/standard-webhooks/libraries/go"
)

func main() {
	wh, err := standardwebhooks.NewWebhook(os.Getenv("EVENTFORGE_WEBHOOK_SECRET")) // whsec_...
	if err != nil {
		log.Fatal(err)
	}
	http.HandleFunc("POST /webhooks", func(w http.ResponseWriter, r *http.Request) {
		// Read the body as sent: the signature covers these bytes. A body over
		// 5 MB, the inbox limit, is refused, not cut and half verified.
		payload, err := io.ReadAll(http.MaxBytesReader(w, r.Body, 5<<20))
		if err != nil {
			status := http.StatusBadRequest
			var tooLarge *http.MaxBytesError
			if errors.As(err, &tooLarge) {
				status = http.StatusRequestEntityTooLarge
			}
			http.Error(w, "cannot read the body", status)
			return
		}
		if err := wh.Verify(payload, r.Header); err != nil {
			http.Error(w, "invalid signature", http.StatusBadRequest)
			return
		}
		// webhook-id names the message: skip one you have already handled.
		log.Printf("verified %s: %s, %d bytes", r.Header.Get("webhook-id"), r.Header.Get("Content-Type"), len(payload))
		w.WriteHeader(http.StatusNoContent)
	})
	log.Fatal(http.ListenAndServe(":3000", nil))
}

```

### PHP

```php
<?php
// composer require standard-webhooks/standard-webhooks
// Save as verify.php, then: php -S localhost:3000 verify.php
require __DIR__ . '/vendor/autoload.php';

$wh = new \StandardWebhooks\Webhook(getenv('EVENTFORGE_WEBHOOK_SECRET')); // whsec_...

// The body as sent: the signature covers these bytes.
$payload = file_get_contents('php://input');
// The library looks headers up in lower case; some servers capitalize them.
$headers = array_change_key_case(getallheaders(), CASE_LOWER);

try {
    $wh->verify($payload, $headers);
} catch (\Exception $e) {
    http_response_code(400);
    exit('invalid signature');
}
// webhook-id names the message: skip one you have already handled.
error_log('verified ' . $headers['webhook-id'] . ', ' . strlen($payload) . ' bytes');
http_response_code(204);

```

In another language, check it yourself, as [Signed deliveries in the API reference](https://event-forge.app/docs/api.md#signed-deliveries) describes:

```text
key       = base64_decode(secret without "whsec_")
expected  = base64(HMAC-SHA256(key, webhook-id + "." + webhook-timestamp + "." + body))
valid     = some "v1,<signature>" in webhook-signature equals expected (compare in constant time)
            and webhook-timestamp is within 5 minutes of your clock
```

## Inspect and replay

`GET /api/v1/projects/{projectId}/events`

`GET /api/v1/events/{eventId}`

```sh
export EVENT_ID="0b6c2d8e-5f1a-4c3b-9d7e-2a1f0c9b8e7d"
curl https://event-forge.app/api/v1/projects/$PROJECT_ID/events \
  -H "Authorization: Bearer $EVENTFORGE_API_KEY"
curl https://event-forge.app/api/v1/events/$EVENT_ID \
  -H "Authorization: Bearer $EVENTFORGE_API_KEY"
```

An event lists its deliveries with `status`, `responseStatus`, `lastError` and `messageId`, the `webhook-id` your endpoint got. Delivery is asynchronous: wait for its result before judging it. Replay sends the event to the rules again:

`POST /api/v1/events/{eventId}/replay`

```sh
# Set REPLAY_KEY to a UUID once per deliberate action; retain it for retries.
curl -X POST https://event-forge.app/api/v1/events/$EVENT_ID/replay \
  -H "Idempotency-Key: $REPLAY_KEY" \
  -H "Authorization: Bearer $EVENTFORGE_API_KEY"
```

```json
{"message": "Replay initiated", "deliveriesCreated": 1}
```

A replay is a new message: it arrives with a new `webhook-id`. Check the new delivery and verify its signature too. Use a UUID Idempotency-Key per deliberate action, retaining it for retries for 24 hours. After expiry it may create another replay. Without a key, each call is a new operation; do not automatically retry an uncertain result. A replay that creates deliveries costs one monthly event unit; zero matches cost none. All replay requests share a per-user burst of five and refill of one every two seconds by default; after 429 or replay_in_progress, wait for Retry-After and retain the key.

`responseBody` captures the first 10 KiB of the endpoint's answer, as UTF-8 text. Before storage, EventForge masks recognizable `efk_` keys, `whsec_` secrets, `Bearer` tokens and string-valued `Authorization` fields (including arrays of header values), including a prefixed secret cut at the end. The same policy covers `lastError` and older diagnostics when read, also with API keys. It can mask ordinary phrases such as `Bearer token`; it does not recognize every secret or arbitrary encodings. Your original webhook payload and target URL stay as sent.

For failed receivers, inspect `retryEligible` on the event’s deliveries and use `POST /api/v1/deliveries/{deliveryId}/retry` with a stable Idempotency-Key. It creates one fresh message for that receiver using its enabled rule’s current URL; other receivers are not resent. The retry namespace is independent of event replay. Repeats return the original new IDs for 24 hours while event ownership and retention hold. Historical, successful or pending attempts and unavailable rules are refused.

For an outage, `POST /api/v1/projects/{projectId}/bulk-retries` with RFC3339 receivedFrom/receivedTo previews an immutable snapshot of at most 1,000 eligible receivers, within a window of at most 31 days and current retention. It creates no deliveries and charges no quota; narrow an oversized or too-costly window. Preview expires after 15 minutes. Start that exact operation with `POST /api/v1/bulk-retries/{operationId}/start`; inspect durable scheduling counts with GET, and cancel future groups with POST to /cancel. Counts describe created deliveries, skips and remaining items, not successful sends. Disabled/deleted rules can leave failures in the Failed view while being excluded from preview. Each productive event group costs one quota unit and competes for the shared replay rate allowance. Quota-stopped jobs need a new preview after changing billing. Failed groups or runner crashes defer that job for thirty seconds so other accounts can progress; busy job rows are skipped before rate admission. Cancel does not recall committed deliveries. The snapshot owner can still read/cancel metadata after project deletion; a missing project cancels the whole remainder without per-event admission, and another owned project can start without waiting for that orphan. One job may run per account; three planned previews and twenty retained operations bound metadata. Jobs expire logically after 24 hours. Terminal metadata is retained for at least seven days after completion, cancellation, quota stop or logical expiry, then becomes eligible for cleanup. It may remain readable longer during a GC backlog. A new preview reclaims its owner’s eligible old records before checking capacity, independently of other owners’ backlog. Use the Failed filter in Events for the same controls.

## Rotate the secret

`POST /api/v1/projects/{projectId}/webhook-secret/rotate`

Rotate the secret on the project page, or with this operation from a signed-in session: API keys cannot read or rotate the secret. For 24 hours deliveries carry a signature with the new secret and one with the previous, so update your endpoint within that time. Rotating again stops the older secret at once.

Next: every operation in the [API reference](https://event-forge.app/docs/api.md), or the specification itself for your API client or code generator, [openapi.yaml](https://event-forge.app/openapi.yaml).

Provider guides: [GitHub](https://event-forge.app/docs/providers/github.md), [Stripe](https://event-forge.app/docs/providers/stripe.md), [Shopify](https://event-forge.app/docs/providers/shopify.md).
