Developer Documentation

Integrate Watchtower into your applications with our powerful API.

Quick Start

1. Get your API Key

Create a project in your dashboard and generate an API key. All keys are prefixed with wt_.

wt_1234567890abcdef1234567890abcdef

Authentication

Include your API key in the Authorization header:

curl https://api.watchtower.polysight.xyz/v1/events \
  -H "Authorization: Bearer wt_your_api_key"

API Endpoints

POST/v1/events

Send an event to Watchtower for processing.

{
  "level": "info",
  "message": "Market price updated",
  "context": {
    "market": "US Election 2024",
    "price": 0.52,
    "change": 0.03
  }
}
GET/v1/events

Retrieve events with optional filters.

?level=error&limit=100&since=2024-01-01T00:00:00Z
GET/v1/predictions

Get AI predictions for your markets.

{
  "predictions": [
    {
      "market": "US Election 2024",
      "confidence": 0.78,
      "direction": "bullish",
      "timeframe": "24h"
    }
  ]
}

Webhooks

Configure webhooks in your dashboard to receive real-time notifications when alerts are triggered.

POST https://your-app.com/webhooks/watchtower

{
  "event": "alert.triggered",
  "alert": {
    "id": "alert_123",
    "level": "error",
    "message": "Price dropped below threshold",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

Webhooks are signed with HMAC-SHA256. Verify the signature using the X-Watchtower-Signature header.

Rate Limits

Free Plan

60 requests/minute

Starter Plan

300 requests/minute

Pro Plan

1,000 requests/minute

Ultra Plan

5,000 requests/minute

SDKs & Libraries

JavaScript / TypeScript

Official SDK for Node.js and browsers

npm install @watchtower/sdk

Python

Official SDK for Python 3.8+

pip install watchtower-sdk

Need Help?

Our support team is here to help you integrate Watchtower.

Contact Support