Add block webhook

post/api/v2/{coin}/webhooks

Adds a webhook that will result in an HTTP callback at the specified URL from BitGo when events are triggered.

Types of block webhooks:

  1. Block webhooks will fire when a new block is seen on the coin network.
  2. Wallet confirmation webhooks will fire when a wallet has been initialized.

Path Parameters

  • coinstringRequired
    A cryptocurrency or token ticker symbol.
    Example: "btc"

Request Body

type string required
Allowed values: block wallet_confirmation
Example: block
url string <uri>required
URL to fire the webhook to.
Example: http://your.server.com/webhook
label string
Label of the new webhook.
numConfirmations integer
Number of confirmations before triggering the webhook. If 0 or unspecified, requests will be sent to the callback endpoint when the transfer is first seen and when it is confirmed.
Minimum: >= 0
Example: 6
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 var baseCoin = bitgo.coin('tbtc'); var webhooks = baseCoin.webhooks(); webhooks .add({ url: 'http://your.server.com/user_webhook', type: 'block', label: 'Test User Webhook', numConfirmations: 1, }) .then(function (result) { console.dir(result); });

200 Response

type string
Event type to listen to.
Example: null
userId string
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
id string
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
label string
Example: Test Webhook
created string <date-time>
Example: {}
coin string
A cryptocurrency or token ticker symbol.
Example: btc
url string <uri>required
Example: https://your.server.com/webhook
version integer
2 for coins running on API v2.
Example: 2
numConfirmations integer
Example: 6
state string
If "active", indicates the webhook can trigger and send to the URL. If "suspended", indicates the webhook can't trigger.
Allowed values: active suspended
Example: active
lastAttempt string <date-time>
Example: {}
failingSince string <date-time>
Example: {}
successiveFailedAttempts integer
Example: 0
walletId string
allowBlockedHosts boolean
allToken boolean
txRequestStates array[string]
If present, only transaction request state changes from the list will trigger notifications. If not present, all transaction request state changes will trigger notifications.
Allowed values: initialized pendingApproval pendingUserCommitment pendingUserRShare pendingUserGShare readyToSend pendingUserSignature pendingDelivery signed delivered canceled rejected failed
txRequestTransactionStates array[string]
If present, only transaction request transaction state changes from the list will trigger notifications. If not present, all transaction request transaction state changes will trigger notifications.
Allowed values: initialized pendingSignature eddsaPendingCommitment eddsaPendingRShare eddsaPendingGShare readyToCombineShares signed held delivered invalidSignature rejected

400 Response

error string required
Human-readable error message
requestId string required
Client request id
context object
Properties that apply to a specific error name
name string required
Error code