latestOpenAPI 3.0.32026-08-224982,0272.8 MB

e445c15e5bee

Webhook

Add block webhook

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.
post/api/v2/{coin}/webhooks

Path parameters

coinstring required

A cryptocurrency or token ticker symbol.

Example:btc

Request body

type'block' | 'wallet_confirmation' required
urlstring uri required

URL to fire the webhook to.

labelstring

Label of the new webhook.

numConfirmationsinteger

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.

Example request

{
  "type": "block",
  "url": "https://your.server.com/webhook",
  "numConfirmations": 6
}

Response

OK

type'block'

Event type to listen to.

userIdstring
idstring
labelstring
createdstring date-time
coinstring

A cryptocurrency or token ticker symbol.

urlstring uri required
versioninteger

2 for coins running on API v2.

numConfirmationsinteger
state'active' | 'suspended'

If active, indicates the webhook can trigger and send to the URL. If suspended, indicates the webhook can't trigger.

lastAttemptstring date-time
failingSincestring date-time
successiveFailedAttemptsinteger
walletIdstring
allowBlockedHostsboolean
allTokenboolean
txRequestStatesTransactionRequestState1[]

If present, only transaction request state changes from the list will trigger notifications. If not present, all transaction request state changes will trigger notifications.

txRequestTransactionStatesTransactionState1[]

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.

identityStatusIdentityStatus[]

If present, only identity status changes from the list will trigger notifications. If not present, all identity status changes will trigger notifications.

userKycStateVerifiedKycState[]

If present, only user kyc state changes from the list will trigger notifications. If not present, all kyc state changes will trigger notifications.

enterpriseKycStateVerifiedKycState[]

If present, only enterprise kyc state changes from the list will trigger notifications. If not present, all kyc state changes will trigger notifications.

Example response

{
  "type": "transfer",
  "userId": "59cd72485007a239fb00282ed480da1f",
  "id": "59cd72485007a239fb00282ed480da1f",
  "label": "Test Webhook",
  "coin": "btc",
  "url": "https://your.server.com/webhook",
  "version": 2,
  "numConfirmations": 6,
  "state": "active"
}