Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt

Use this file to discover all available pages before exploring further.

Endpoints for the watchlist + alerts ecosystem. See Watchlist + alerts for the conceptual model.

Watched objects

EndpointPurpose
GET /api/watchList watched objects
POST /api/watchAdd (by ticker / URL / query / text)
POST /api/watch/identifyResolve free-text to a canonical watched object
GET /api/watch/{id}Detail
PATCH /api/watch/{id}Update
DELETE /api/watch/{id}Remove
POST /api/watch/{id}/refreshForce re-evaluation now

Alert rules

EndpointPurpose
GET /api/alert-rulesList rules
POST /api/alert-rulesCreate rule
GET /api/alert-rules/{id}Detail
PATCH /api/alert-rules/{id}Update (pause/archive included)
DELETE /api/alert-rules/{id}Delete
POST /api/alert-rules/{id}/testTest fire
Rule body:
{
  "watchedObjectId": "wo_...",
  "condition": "price_above",
  "threshold": 65,
  "windowSeconds": 3600,
  "channels": [{ "type": "webhook", "endpointId": "we_..." }],
  "status": "active"
}
Conditions: price_above, price_below, econ_release, gov_action, semantic_match.

Webhook endpoints

EndpointPurpose
GET /api/webhook-endpointsList endpoints
POST /api/webhook-endpointsCreate
GET /api/webhook-endpoints/{id}Detail
PATCH /api/webhook-endpoints/{id}Update
DELETE /api/webhook-endpoints/{id}Delete
POST /api/webhook-endpoints/{id}/testTest delivery
Body:
{ "url": "https://your.app/sf-hook", "label": "ops", "events": ["alert.fired"] }
Returns the endpoint id (we_...) and signing secret. Store the secret — it isn’t shown again.

Alert deliveries

EndpointPurpose
GET /api/alert-deliveriesList recent deliveries
Each delivery has id, ruleId, endpointId, status (pending, delivered, failed, paused), dedupeKey, attempts, lastResponseStatus, lastError.

Authentication

API key (sf_live_...) via Authorization: Bearer .... CLI sessions and Supabase JWT both work — see src/lib/workflow/auth.ts.

Resend webhook (Resend → SF receiver)

POST /api/webhook/resend
Internal endpoint that Resend calls back to update email delivery telemetry. Verifies signature with RESEND_WEBHOOK_SECRET.

Legacy

GET /api/watchlist
GET /api/alerts
Legacy endpoints. Migrated to /api/watch/* and /api/alert-rules/* per drizzle migration 0041_watch_alert_workflows.sql. New integrations should use the new paths.

See also

Watchlist + alerts

Conceptual model and CLI walkthrough.

Webhook receiver

Receiver code samples.

Webhook events

Per-event payload schemas.