Skip to content

Webhooks

Webhooks send activity events to an HTTPS endpoint you run. These include pushes, check-outs, reviews, comments and downloads. Prophouse picks up new events within a few seconds and posts each one to every matching endpoint. An endpoint receives every event type or a subset you choose, as signed JSON or as a Slack message.

Every webhook route is Admin only. Members get 403. Read routes need a key with the read scope, and all other routes need a write-scoped key. You can manage the same endpoints in the web library under Admin > Webhooks (see Admin).

Method and path Scope Purpose
GET /admin/webhooks read List endpoints
POST /admin/webhooks write Register an endpoint
PATCH /admin/webhooks/{webhook_id} write Change the URL, events or format, pause, or rotate the secret
DELETE /admin/webhooks/{webhook_id} write Remove an endpoint and its delivery history. Returns 204.
POST /admin/webhooks/{webhook_id}/test write Send a test event now
GET /admin/webhooks/{webhook_id}/deliveries read List recent delivery attempts
Terminal window
curl -X POST -H "Authorization: Bearer $PH_KEY" -H "Content-Type: application/json" \
-d '{"url": "https://hooks.example.com/prophouse", "events": ["push.commit", "review.change"]}' \
https://api.prophouse.dev/api/v1/admin/webhooks
Field Type Description
url string, required An https:// URL, up to 2,000 characters. The host must resolve to public addresses only. URLs with a user name or password in them are rejected. Prophouse returns 422 for any URL it rejects, with a message such as Webhook host resolves to a non-public address.
secret string 8 to 200 characters. If you omit it, Prophouse generates one that starts with whsec_.
events array Event types to deliver. Omit it or send null for all types. An empty array or an unknown type returns 422.
format string json (default) or slack.
active boolean Default true.

The response is 201 with the endpoint plus a secret field. Store the secret now. Prophouse never returns it again. A new endpoint gets events that happen after you register it. Earlier events are not sent.

{
"id": 2,
"url": "https://hooks.example.com/prophouse",
"events": ["push.commit", "review.change"],
"format": "json",
"active": true,
"cursor": 1840,
"created_by": { "id": 7, "name": "<user>", "display_name": "Sam Rigger" },
"created_at": "2026-07-25T12:00:00Z",
"deliveries": { "pending": 0, "delivered": 311, "failed": 2 },
"last_delivery": {
"id": 913,
"event_id": 1841,
"event_type": "review.change",
"attempt": 1,
"status": "delivered",
"next_attempt_at": null,
"delivered_at": "2026-07-25T12:00:01Z",
"last_error": null,
"created_at": "2026-07-25T12:00:00Z"
}
}

events is null when the endpoint receives every type. cursor is the id of the last activity event Prophouse checked for this endpoint. last_delivery is null until the first delivery.

GET /admin/webhooks returns {"webhooks": [endpoint, ...]}, oldest first. List and update responses never include the secret.

Send one or more of url, secret, events, format and active. Send "events": null to receive all types again. url, secret, format and active cannot be null. An empty body returns 422.

When you send a new secret, the response includes it once in a secret field. Deliveries sign with the new secret from then on.

Send "active": false to pause the endpoint. Prophouse queues and sends nothing while it is paused, including retries already scheduled. When you set "active": true again, Prophouse delivers the events that happened during the pause and resumes the retries.

Prophouse sends each event as a POST with these headers:

Header Value
Content-Type application/json
User-Agent prophouse-webhooks/1
X-PH-Event The event type, for example push.commit.
X-PH-Delivery <delivery id>.<attempt>, unique per HTTP attempt. Use the part before the dot to de-duplicate retries.
X-PH-Signature t=<unix seconds>,v1=<hex HMAC-SHA256>

With format: "json", the body is the activity event:

{
"id": 1841,
"type": "review.change",
"actor": { "id": 12, "name": "<user>", "display_name": "Lee Lead" },
"entry_id": 412,
"lineage_id": "guid:6F9619FF8B86D011B42D00C04FC964FF",
"object_id": 1880,
"batch_key": null,
"payload": { "state": "approved", "previous_state": "in_review", "assignee_id": null },
"created_at": "2026-07-25T12:00:00Z"
}

payload depends on the event type. See event types.

With format: "slack", the body is {"text": "Prophouse: ..."}. The text starts with the event type and the actor’s name. It then adds the name from the event payload, the review state for review.* events, and the entry number, when the event has each one, separated by commas. For example: Prophouse: review.change by Lee Lead, approved, entry #1204. Register a Slack incoming webhook URL as the endpoint, and Slack posts the text to that channel.

v1 is the HMAC-SHA256 of <t>. followed by the raw request body, keyed with your secret, as lowercase hex. Compute it over the exact bytes you received, before you parse the JSON. Compare in constant time. Reject requests whose t is too far from your clock.

import hashlib, hmac, time
def verify(secret: str, header: str, body: bytes, tolerance: int = 300) -> bool:
parts = dict(item.split("=", 1) for item in header.split(",") if "=" in item)
t, sig = parts.get("t"), parts.get("v1")
if not t or not sig:
return False
if abs(time.time() - int(t)) > tolerance:
return False
expected = hmac.new(secret.encode(), f"{t}.".encode() + body, hashlib.sha256).hexdigest()
return hmac.compare_digest(expected, sig)

Any 2xx response counts as delivered. Prophouse retries on any other status, on a network error, and when your endpoint does not respond within 10 seconds. Each delivery gets 5 attempts. After a failed attempt, Prophouse waits 1 minute, then 5 minutes, then 30 minutes, then 2 hours before the next one. If the fifth attempt fails, the delivery’s status becomes failed and last_error holds the reason. Prophouse does not resend a failed delivery, and there is no route to replay one.

If Prophouse cannot read the endpoint’s stored secret, deliveries fail on the first try with no retries. Send a new secret with PATCH to fix this.

Prophouse follows up to 3 redirects (301, 302, 303, 307, 308) and posts the same body to each. Every redirect target must pass the same URL rules as registration.

Return 2xx quickly and do slow work after you respond. The same event can arrive more than once, and events can arrive out of order. De-duplicate on the event id and order by created_at.

POST /admin/webhooks/{webhook_id}/test sends a webhook.test event right away and returns the result. It ignores the endpoint’s event filter and works on a paused endpoint. Prophouse does not queue or retry it, and it does not appear in the delivery list.

{"delivered": true, "status_code": 204}
{"delivered": false, "error": "HTTP 500"}

With format: "json", the test body has "id": null, "actor": null and "payload": {"message": "Prophouse webhook test delivery."}. With format: "slack", the text is Prophouse: webhook.test by someone. Prophouse signs the test like any other delivery. Its X-PH-Delivery header is test.<random hex>. If Prophouse cannot read the stored secret, the test returns 409 with code CONFLICT and the message This webhook's signing secret can no longer be read. Rotate the secret, then try again. Send a new secret with PATCH, then test again.

GET /admin/webhooks/{webhook_id}/deliveries returns recent attempts, newest first. limit is 1 to 200 (default 50).

{
"deliveries": [
{
"id": 913,
"event_id": 1841,
"event_type": "review.change",
"attempt": 1,
"status": "delivered",
"next_attempt_at": null,
"delivered_at": "2026-07-25T12:00:01Z",
"last_error": null,
"created_at": "2026-07-25T12:00:00Z"
}
]
}

status is pending, delivered or failed. attempt counts the attempts made so far. next_attempt_at is set only while the delivery is pending. Prophouse deletes delivered and failed rows 30 days after they were created.

An unknown webhook_id returns 404 with code WEBHOOK_NOT_FOUND.