> For the complete documentation index, see [llms.txt](https://docs.nodefy.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nodefy.xyz/our-api-guide/channels/custom-webhook.md).

# Custom Webhook

Send notifications as POST requests to a custom webhook endpoint you define. This provides the most flexibility for handling notifications within your own application or integrating with third-party services.

### Configuration:

1. **Channel:** Set the `channel` field to `"WEBHOOK"`.
2. **Delivery Location:** Provide the full URL of your webhook endpoint in the `delivery_location` field.

#### Example Payload:

```json
{
  "channel": "WEBHOOK",
  "delivery_location": "https://your-app.com/webhook-endpoint"
}
```

### Webhook Payloads (Sent by Nodefy):

Nodefy will send a POST request to your webhook endpoint with a JSON payload containing the details of the triggered event.

#### Example address\_activity payload:

```json
{
  "webhookId": "wh_123abc",  // The ID of the triggered webhook
  "external_user_id": "user123",  // The ID of the user to notify
  "createdAt": "2024-01-01T12:00:00Z",
  "type": "ADDRESS_ACTIVITY", 
  "event": {
    "network": "ETH_MAINNET",
    "activity": [
      {
        "hash": "0x987...xyz",
        "fromAddress": "0x678...ghi",
        "toAddress": "0x123...abc", 
        "asset": "ETH",
        "value": "0.5",
        "category": "external",
        "blockNum": "17000000"
      }
    ]
  }
}
```

#### Example graphql payload:

The exact payload structure for GraphQL events will depend on your specific GraphQL query. Here's an example for a simple ERC-20 `Transfer` event query:

```json
{
  "webhookId": "wh_456def",  // The ID of the triggered webhook
  "external_user_id": "user123", 
  "createdAt": "2024-01-02T15:30:00Z",
  "type": "GRAPHQL",
  "event": {
    "data": {
      "block": {
        "logs": [
          {
            "transaction": {
              "hash": "0x...", 
              "from": {
                "address": "0x..."  // Address of the sender
              },
              "to": {
                "address": "0x..." // Address of the receiver
              },
            },
            "topics": ["0xddf252...", "0x...", "0x..."], 
            "data": "0x..."
          }
        ]
      }
    }
  }
}
```
