---
title: "Create a Target"
method: POST
path: "/streaming/v2/targets"
tags: ["target"]
---

# Create a Target

`POST /streaming/v2/targets`

Creates a new target. Duplicate targets are not allowed.

## Request body

- NewTarget
  - `name` string, required — The name of the target
  - `description` string — Optional information about the target
  - `status` 'disconnected' | 'active' | 'failed' — Current status of the target
  - `type` 'webhook' | 'websocket', required — The type of target, indicating the communication protocol.
  - `settings` union, required — Configuration settings specific to the target type.
    - WebhookSettings — Configuration for webhook-based targets. Includes the HTTP method, destination URL, and a secret used for signing and validating webhook messages.
      - `destination` string, required — The destination URL where webhook events will be sent.
      - `method` 'POST' | 'GET', required — HTTP method used to deliver webhook events.
      - `secret` string, required — Secret key used to sign webhook payloads. Must be at least 10 characters long.
    - WebsocketSettings — Configuration for WebSocket-based targets. Used to establish a connection and authenticate event delivery.
      - `secret` string — Secret used to authenticate the WebSocket connection. Must be at least 10 characters long.
    - EmailSettings — Used to send notifications or alerts to a specified recipient via email.
      - `name` string, required — The display name of the recipient.
      - `email` string, email, required — The recipient's email address.
  - `max_buffer_count` integer — Maximum number of events that can be buffered before delivery.

## Response `201`

Target created

- Target
  - `id` string, uuid, required
  - `name` string, required
  - `description` string
  - `status` 'disconnected' | 'active' | 'connected' | 'failed', required
  - `type` 'webhook' | 'websocket', required
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `settings` union, required
    - WebhookSettings — Configuration for webhook-based targets. Includes the HTTP method, destination URL, and a secret used for signing and validating webhook messages.
      - `destination` string, required — The destination URL where webhook events will be sent.
      - `method` 'POST' | 'GET', required — HTTP method used to deliver webhook events.
      - `secret` string, required — Secret key used to sign webhook payloads. Must be at least 10 characters long.
    - WebsocketSettings — Configuration for WebSocket-based targets. Used to establish a connection and authenticate event delivery.
      - `secret` string — Secret used to authenticate the WebSocket connection. Must be at least 10 characters long.
    - EmailSettings — Used to send notifications or alerts to a specified recipient via email.
      - `name` string, required — The display name of the recipient.
      - `email` string, email, required — The recipient's email address.
  - `max_buffer_count` integer, required — Maximum number of events that can be buffered before delivery.
  - `current_buffer_count` integer, required

## Other responses

- `default` — Unexpected error

---

[API](https://skmtc.dev/blockdaemon/apis/staking-api.md) · [All operations](https://skmtc.dev/blockdaemon/apis/staking-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/blockdaemon/staking-api/revisions/f94e296a08a3/schema)
