{"openapi":"3.1.0","info":{"title":"Papertrade Alerts API","version":"0.2.0","description":"Unofficial, not affiliated with Papertrade. Manage alert subscriptions with a one-time management token (Authorization: Bearer ptal_...).","license":{"name":"Apache-2.0","identifier":"Apache-2.0"}},"servers":[{"url":"https://papertrade-alerts.ninabrekkerese.workers.dev"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"paths":{"/healthz":{"get":{"summary":"Liveness and D1 check. 503 with database=not_ready until the schema is applied.","responses":{"200":{"description":"OK"},"503":{"description":"Storage not ready"}}}},"/api/status":{"get":{"summary":"Channel availability, limits and last cron tick","responses":{"200":{"description":"OK"}}}},"/api/accounts":{"post":{"summary":"Create an account. Returns the management token once.","responses":{"201":{"description":"Created"}}}},"/api/me":{"get":{"summary":"Account, watches, channels, protocol rules","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}},"delete":{"summary":"Delete the account and everything under it","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/watches":{"post":{"summary":"Watch a wallet with per-type rules","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Created"}}}},"/api/watches/{id}":{"patch":{"summary":"Update rules (full object or shorthand like liq=3)","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}},"delete":{"summary":"Stop watching","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/channels":{"post":{"summary":"Add a discord or webhook channel. Webhook secret is returned once.","security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Created"}}}},"/api/channels/{id}":{"patch":{"summary":"Pause or resume","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}},"delete":{"summary":"Remove channel","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/channels/{id}/test":{"post":{"summary":"Send a real test message and report the result","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/telegram/link":{"post":{"summary":"Mint a 15 minute code to link a Telegram chat via /start <code>","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/telegram/webhook":{"post":{"summary":"Telegram Bot API webhook (X-Telegram-Bot-Api-Secret-Token required)","responses":{"200":{"description":"OK"}}}},"/api/protocol-rules":{"put":{"summary":"Set mint-rate, market status and followed-wallet alerts","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/alerts":{"get":{"summary":"Recent alerts with per-channel delivery status","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/deliveries/dead":{"get":{"summary":"Dead-letter deliveries","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/api/deliveries/{id}/retry":{"post":{"summary":"Re-queue a dead delivery","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"}}}},"/mcp":{"post":{"summary":"Model Context Protocol server (Streamable HTTP, stateless JSON-RPC 2.0). See /docs/mcp.","description":"Methods: initialize, ping, tools/list, tools/call. Tools preview wallets and manage alert rules and destinations. Nothing signs, sends funds or places orders. Rate limited per client.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer"]},"method":{"type":"string"},"params":{"type":"object"}}}}}},"responses":{"200":{"description":"JSON-RPC response (application/json, or one SSE message event when only text/event-stream is accepted)"},"202":{"description":"Notification accepted"},"429":{"description":"Rate limited"},"503":{"description":"Storage not ready"}}},"get":{"summary":"Server description and links (JSON). With Accept: text/event-stream returns 405.","responses":{"200":{"description":"OK"}}}},"/.well-known/mcp/server-card.json":{"get":{"summary":"MCP server card (SEP-1649 shape) generated from the live tool registry","responses":{"200":{"description":"OK"}}}},"/.well-known/agent-card.json":{"get":{"summary":"A2A agent card, skills mapped from the MCP tools","responses":{"200":{"description":"OK"}}}},"/.well-known/api-catalog":{"get":{"summary":"RFC 9727 API catalog (application/linkset+json)","responses":{"200":{"description":"OK"}}}},"/api/papertrade/{path}":{"get":{"summary":"Read-only same-origin proxy for the Papertrade API","responses":{"200":{"description":"OK"}}}}}}