# Archie Tells You When the Work Is Done

> Stop polling. Register an HTTPS endpoint and Archie posts a signed event the moment a WorkStream cycle finishes or a key changes.

Long jobs finish on their own schedule. Instead of polling for a result, register an endpoint and Archie posts a signed event the moment a WorkStream cycle finishes or a key changes.

You register an HTTPS endpoint and the events you want. Endpoints belong to your organisation, so an event in any of your workspaces reaches them. Each endpoint hears every event type or only the ones you pick.

Set up

## Register an Endpoint

1

### Add the Endpoint

POST https://uk.heyarchie.com/v1/webhooks with the HTTPS address to deliver to and the event types you want. Nothing else is needed.

2

### Copy the Signing Secret

Archie generates the secret and returns it once, in the reply to that call. Store it straight away.

3

### Lost It? Start Again

There is no way to show or rotate a secret. Delete the endpoint and add it again to get a new one.

Public HTTPS only

Archie only delivers to public HTTPS addresses. It rejects plain HTTP and any address that resolves to a private, loopback or internal host. It checks the address again on every delivery, so an endpoint cannot be re-pointed at your internal network later.

The request

## What a Delivery Looks Like

Each delivery is a POST with a JSON body and a few headers. The body carries the event name and a compact data object. It holds only the fields a third party should see, never the full internal payload.

text

```
POST /your-endpoint HTTP/1.1
Content-Type: application/json
User-Agent: Archie-Connect-Webhooks/1.0
X-Webhook-Id: 4821
X-Webhook-Event: workstream.run.completed
X-Webhook-Timestamp: 1749031200
X-Webhook-Signature: v1=8f3c…2b1d

{
  "event": "workstream.run.completed",
  "data": {
    "run_id": "run_01J…",
    "status": "completed",
    "completed_at": "2026-06-04T09:20:00Z",
    "duration_ms": 18342
  }
}
```

Headers

## What Each Header Carries

Read the headers before the body. The signature tells you whether to trust it at all.

X-Webhook-Signature

v1=<hex>

The versioned HMAC. Verify it before you trust the body.

X-Webhook-Timestamp

Unix seconds

When Archie signed the request. Part of the signature, and your replay guard.

X-Webhook-Id

Delivery id

Use it to deduplicate. Delivery is at least once.

X-Webhook-Event

Event type

Lets you route the delivery without parsing the body first.

Trust nothing unsigned

## Verify Every Delivery

Anyone can POST to a public address, so verify the signature first. Archie signs the string {timestamp}.{raw body} with your endpoint secret using HMAC-SHA256 and sends v1=<hex>. Recompute it over the exact bytes you received and compare in constant time. Reject anything signed more than five minutes ago, so a captured request cannot be replayed.

```
import hashlib
import hmac
import time

def verify(secret: str, body: bytes, signature: str, timestamp: str) -> bool:
    # Reject deliveries older than five minutes (replay protection).
    if abs(time.time() - int(timestamp)) > 300:
        return False
    message = f"{timestamp}.{body.decode()}".encode()
    expected = "v1=" + hmac.new(secret.encode(), message, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature)
```

```
import crypto from "node:crypto";

function verify(secret: string, body: string, signature: string, timestamp: string): boolean {
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
  const expected =
    "v1=" +
    crypto.createHmac("sha256", secret).update(`${timestamp}.${body}`).digest("hex");
  const a = Buffer.from(expected);
  const b = Buffer.from(signature);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}
```

Sign over the raw body

Verify against the exact bytes Archie sent, before any JSON parsing or re-serialisation. Re-encoding the body can reorder keys or change spacing, and then the signature no longer matches.

When a delivery fails

## Retries and Idempotency

Any 2xx reply means the delivery is done. Delivery is at least once, so treat X-Webhook-Id as the idempotency key and ignore an id you have already processed. Acknowledge fast and do the real work in the background: a slow endpoint reads as a failure and earns a retry.

Anything Else Is Retried

A non-2xx reply or a timeout counts as failed.

Exponential Backoff

Retries after 1, 2, 4 and 8 seconds.

Dead After Five Failures

Set aside after five failed attempts.

Visible in the Endpoint

GET https://uk.heyarchie.com/v1/webhooks/{id}/deliveries lists the last 50 deliveries with each response code.

What you can subscribe to

## Event Types

The live set is also served at GET https://uk.heyarchie.com/v1/webhooks/event-types, which is what the endpoint picker reads, so it never drifts from what Archie sends.

workstream.run.completed

WorkStream

A cycle finishes successfully. Sends run_id, status, completed_at, duration_ms.

workstream.run.failed

WorkStream

A cycle ends in failure. Sends run_id, status, error, completed_at.

api_key.created

API key

A Connect key is created in your organisation. Sends id, name, created_at.

api_key.deleted

API key

A Connect key is deleted. Sends id, name.

Old names and reserved types

playbook.run.completed and playbook.run.failed still work as aliases of the two WorkStream events, for endpoints that subscribed under the old names. api_key.rotated and message.completed are reserved and listed in the picker, but Archie does not send them yet. Subscribe to * to receive every event type, including ones added later.

Next

### Error Handling

The error envelope and retries for the rest of the API.

### Managing Keys

Create, scope and rotate the keys you call with.

### WorkStreams

The cycles whose results these events report.

### Rate Limits

The per-minute budget behind every key.

On this page

[Register an Endpoint](https://heyarchie.com/en-gb/developers/webhooks/#s-set-up)[What a Delivery Looks Like](https://heyarchie.com/en-gb/developers/webhooks/#s-the-request)[What Each Header Carries](https://heyarchie.com/en-gb/developers/webhooks/#s-headers)[Verify Every Delivery](https://heyarchie.com/en-gb/developers/webhooks/#s-trust-nothing-unsigned)[Retries and Idempotency](https://heyarchie.com/en-gb/developers/webhooks/#s-when-a-delivery-fails)[Event Types](https://heyarchie.com/en-gb/developers/webhooks/#s-what-you-can-subscribe-to)
