> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.idenfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transaction Monitoring API Webhooks

> Transaction Monitoring API webhook events, payloads, Idenfy-TX-Signature verification and retry behaviour.

Add endpoints under **Developer → Webhooks** in the Transaction Monitoring dashboard (visible to users with the Integrations permission), or with `POST /api/v1/webhooks/`. Each endpoint subscribes to the events it wants. The URL must be HTTPS.

> [!WARNING]
>
> Transaction Monitoring webhooks are signed differently from KYC callbacks. They use `Idenfy-TX-Signature` and `Idenfy-TX-Timestamp`, with a secret per endpoint. The KYC [callback signing](https://documentation.idenfy.com/security/callback-signing.md) page does not apply.

## Events

| Event | Sent when | Act on it by |
| - | - | - |
| `transaction.processed` | Rules finished checking a transaction you sent. The same outcome the ingest response gave | Reconciling, if you process ingest responses asynchronously |
| `transaction.status_changed` | An analyst decided on a held or flagged transaction: `ALLOWED` or `REJECTED` | **Releasing or refusing the held payment** |
| `alert.created` | A rule matched and opened an alert. One event per rule that matched | Showing the alert in your own tools |
| `alert.updated` | An analyst acted on an alert case: assigned, escalated, closed, reopened | Keeping your case tool in step |
| `sar.ready_for_filing` | A SAR was approved and handed over for you to file with your FIU | Filing it, then reporting the result back |
| `sar.filing_outcome` | The regulator's answer to a filed SAR was recorded | Closing the loop in your records |
| `kyc.token_generated` | A workflow asked for a customer to be re-verified and created an iDenfy verification link | Sending the link to your customer |

## What a delivery looks like

Each delivery is an HTTPS `POST` with a JSON body, no envelope. The `event` field and the `Idenfy-TX-Event-Type` header name the event.

```http theme={"system"}
POST /your/webhook HTTP/1.1
Content-Type: application/json; charset=utf-8
Idenfy-TX-Event-Type: transaction.status_changed
Idenfy-TX-Delivery-Id: 0f9c2b4e-6d1a-4c8e-9b3f-2a7d5e1c8f40
Idenfy-TX-Timestamp: 1795440000
Idenfy-TX-Signature: v1=5d41402abc4b2a76b9719d911017c592...
```

```json theme={"system"}
{
  "event": "transaction.status_changed",
  "partnerId": "1234",
  "previousStatus": "BLOCKED",
  "alertId": "a3c1e0d2-7b5f-4e8a-9c6d-1f2e3a4b5c6d",
  "transaction": {
    "id": "5b0f6c2e-8d0a-4f7e-9a51-1f3c2d7e9b10",
    "externalId": "wd-88213",
    "type": "BANK_PAYMENT",
    "status": "ALLOWED",
    "riskScore": 72,
    "amount": "4800.00",
    "currency": "EUR",
    "reference": "Invoice 2026-118",
    "direction": "OUTBOUND",
    "subject": { "id": "cust-42" },
    "counterparty": { "id": "acct-77" },
    "isTest": false,
    "createdAt": "2026-11-23T14:05:01Z"
  }
}
```

Every transaction and alert event carries the same `transaction` block. It identifies parties by your ids only: no names or account numbers are sent. SAR events carry the report's id, reference number, jurisdiction, status and external reference, never the report itself; fetch it over the API if you need it. Endpoint management is in the [webhooks API reference](https://documentation.idenfy.com/api-reference/transaction-monitoring/webhooks/create-a-webhook.md).

## Verifying the signature

`Idenfy-TX-Signature` is `v1=` followed by the hex HMAC-SHA256 of `{timestamp}.{raw body}`, using the endpoint's secret. To verify a delivery:

1. Read the raw request body **before** parsing it as JSON.
2. Compute HMAC-SHA256 over `Idenfy-TX-Timestamp` + `.` + the raw body.
3. Compare it with the value after `v1=`, in constant time.
4. Reject the delivery if the timestamp is more than 5 minutes from your clock, so a captured delivery cannot be replayed.

```python Python theme={"system"}
import hashlib, hmac, time

def verify(secret: str, raw_body: bytes, timestamp: str, signature: str) -> bool:
    if abs(time.time() - int(timestamp)) > 300:
        return False
    expected = hmac.new(secret.encode(), f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(f"v1={expected}", signature)
```

```javascript Node.js theme={"system"}
import crypto from "node:crypto";
import express from "express";

const app = express();

app.post("/tm-webhook", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.get("Idenfy-TX-Timestamp");
  const signature = req.get("Idenfy-TX-Signature") ?? "";
  const expected =
    "v1=" +
    crypto
      .createHmac("sha256", process.env.TM_WEBHOOK_SECRET)
      .update(`${timestamp}.`)
      .update(req.body)
      .digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) <= 300;
  const valid =
    signature.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
  if (!fresh || !valid) return res.sendStatus(401);

  const event = JSON.parse(req.body);
  // queue the event for processing, then answer quickly
  res.sendStatus(204);
});
```

```php PHP theme={"system"}
$raw = file_get_contents('php://input');
$timestamp = $_SERVER['HTTP_IDENFY_TX_TIMESTAMP'] ?? '';
$signature = $_SERVER['HTTP_IDENFY_TX_SIGNATURE'] ?? '';
$expected = 'v1=' . hash_hmac('sha256', $timestamp . '.' . $raw, getenv('TM_WEBHOOK_SECRET'));

if (abs(time() - (int) $timestamp) > 300 || !hash_equals($expected, $signature)) {
    http_response_code(401);
    exit;
}
$event = json_decode($raw, true);
http_response_code(204);
```

### The secret

Send your own `secret` when you create the endpoint, or leave it out and one is generated. A generated secret is returned **once**, in the create response, so store it then. `POST /api/v1/webhooks/{id}/regenerate-secret/` replaces it; the old one stops working at once, so update your receiver first.

You can also add fixed `headers` to every delivery, for an endpoint behind its own authentication.

## Delivery and retries

```mermaid theme={"system"}
%%{init: {'theme': 'base', 'themeVariables': {'fontFamily': 'Inter, sans-serif', 'fontSize': '11px', 'actorBkg': '#734BFB', 'actorTextColor': '#ffffff', 'actorBorder': '#5A2FE0', 'signalColor': '#9B7BFC', 'signalTextColor': '#9B7BFC', 'noteBkgColor': '#F1ECFF', 'noteTextColor': '#2B1A6B', 'noteBorderColor': '#9B7BFC'}}}%%
sequenceDiagram
    participant TM as iDenfy TM
    participant EP as Your endpoint
    TM->>EP: POST event (Idenfy-TX-Signature, Timestamp, Delivery-Id)
    EP->>EP: Verify signature and timestamp, store event
    EP-->>TM: 2xx within 10 s
    Note over TM,EP: Non-2xx, redirect or timeout counts as a failure
    TM->>EP: Retry after 1, 2, 4, 8, 16 min, then every 20 min
    Note over TM: 10 failures in a row: endpoint suspended, events kept
    EP->>TM: Enable endpoint (dashboard or /enable/)
    TM->>EP: Kept events delivered
```

| | |
| - | - |
| **Success** | Any `2xx` within **10 seconds**. Redirects are not followed and count as failures |
| **Retries** | A failed delivery is retried with backoff: after 1, 2, 4, 8 and 16 minutes, then every 20 minutes |
| **Suspension** | After **10 failed attempts in a row**, the endpoint is suspended. New events are kept, not dropped |
| **Resuming** | Fix your receiver, then enable the endpoint (dashboard, or `POST /api/v1/webhooks/{id}/enable/`). Kept events are sent then |
| **History** | Every attempt, with your response code and the start of your response body, is kept for 30 days under the endpoint's deliveries. A failed one can be resent by hand |

What this means for your receiver:

* **Answer fast.** Return `2xx` as soon as the delivery is verified and stored; do the work afterwards.
* **Expect duplicates.** A retry carries the same `Idenfy-TX-Delivery-Id`. Skip one you have already processed.
* **Do not rely on order.** Retries can arrive after later events. Use the `transaction.status` in the payload, not the order of arrival.
* **Reconcile.** Webhooks are best effort. For anything with a deadline, check the API as well. For SARs, list `GET /api/v1/sars/?status=SUBMITTED` regularly so a missed `sar.ready_for_filing` never means an unfiled report.

## Test events

Events about test data are delivered too, with `"isTest": true`. **Send test** on the endpoint (or `POST /api/v1/webhooks/{id}/test/`) sends a signed sample at once and shows you what your endpoint answered.


## Related topics

- [Transaction Monitoring API](https://documentation.idenfy.com/transaction-monitoring/overview.md)
- [Transaction Monitoring API Quickstart](https://documentation.idenfy.com/transaction-monitoring/quickstart.md)
- [Transaction Monitoring API Limits and Expectations](https://documentation.idenfy.com/transaction-monitoring/limits-and-expectations.md)
- [Transaction Monitoring API: Sending Transactions](https://documentation.idenfy.com/transaction-monitoring/ingest.md)
- [Transaction Monitoring API Test Mode](https://documentation.idenfy.com/transaction-monitoring/test-mode.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.