---
updatedAt: 2026-01-27T17:50:39.000Z
---

Fetch the complete documentation index at: https://docs.blockdaemon.com/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# Step 2. Create a New Target

Learn how to configure targets for event streaming.

> ❗️ Important Note
>
> Each call incurs a fixed CU charge, plus additional CUs for API operations. See the [Compute Units Usage](https://docs.blockdaemon.com/reference/compute-units-usage-events) page for details.

## Create a Target

Now you need to set up a webhook target to start receiving events. A target will serve as a destination in a rule that provides you with the data you desire. You can do this by using the **Target** endpoint.

### Request Payload

```curl
curl --request POST \
     --url https://svc.blockdaemon.com/streaming/v2/targets \
     --header 'X-API-Key: YOUR_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "name": "string",
  "description": "string",
  "type": "webhook",
  "settings": {
    "destination": "string",
    "method": "POST",
    "secret": "string"
  },
  "max_buffer_count": 10000
}
'
```

The request body includes the following parameters:

| Fields             | Required/Optional | Details                                                                                                                                                                                                              |
| :----------------- | :---------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`             | Required          | The name of your target. Each resource should have a unique name.                                                                                                                                                    |
| `description`      | Optional          | A description of your target.                                                                                                                                                                                        |
| `type`             | Required          | The type of target which currently limited to webhook.                                                                                                                                                               |
| `settings`         | Required          | The configuration of a webhook target.                                                                                                                                                                               |
| `destination`      | Required          | The destination URL where we can reach this webhook.                                                                                                                                                                 |
| `method`           | Required          | The HTTP method for the webhook (in this case, `POST`).                                                                                                                                                              |
| `secret`           | Required          | A private webhook secret with a minimum string length of 10 characters. This is used as the challenge token for [webhook verification process.](https://docs.blockdaemon.com/reference/webhook-verification-process) |
| `max_buffer_count` | Optional          | Maximum number of items allowed in the webhook target's buffer.                                                                                                                                                      |

### Response Payload

Below is the successful response.

```json 201 - Created
{
    "created_at": "2024-03-06T09:48:06.673414Z",
    "current_buffer_count": 0,
    "description": "Documentation webhook target",
    "id": "8918a2f1-28d6-4e2f-837b-fb49ec09daaf",
    "max_buffer_count": 100,
    "name": "docs webhook target example",
    "settings": {
        "destination": "http://example.com/webhook",
        "method": "POST",
        "secret": "************here"
    },
    "status": "active",
    "type": "webhook",
    "updated_at": "2024-03-06T09:48:06.673414Z"
}
```

It includes the following details:

| Fields                      | Details                                                                                                                                                                                   |
| :-------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                        | Unique identifier for your webhook target, necessary for creating rules. You will need this ID to create a rule.                                                                          |
| `created_at` & `updated_at` | A timestamp for when the target was created and last updated.                                                                                                                             |
| `max_buffer_count`          | Maximum number of events that will buffer for your target. If your target is slow or temporarily offline, event streaming will buffer messages up to this limit.                          |
| `destination`               | URL to send webhook payloads for processing or notification.                                                                                                                              |
| `status`                    | Status of your webhook. It must be "**connected**" before receiving events. Refer to the [Webhook Target Reference](https://docs.blockdaemon.com/reference/webhook-verification-process). |

> 👍 Note
>
> You can use one webhook target for multiple rules by using its `id`.

<br />

***

## Managing Target

### [Verify Target](https://docs.blockdaemon.com/reference/validate-verification)

Validate a target to check if it can receive a message. This endpoint is also useful for debugging issues during the [webhook verification process](https://docs.blockdaemon.com/reference/create-a-new-target#-webhook-verification).

**Example Payload**

Make sure the target has a valid `secret` configured, as this is used to generate the validation token.

```curl Request Payload
curl -X POST "https://svc.Blockdaemon.com/streaming/v2/targets/{TARGET ID HERE}/validate-verification" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```
```json Response Payload
{
  "status": "success",
  "error_status_code": 0,
  "error_response_message": "string",
  "duration": "string"
}
```

**Failure Example**

An incorrect or misformatted `secret` can cause validation to fail. For example, avoid using spaces in the secret — use hyphens (`-`) instead.

```json
{
    "duration": "4.165116ms",
    "error_response_message": "failed validation token is not as expected",
    "error_status_code": 200,
    "status": "failed"
}
```

To resolve this, you must [update the target](https://docs.blockdaemon.com/docs/step-2-create-a-new-target#update-target) with a valid `secret`, then retry.

***

### [Update Target](https://docs.blockdaemon.com/reference/update-target)

Update a target by its ID. You can modify the destination, secret, name, and other target settings. To partially update a target, see: [Partially Update a Target](https://docs.blockdaemon.com/reference/patch-target)

**Example Payload**

```curl Request Payload
curl --request PUT \
     --url https://svc.blockdaemon.com/streaming/v2/targets/{TARGET ID HERE} \
     --header 'X-API-Key: YOUR_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "name": "documentation target",
  "description": "documentation target",
  "type": "webhook",
  "settings": {
    "destination": "string",
    "method": "POST",
    "secret": "string"
  },
  "max_buffer_count": 10000
}
'
```
```json Response Payload
{
    "created_at": "2024-02-05T12:36:38.113436Z",
    "current_buffer_count": 0,
    "description": "documentation webhook target",
    "id": "<TARGET_ID>",
    "max_buffer_count": 100,
    "name": "documentation target",
    "settings": {
        "destination": "www.blockdaemon.com/webhook/doctarget",
        "method": "POST",
        "secret": "************cret"
    },
    "status": "active",
    "type": "webhook",
    "updated_at": "2024-02-05T12:46:35.169515Z"
}
```

***

### [Get Target Details](https://docs.blockdaemon.com/reference/find-target-by-id)

Retrieve the full configuration of a specific target by its ID. Use this to review webhook settings, buffer usage, and metadata.

**Example Payload**

```curl Request Payload
curl --request GET \
     --url https://svc.blockdaemon.com/streaming/v2/targets/{TARGET ID HERE} \
     --header 'X-API-Key: YOUR_API_KEY' \
     --header 'accept: application/json'
```
```json Response Payload
{
    "created_at": "2024-02-05T12:36:38.113436Z",
    "current_buffer_count": 0,
    "description": "documentation webhook target",
    "id": "<TARGET_ID>",
    "max_buffer_count": 100,
    "name": "documentation target",
    "settings": {
        "destination": "www.blockdaemon.com/webhook/doctarget",
        "method": "POST",
        "secret": "************cret"
    },
    "status": "active",
    "type": "webhook",
    "updated_at": "2024-02-05T12:46:35.169515Z"
}
```

***

### [Delete Target](https://docs.blockdaemon.com/reference/delete-target)

Delete a target by its ID. This action cannot be undone.

**Example Payload**

```curl Request Payload
curl --request DELETE \
     --url https://svc.blockdaemon.com/streaming/v2/targets/{TARGET ID HERE} \
     --header 'X-API-Key: YOUR_API_KEY' \
     --header 'accept: application/json'
```
```Text Response Payload
A 204 response status indicates the target was successfully deleted.
```

***

### [Target Validate Message](https://docs.blockdaemon.com/reference/validate-message-send)

Simulate message delivery to a target after verification. This allows you to test if a target webhook receives and processes event messages correctly.

**Example Payload**

This requires a predefined template. Please refer to [this page](https://docs.blockdaemon.com/reference/templates) for creating a template. It will send a sample message to your target based on the protocol and type.

```curl Request Payload
curl --request POST \
     --url https://svc.blockdaemon.com/streaming/v2/targets/{TARGET ID HERE}/validate-message \
     --header 'accept: application/json' \
     --header 'authorization: Bearer YOUR_API_KEY' \
     --header 'content-type: application/json' \
     --data '
{
  "protocol": "string",
  "type": "string",
  "template": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
'
```
```json Response Payload
{
    "duration": "374.944099ms",
    "status": "success"
}
```

Following a successful call, the webhook will receive a sample message useful for tracking and verifying transactions on the blockchain. See the sample below.

```json
{
  "accessList": [],
  "additionalFields": {
    "yParity": "0x0"
  },
  "bd_metadata": {
    "network": "mainnet",
    "protocol": "ethereum",
    "schema": "Transaction",
    "version": 0
  },
  "blockHash": "0xa101fa10de106b17bafb85b4fab089af7156ef7bb71e12701711f392176efc25",
  "blockNumber": "0x1227602",
  "chainId": {
    "string": "0x1"
  },
  "contractAddress": null,
  "creates": null,
  "cumulativeGasUsed": {
    "string": "0x2eed3f"
  },
  "effectiveGasPrice": {
    "string": "0x959dc078d"
  },
  "from": "0x28C6c06298d514Db089934071355E5743bf21d60",
  "gas": "0x35d14",
  "gasPrice": "0x959dc078d",
  "gasUsed": {
    "string": "0xb429"
  },
  "hash": "0x66cd831693896d069773b1b4fb0b170eb3265f8a5ba7852c6185695d241fa98e",
  "input": {
    "string": "0xa9059cbb000000000000000000000000476a3d7bae70f59cfa8db1d8fe795f285cadfc6700000000000000000000000000000000000000000000000000000001f6210c7d"
  },
  "logsBloom": {
    "string": "0x00000000000000000000080000000004000000000000000000000000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000200000000002000010000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000020000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  },
  "maxFeePerGas": {
    "string": "0x17bfac7c00"
  },
  "maxPriorityFeePerGas": {
    "string": "0x77359400"
  },
  "nonce": "0x85b19b",
  "publicKey": null,
  "r": "0x268b6c7f957544c9723ac118c3270e388889f25e3eac24fa71076ae7f35f2d1a",
  "raw": null,
  "root": null,
  "s": "0x79993142d0fcaeac62d757832e284b57b147554ac8c808c30e7914fe66bd385d",
  "status": {
    "string": "0x1"
  },
  "timestamp": {
    "long": 1705603907
  },
  "to": {
    "string": "0xdAC17F958D2ee523a2206206994597C13D831ec7"
  },
  "transactionIndex": "0x2d",
  "type": {
    "string": "0x2"
  },
  "uuid": {
    "string": "e65bfb70-31e8-4465-b528-9de9beb4845f"
  },
  "v": "0x0",
  "value": {
    "string": "0x0"
  }
}
```

<br />

## 👋 Need Help?

Contact us through [email](mailto:support@blockdaemon.com) or our [support page](https://www.blockdaemon.com/support) for any issues, bugs, or assistance you may need.