Documentation Index
Fetch the complete documentation index at: https://docs.codex.io/llms.txt
Use this file to discover all available pages before exploring further.
Overview
ThecreateWebhooks mutation creates one or more webhooks that push real-time events from Codex to an HTTP endpoint you control. For filter conditions, payload shapes, and message verification details for each webhook type, see the Webhooks concept page.
Available webhook types
Codex supports the following webhook types. Each is documented in detail on the Webhooks concept page:- Token Pair Event: swaps, mints, burns, and other pair-level events. Most common.
- Token Price Event: token price crosses a threshold.
- Token Transfer Event: tokens moved to or from a wallet.
- MarketCap Event: fully diluted or circulating market cap crosses a threshold.
- Prediction Trade Event: Polymarket or Kalshi prediction trade.
Quick example
A minimal mutation that creates aTOKEN_PAIR_EVENT webhook firing on any swap over $10,000 on a specific pair:
Usage Guidelines
- Your endpoint must return a 2xx response within 3 seconds, or the message will be retried
- Use
bucketKeyto group related webhooks. The individualbucketIdandbucketSortKeyfields are deprecated - Use
publishingType: BATCHfor high-volume webhooks likeTOKEN_PAIR_EVENTto reduce HTTP requests to your endpoint - For
MARKET_CAP_EVENTwebhooks, combine market cap thresholds withvolumeUsdandliquidityUsdfilters (usinggt,gte,lt,lte,eqoperators) to ensure quality results - Verify every webhook message using the
hashfield. See Hash verification for the check - Use the Codex Explorer to build webhook mutations visually before wiring up production
Troubleshooting Tips
Webhook not firing
Webhook not firing
Check that your endpoint returns a 2xx response within 3 seconds. If your endpoint is slow, you may be getting duplicate messages from retries. You can inspect webhook status in the Codex Dashboard.
Conditions never match
Conditions never match
Double-check that the
networkId on your condition matches the network the token or pair lives on. See supported networks for the full list of network IDs.Same event delivered multiple times
Same event delivered multiple times
Use the
deduplicationId field on each message to deduplicate on your side. Retries reuse the same deduplicationId.Want to preview a webhook payload before wiring up production
Want to preview a webhook payload before wiring up production
Use the Codex Explorer to build the mutation visually and send a test message to your endpoint.