Wallet API
Subscribe Data

Subscribe Data#

Subscribe data related to block events and transaction events. You can create up to 20 subscriptions at a time, as shown in the array format of the request example. After a successful subscription, messages will be pushed through webhook.

Request Path#

POST https://www.okx.com/api/v5/waas/wallet/webhook/subscribe

Request Parameters#

urlStringYesWebhook callback address
For detailed usage, refer to here
typeStringYesType of data to subscribe to. Valid values are transaction: triggers when any transaction related to the address occurs.
block: triggers when any block is generated
chainIndexStringYesUnique identifier of the chain
nameStringNoName of the subscription

Response Parameters#

idStringUnique identifier of the subscription

Request Example#

curl --location --request POST 'https://www.okx.com/api/v5/waas/wallet/webhook/subscribe' \
--header 'Content-Type: application/json' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data-raw '[

Response Example#

        { "id":"1" }