> ## 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.

# createWebhooks

> Create event webhooks for token pair, market cap, token price and token transfer events.

<Warning>
  Webhook callbacks are signed with the per-stream `securityToken` you provide. Always verify it server-side before trusting the payload.
</Warning>

`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

<ResponseField name="createWebhooks" type="CreateWebhooksOutput!">
  Created webhooks, grouped by category. See [CreateWebhooksOutput](/api-reference/graphql/types/CreateWebhooksOutput).
</ResponseField>

### Arguments

<ResponseField name="input" type="CreateWebhooksInput!" required>
  Bundle of category-specific webhook inputs. See [CreateWebhooksInput](/api-reference/graphql/types/CreateWebhooksInput).
</ResponseField>

### 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

```graphql theme={null}
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
    }
  }
}
```

```json Variables theme={null}
{
  "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

<iframe src={`https://graphql.mobula.io/graphql?query=${encodeURIComponent('mutation CreateWebhooks($input: CreateWebhooksInput!) { createWebhooks(input: $input) { tokenPairEventWebhooks { id webhookType name callbackUrl } marketCapWebhooks { id webhookType } tokenPriceEventWebhooks { id webhookType } tokenTransferEventWebhooks { id webhookType } } }')}&variables=${encodeURIComponent('{"input":{"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"}}}]}}}')}`} title="GraphQL Playground" style={{ width: '100%', minHeight: '600px', border: '1px solid var(--color-border)', borderRadius: '8px' }} />
