Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mobula.io/llms.txt

Use this file to discover all available pages before exploring further.

Webhook callbacks are signed with the per-stream securityToken you provide. Always verify it server-side before trusting the payload.
createWebhooks registers one or more webhook subscriptions in a single call. Each top-level input field corresponds to a webhook category; you can mix and match in the same request, and the response groups the created webhooks by category in matching arrays.

Returns

createWebhooks
CreateWebhooksOutput!
Created webhooks, grouped by category. See CreateWebhooksOutput.

Arguments

input
CreateWebhooksInput!
required
Bundle of category-specific webhook inputs. See CreateWebhooksInput.

Validation

  • securityToken is required on every webhook input.
  • At least one network must be supplied via conditions.networkId. Token price and market cap webhooks accept a single ID via { eq: <id> }; pair and transfer webhooks accept multiple via { oneOf: [<id>, ...] }.
  • When bucketKey is provided, both bucketId and bucketSortKey are required.
  • deduplicate: true returns the existing webhook (instead of creating a duplicate) when an active webhook with identical callbackUrl, conditions, publishingType, and alertRecurrence already exists for the calling API key.

Example

mutation CreateWebhooks($input: CreateWebhooksInput!) {
  createWebhooks(input: $input) {
    tokenPairEventWebhooks {
      id
      webhookType
      name
      callbackUrl
      conditions {
        ... on TokenPairEventWebhookCondition {
          networkId { oneOf }
          eventType { oneOf }
        }
      }
    }
    marketCapWebhooks {
      id
      webhookType
    }
    tokenPriceEventWebhooks {
      id
      webhookType
    }
    tokenTransferEventWebhooks {
      id
      webhookType
    }
  }
}
Variables
{
  "input": {
    "tokenPairEventWebhooksInput": {
      "webhooks": [
        {
          "name": "WETH big swaps",
          "callbackUrl": "https://example.com/webhooks/mobula",
          "securityToken": "whsec_REPLACE_ME",
          "alertRecurrence": "INDEFINITE",
          "conditions": {
            "networkId": { "oneOf": [1] },
            "tokenAddress": { "eq": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" },
            "swapValue": { "gte": "10000" },
            "eventType": { "oneOf": ["SWAP"] }
          },
          "publishingType": "SINGLE",
          "deduplicate": true
        }
      ]
    },
    "tokenPriceEventWebhooksInput": {
      "webhooks": [
        {
          "name": "WETH crosses $4k",
          "callbackUrl": "https://example.com/webhooks/mobula",
          "securityToken": "whsec_REPLACE_ME",
          "alertRecurrence": "ONCE",
          "conditions": {
            "address": { "eq": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" },
            "networkId": { "eq": 1 },
            "priceUsd": { "gte": "4000" }
          }
        }
      ]
    }
  }
}

Playground