Operator infrastructure

PMS today

PMS is a B2B infrastructure layer for prediction-market operators. This page is the honest reference for what the platform ships right now — not the aspirational SDK / WebSocket / webhook surface that earlier docs advertised.

Operator workflow

From first contact to a working workspace. There is no self-serve provisioning yet; every operator passes through a super_admin review.

  1. 1

    Apply

    Submit /operators/apply. Application lands in the super_admin review queue.

  2. 2

    Approval

    Reviewer mutates status. Every mutation lands in platform_audit_log with the actor, before/after diff, request id.

  3. 3

    Provisioning

    An auth.users invite from the Supabase dashboard fires the on_pms_auth_user_created trigger and creates your operators row (tier=trial, 14 days).

  4. 4

    Workspace

    Sign in at /auth/login. /dashboard is your isolated workspace, RLS-scoped, with markets, agent, API keys and settings.

  5. 5

    Build

    Draft markets in the AI Copilot or via the developer API keys you provisioned at /dashboard/api-keys.

API surface

Twelve endpoints. Every one is wired to live UI or smoke-tested probes. There is no PMS SDK, no WebSocket feed and no webhook delivery yet — when those land, they will appear here, not before.

Operations
GET/api/health

Liveness probe with per-downstream state (supabase, redis, anthropic).

GET/api/auth/callback

Supabase auth callback (PKCE + OTP token_hash).

Public intake
POST/api/operators/apply

Public form submission, validated and rate-limited; lands as an operator_applications row for the platform queue.

Operator workspace (auth + RLS)
PATCH/api/dashboard/settings

Update operator branding fields. RLS-scoped to your own row.

GET / POST / PATCH/api/developer/api-keys

Issue and revoke developer API keys for your workspace.

AI Copilot
POST/api/copilot/chat

Conversational draft assistant. Anthropic Claude when configured, rules-engine fallback otherwise.

GET/api/copilot/credits

Per-operator credit wallet balance.

POST/api/copilot/markets/deploy

Persist a Copilot-drafted market into your workspace.

GET / POST/api/copilot/agent/decisions

MarketAgent suggestion queue for the operator's markets.

POST/api/ai-copilot

Standalone scoring endpoint behind the homepage live demo.

POST/api/ai-copilot/feedback

Outcome feedback ingest for calibration.

GET/api/ai-copilot/metrics

Read-only Brier / hit-rate / ROI delta over the feedback window.

Authentication & integration

  • Sessions: Supabase Auth via @supabase/ssr. PKCE on sign-in, OTP token_hashon invites & magic links.
  • Tenancy: enforced at the database with Row Level Security. The application is a second line of defence, not the first.
  • Developer keys: issued from /dashboard/api-keys once your workspace is provisioned. No keys are issued before approval.
  • System health: /status renders /api/health live — supabase / redis / anthropic state, no hardcoded badges.

Operator access

Apply to build on PMS

PMS onboards operators by application. Once approved you receive a workspace, API keys and access to the AI Copilot.