Get Webhooks

Returns a user's list of webhooks.

ℹ️

This endpoint is available on Defined Growth and Enterprise Plans

Endpoint: getWebhooks

Method: POST

Arguments

Response

NameTypeDescription
cursorString

A cursor for use in pagination.

items[Webhook]

A list of webhooks belonging to a user.

NameTypeDescription
alertRecurrenceAlertRecurrence!

The recurrence of the webhook. Can be INDEFINITE or ONCE.

callbackUrlString!

The url to which the webhook message should be sent.

conditionsWebhookCondition!

The conditions which must be met in order for the webhook to send a message.

createdInt!

The unix timestamp for the time the webhook was created.

groupIdString

The webhook group ID used to group webhooks together for ordered message sending.

idString!

The ID of the webhook.

nameString!

The given name of the webhook.

retrySettingsRetrySettings

The settings for retrying failed webhook messages.

statusString!

The status of the webhook. Can be ACTIVE or INACTIVE.

webhookTypeWebhookType!

The type of webhook. Can be PRICE_EVENT, DECODED_CALL, DECODED_LOG, RAW_CALL_TRACE, NFT_EVENT, or TOKEN_PAIR_EVENT.

Example

Query

mutation GetWebhooks {
  getWebhooks(cursor: "", limit: 10) {
    cursor
    items {
      alertRecurrence
      callbackUrl
      conditions {
        ... on PriceEventWebhookCondition {
          __typename
          networkId {
            eq
          }
          priceUsd {
            eq
            gt
            gte
            lt
            lte
          }
          tokenAddress {
            eq
          }
        }
        ... on DecodedLogWebhookCondition {
          event
          decodingId {
            eq
          }
          address {
            eq
          }
          eventName {
            eq
          }
        }
        ... on DecodedCallWebhookCondition {
          input
          address {
            eq
          }
          from {
            eq
          }
          decodingId {
            eq
          }
          methodId {
            eq
          }
          methodName {
            eq
          }
          output
          to {
            eq
          }
        }
      }
      created
      groupId
      id
      name
      status
      webhookType
    }
  }
}

Response

{
    "data": {
        "getWebhooks": {
            "cursor": null,
            "items": [
                {
                    "alertRecurrence": "ONCE",
                    "callbackUrl": "https://myserver.mydomain.com/my-webhook-handler",
                    "conditions": {
                        "input": "{\"amount\":{\"gt\":\"100000000\"}}",
                        "address": null,
                        "from": null,
                        "decodingId": {
                            "eq": "uniswapv3:pool:1"
                        },
                        "methodId": null,
                        "methodName": {
                            "eq": "mint"
                        },
                        "output": null,
                        "to": null
                    },
                    "created": 1676662026,
                    "groupId": "uniswap",
                    "id": "e1034c16-f873-4051-84b7-e525ea0998c6",
                    "name": "uniswapv3 swap event greater than 100000000",
                    "status": "ACTIVE",
                    "webhookType": "DECODED_CALL"
                },
                {
                    "alertRecurrence": "ONCE",
                    "callbackUrl": "https://myserver.mydomain.com/my-webhook-handler",
                    "conditions": {
                        "event": "{\"amount0\":{\"gt\":\"100000000\"}}",
                        "decodingId": {
                            "eq": "uniswapv3:pool:1"
                        },
                        "address": {
                            "eq": "0x824a30f2984f9013f2c8d0a29c0a3cc5fd5c0673"
                        },
                        "eventName": {
                            "eq": "Swap"
                        }
                    },
                    "created": 1676662026,
                    "groupId": "uniswap",
                    "id": "fc91e96b-8994-4bd8-b366-3769619292ee",
                    "name": "uniswapv3 swap event",
                    "status": "ACTIVE",
                    "webhookType": "DECODED_LOG"
                },
                {
                    "alertRecurrence": "INDEFINITE",
                    "callbackUrl": "https://myserver.mydomain.com/my-webhook-handler",
                    "conditions": {
                        "__typename": "PriceEventWebhookCondition",
                        "networkId": {
                            "eq": 1
                        },
                        "priceUsd": {
                            "eq": null,
                            "gt": "0",
                            "gte": null,
                            "lt": null,
                            "lte": null
                        },
                        "tokenAddress": {
                            "eq": "0x5a98fcbea516cf06857215779fd812ca3bef1b32"
                        }
                    },
                    "created": 1676662026,
                    "groupId": "test-group",
                    "id": "44c4e700-4c09-401e-a6d8-b22bd6935d41",
                    "name": "uniswap",
                    "status": "ACTIVE",
                    "webhookType": "PRICE_EVENT"
                }
            ]
        }
    }
}

πŸ‘‹

Join our Discord

Ask questions, share what you're working on and request new features πŸ‘¬πŸ‘­