Cortex Docs

Webhooks & Event Notifications

Stream real-time keyword movements, competitor releases, and ranking alerts into your own systems via secure webhooks.

Webhooks & Event Notifications

Webhooks notify your backend or automation services whenever notable events occur in your Cortex workspace (e.g. significant rank changes, competitor app updates, daily digest generation).

Subscribing to Events

Configure webhook endpoints under Settings > Webhooks in the Cortex dashboard or programmatically via the REST API.

Available Event Types

Event NameTrigger
keyword.rank_changedTriggered when a tracked keyword changes position by ±N spots
competitor.metadata_updatedTriggered when a tracked competitor modifies title, subtitle, or screenshots
chart.movementTriggered on major category chart shifts
billing.subscription_updatedTriggered when plan tier or seat limit changes

Signature Verification

Every webhook payload carries a cryptographic HMAC-SHA256 signature in the X-Cortex-Signature header computed using your webhook signing secret.

import crypto from 'node:crypto'
import express from 'express'

const app = express()
app.use(express.json())

function verifyWebhook(payload: string, signature: string, secret: string): boolean {
  const hmac = crypto.createHmac('sha256', secret).update(payload).digest('hex')
  return crypto.timingSafeEqual(Buffer.from(hmac), Buffer.from(signature))
}

app.post('/api/cortex-webhook', (req, res) => {
  const signature = req.headers['x-cortex-signature'] as string
  const rawBody = JSON.stringify(req.body)

  if (!verifyWebhook(rawBody, signature, process.env.CORTEX_WEBHOOK_SECRET!)) {
    return res.status(401).send('Invalid signature')
  }

  const { event, data } = req.body
  console.log(`Received ${event}:`, data)
  res.status(200).send('OK')
})

On this page