> For the complete documentation index, see [llms.txt](https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/webhooks/overview.md).

# Overview

Webhooks are how Black Sheep tells your systems that something happened. Every state change — pending approval, sent transaction, blocked transaction — can be POSTed to one or more endpoints you configure.

## Why use them

* **Approvals in Slack** — `approval.pending` → Slack channel → on-call clicks Approve.
* **Bookkeeping** — `tx.sent` → your accounting service / data warehouse.
* **Security** — `tx.blocked` → SIEM / Sentry / PagerDuty.
* **Customer notifications** — `tx.sent` → email your customer that their automation paid a vendor.

## Setup

1. **Dashboard → Webhooks → Add endpoint**.
2. Enter the URL, pick a **format** (`JSON` or `Slack`), select events.
3. Copy the **signing secret** — used to verify HMAC signatures.
4. Save. A test event is delivered immediately.

## Delivery guarantees

* **At-least-once.** A successful delivery is any 2xx response within 10 seconds.
* **Retries**: up to 6 attempts with exponential backoff (0s, 30s, 2m, 10m, 1h, 6h).
* **Ordering**: best-effort, not strict — design handlers to be idempotent on `event_id`.

## Format

JSON format:

```http
POST https://your-app.com/hooks/blacksheep
Content-Type: application/json
X-BlackSheep-Event: approval.pending
X-BlackSheep-Signature: sha256=<hex>
X-BlackSheep-Delivery: <uuid>

{
  "event": "approval.pending",
  "event_id": "evt_...",
  "timestamp": "2026-06-02T18:24:11Z",
  "data": { ... }
}
```

See [Event types](/black-sheep-finance-docs/webhooks/events.md), [Signature verification](/black-sheep-finance-docs/webhooks/signatures.md), [Slack format](/black-sheep-finance-docs/webhooks/slack.md), and [Delivery logs](/black-sheep-finance-docs/webhooks/delivery.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/webhooks/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
