---
title: "Create a webhook"
method: POST
path: "/webhooks"
tags: ["Webhooks"]
---

# Create a webhook

`POST /webhooks`

## Request

- Base URL: `https://sochain.com/api/v3`
- URL: `https://sochain.com/api/v3/webhooks`
- Auth: API key in header `API-KEY`

Each notification counts as one request; retries don't. Addresses watched by address webhooks and streams together, each counted once, are capped per plan (Free 500, Hobby 1,000, Starter 10,000, Professional 25,000, Behemoth 100,000; Free's on testnets); past that, 403.

## Request body

- WebhookCreate
  - `type` 'address.transaction' | 'transaction.confirmation' | 'block.new' | 'fees.below' | 'fees.above', required: block.reorged, transaction.replaced and transaction.dropped are delivered alongside these; they aren't created on their own.
  - `network` 'BTC' | 'LTC' | 'DOGE' | 'ZEC' | 'BTCTEST' | 'LTCTEST' | 'DOGETEST' | 'ZECTEST': Required unless bucket is given. Free plans: BTCTEST, LTCTEST, DOGETEST or ZECTEST.
  - `url` string, uri, required: Your HTTPS endpoint, on a public host (not sochain.com).
  - `bucket` string: Letters, numbers, - and _, up to 64 characters. Unique within your account.
  - `addresses` string[]: address.transaction without a bucket: the addresses to watch, up to 1,000 in this call (add more with POST /webhooks/{id}/addresses).
  - `transactions` string[]: transaction.confirmation: the transaction IDs to track, up to 1,000 in this call (add more with POST /webhooks/{id}/transactions).
  - `notify_at` integer[]: Confirmation counts to notify at, from 0 (first seen) to 100; transaction.confirmation from 1. Defaults: [0, 1] for address.transaction, [1, 2, 3, 6] for transaction.confirmation.
  - `label` string: Optional, for you: shown on the dashboard.
  - `threshold` number: fees.below / fees.above: the fee rate (sat/vB, lit/vB or koinu/vB) to cross.

## Response `200`

Success.

- object
  - `status` 'success', required
  - `data` Webhook, required
    - `id` string, required
    - `type` 'address.transaction' | 'transaction.confirmation' | 'block.new' | 'fees.below' | 'fees.above', required: block.reorged, transaction.replaced and transaction.dropped are delivered alongside these; they aren't created on their own.
    - `network` 'BTC' | 'LTC' | 'DOGE' | 'ZEC' | 'BTCTEST' | 'LTCTEST' | 'DOGETEST' | 'ZECTEST', required
    - `url` string, uri, required
    - `bucket` string, nullable
    - `notify_at` integer[]
    - `threshold` number, nullable
    - `label` string, nullable: Yours, as the dashboard shows it.
    - `status` 'unverified' | 'active' | 'paused'
    - `num_addresses` integer: Addresses it watches itself (address.transaction without a bucket).
    - `num_transactions` integer: Transactions it tracks (transaction.confirmation).
    - `created` integer: When it was made (Unix time).
    - `last_event_at` integer, nullable: When it last sent an event (Unix time); null before its first.
    - `failing_since` integer, nullable: When its deliveries started failing (Unix time); null while they succeed.
    - `verified` boolean
    - `verify_error` string, nullable: Why the last endpoint check failed, if it did.
    - `secret` string: Only in the answer to POST /webhooks: the signing secret, shown once.

## Other responses

- `400`: A bad parameter or body; the message says which.
- `401`: An invalid key, no key where one is needed (buckets, webhooks, /account_info), a locked account or expired plan, or both the month's requests and the keyless rate used up. Kept as 401, with this message, for v3 compatibility.
- `403`: A read-only key, or a change past your plan's limits: data.error_message says which.
- `404`: Not found.
- `413`: A body over the limit: 256 KB where a call carries addresses or transaction IDs, 64 KB otherwise.
- `415`: A body that isn't JSON: send it with Content-Type: application/json.
- `503`: Briefly unavailable; retry with backoff. May carry Retry-After.

---

[API](https://skmtc.dev/sochain/apis/sochain-api.md) · [All operations](https://skmtc.dev/sochain/apis/sochain-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sochain/apis/sochain-api/revisions/80682797b38f?raw)
