# Set up webhooks

> Register an HTTPS receiver and verify a signed test delivery before using its payload.

Canonical URL: https://quantset.dev/docs/integrations/webhooks
Full LLM API Contract: https://api.quantset.dev/llms-full.txt

> ## For AI agents
> The QuantSet API is at https://api.quantset.dev. Send the key in the `X-API-Key` header. The sandbox key `mw_demo` needs no signup and reads the sample listings.
> No key yet? An agent can open an account on its own: https://api.quantset.dev/skill.md
> Connect an MCP client to https://api.quantset.dev/mcp. Client setup is at https://api.quantset.dev/agents.md.
> Start with https://api.quantset.dev/llms.txt or read the full reference at https://api.quantset.dev/llms-full.txt. The OpenAPI file is https://api.quantset.dev/openapi.json. Add `.md` to any docs URL to get that page as Markdown.

Register an HTTPS receiver and verify a signed test delivery before using its payload.

## Register the receiver

Use a key with webhook access. Replace the example URL with your receiver. Save the id and secret from the 201 response. Listing your subscriptions later returns their configuration and omits the signing secret.

```
curl -X POST "https://api.quantset.dev/api/v1/webhooks" \
  -H "X-API-Key: $QUANTSET_API_KEY" -H 'Content-Type: application/json' \
  --data '{"url":"https://receiver.example/quantset","events":["filing.created"]}'
```

## Verify the incoming POST

The X-Quantset-Signature header contains t (Unix seconds) and v1 (a hex digest). At your receiver, compute HMAC-SHA256 over the timestamp, a period and the exact raw request bytes. Compare before parsing JSON. The five-minute tolerance below is a receiver policy for rejecting stale requests.

```
import hashlib
import hmac
import time

def valid_delivery(secret, signature, raw_body):
    try:
        fields = dict(part.split("=", 1) for part in signature.split(","))
        timestamp = fields["t"]
        if abs(time.time() - int(timestamp)) > 300:
            return False
        signed = timestamp.encode("ascii") + b"." + raw_body
        expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest()
        return hmac.compare_digest(expected, fields["v1"])
    except (KeyError, ValueError, TypeError):
        return False
```

## Send a test delivery

```
curl -X POST "https://api.quantset.dev/api/v1/webhooks/$WEBHOOK_ID/test" \
  -H "X-API-Key: $QUANTSET_API_KEY"
```

Your receiver gets a JSON envelope like this illustrative filing test. Read type (also sent as X-Quantset-Event), livemode and data.object. A test has livemode=false and uses a synthetic filing object even when another event was selected.

```
{"id":"evt_test_example","type":"filing.created","api_version":"1.0","livemode":false,"created":1780315200,"data":{"object":{"instrument_id":"us:NVDA","accession_number":"0001045810-26-000000","form_type":"8-K","filing_date":"2026-06-01"}}}
```

Return a 2xx status after accepting the delivery. Inspect delivered and status_code in the test receipt. Treat repeated deliveries idempotently. A successful test confirms receiver connectivity and signing.

## Subscription event names

- `filing.created` — filing
- `earnings.created` — earnings disclosure
- `insider_trade.created` — insider transaction
- `activist_filing.created` — activist ownership filing
- `form144.created` — proposed sale notice
- `ipo_filing.created` — IPO filing

Registration accepts these names. Automatic delivery depends on a connected event producer. Only the explicit test delivery is verified in this workflow. Use the [filings endpoint](/docs/api/sec-filings) when you need to check for new filings.

## Manage a subscription

GET /api/v1/webhooks lists subscriptions for the account. DELETE /api/v1/webhooks/{webhook_id} removes the selected receiver. See [create a webhook](/docs/api/webhooks-post) and [test a webhook](/docs/api/webhooks-test-post) for the response schemas.

---

## QuantSet Ecosystem & Integrations (https://quantset.dev/integrations)

- **MCP Clients & 7 Skills:** `npx quantset init` & `npx skills add quantset/skills` (Claude, Claude Code, Cursor, ChatGPT, Codex, Hermes, OpenClaw, Block Goose, Cline, Docker MCP Toolkit — `https://api.quantset.dev/mcp`)
- **Python SDK & Agent Frameworks:** `pip install "quantset[pandas]"` · `from quantset.tools import build_agent_functions, langchain_tools, crewai_tools` (PydanticAI, LangGraph, LangChain, CrewAI, Agno, AutoGen, Google ADK, OpenAI Agents SDK)
- **TypeScript SDK & Vercel AI / Mastra:** `npm install quantset` · `import { createQuantsetTools } from "quantset/tools"` (Node 20+, Bun, Deno, Cloudflare Workers, Vercel Edge)
- **Spreadsheets & Workspaces:** Google Sheets (`=QUANTSET()` & `=IMPORTDATA()`), Microsoft Excel Power Query (`?format=csv`), Notion MCP & n8n/Make webhooks (`https://quantset.dev/docs/guides/google-sheets-excel-notion-stock-templates`)
- **Drop-In Migrations & Machine Payments:** FMP `/stable/*` & `/v3/*` adapter (`https://quantset.dev/docs/switch/fmp`), `yfinance` migration (`https://quantset.dev/docs/switch/yfinance`), autonomous signup (`https://api.quantset.dev/skill.md`), and `x402` Base USDC.
