# 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..."
          }
        ]
      }
    }
  }
}
```


---

# Agent Instructions: 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:

```
GET https://docs.nodefy.xyz/our-api-guide/channels/custom-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
