> For the complete documentation index, see [llms.txt](https://docs.useshadowpay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.useshadowpay.com/agents-and-automation/webhooks-and-events.md).

# Webhooks & Events

ShadowPay pushes real-time events for every transaction involving your account or any agent underneath it. This is how you keep a parent application, dashboard, or monitoring system in sync without polling.

***

## Setting up a webhook

From **Dashboard → Developer → Webhooks**, or via the API:

1. Provide an HTTPS endpoint that can receive `POST` requests
2. Select which event types to subscribe to
3. ShadowPay signs every payload with an HMAC signature using a secret shown once at creation

Verify the `X-ShadowPay-Signature` header against your webhook secret on every request to confirm it originated from ShadowPay.

***

## Event types

| Event                                | Fired when                                                    |
| ------------------------------------ | ------------------------------------------------------------- |
| `transfer.initiated`                 | A transfer has been submitted and is awaiting confirmation    |
| `transfer.confirmed`                 | A transfer has settled on-chain                               |
| `transfer.failed`                    | A transfer did not settle                                     |
| `agent.transaction.pending_approval` | An agent transaction exceeded its human-in-the-loop threshold |
| `agent.transaction.approved`         | A human approved a pending agent transaction                  |
| `agent.transaction.rejected`         | A human rejected a pending agent transaction                  |
| `agent.policy.updated`               | A spend policy was changed for one of your agents             |

***

## Payload example

```json
{
  "event": "transfer.confirmed",
  "account": "@yourname/research-bot",
  "direction": "sent",
  "counterparty": "api.market",
  "asset": "USDC",
  "confidential": true,
  "solana_signature": "5KJvsngH7zNw...",
  "timestamp": "2026-07-02T14:23:09Z"
}
```

Note that the transfer amount is deliberately omitted from the webhook payload for confidential transfers. Amounts are encrypted on-chain, and ShadowPay's backend doesn't hold your decryption key, so it can't include what it can't read. If your integration needs the amount, decrypt it client-side using your own key, the same mechanism the app itself uses to render your feed.

***

## Retry behavior

Webhook deliveries that don't receive a `2xx` response are retried with exponential backoff for up to 24 hours. You can replay any missed event manually from the dashboard's webhook log.

***

## Next

* [Agent Accounts Overview](/agents-and-automation/agent-accounts-overview.md)
* [Webhooks API Reference](/api-reference/webhooks.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://docs.useshadowpay.com/agents-and-automation/webhooks-and-events.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.
