API & PLANS REFERENCE

HTTP API, RBAC & Plans Reference

Technical reference for Owlly’s session and Bearer authentication, workspace RBAC, MCP token & access log endpoints, atomic observation ledger, and grounded AI search providers.

Authentication: Cookies vs MCP Bearer Tokens

Browser/REST routes and the MCP endpoint use distinct authentication mechanisms with strict origin and workspace isolation.

SurfaceMechanismRules & Headers
Browser & REST API (/api/*)owlly_session HttpOnly cookie (24h) or Google OAuthSameSite=Strict, Secure on HTTPS. Pass X-Workspace-ID: <id> when belonging to multiple workspaces. Mutating requests enforce Origin and Sec-Fetch-Site checks.
MCP Server (POST /api/mcp)Authorization: Bearer owlly_sk_...Does not accept cookies or X-Workspace-ID; workspace and optional Project Access Scope derive strictly from the token. Supports CORS OPTIONS preflight.

Workspace RBAC Matrix

All workspace operations require a verified account email and enforce server-side role permissions:

Capabilityowneradmineditorviewer
Read reports, opportunities, citations, and exportsYesYesYesYes
Manage projects, prompts, drafts, tasks, and brand factsYesYesYesNo
Trigger manual or project-wide prompt collectionYesYesYesNo
Manage MCP tokens (/api/workspace/tokens) & view MCP logsYesYesNoNo
Invite members (admin invites require owner) & rename workspaceYesYesNoNo
Billing checkout/portal, refunds, transfer ownership, delete workspaceYesNoNoNo

Token Management & MCP Access Log Endpoints

Workspace owners and admins manage MCP tokens and audit logs via the following endpoints:

Method & PathRoleBehavior
GET /api/workspace/tokensowner / adminReturns mcp_endpoint, plan, allowed_scopes, and active token metadata (prefix, effective scopes, project scope, paused state, last used).
POST /api/workspace/tokensowner / adminAccepts {name, scopes, project_ids?, expires_in_days} and returns 201 {token, secret} once. Rate-limited to 20/hour; max 25 active tokens.
PATCH /api/workspace/tokens/{id}owner / adminPauses/resumes a token or updates its name and Project Access Scope.
DELETE /api/workspace/tokens/{id}owner / adminImmediately revokes the token and returns {"ok": true}.
GET /api/workspace/mcp-logsowner / adminReturns workspace MCP Access Logs (timestamp, token prefix, tool name, outcome status) for auditability.

Core REST API Endpoints Summary

Full JSON payloads and concurrency contracts are documented in docs/api.md. Key endpoint groups include:

DomainPrimary Endpoints
Projects & BrandsGET/POST /api/projects, PATCH/DELETE /api/projects/{project}
Prompts & CSV ImportGET/POST /api/projects/{project}/prompts, POST /api/projects/{project}/prompts/import (up to 250 rows)
Collection & RunsPOST /api/prompts/{prompt}/run, POST /api/projects/{project}/run, GET /api/projects/{project}/runs, GET /api/runs/{run}
Reports & OpportunitiesGET /api/projects/{project}/report, /opportunities, /export.csv, /export.json, /opportunities/export.*
Content Pages & DraftsGET/POST /api/projects/{project}/content-pages, PATCH .../content-pages/{page}, POST .../assessments, GET .../comparison
Optimization & OutcomesGET/POST /api/projects/{project}/optimization-tasks, POST .../publication, POST .../followup, GET .../optimization-report
Brand Facts & AlertsGET/POST /api/projects/{project}/brand-facts, DELETE .../brand-facts/{fact}, GET/PUT .../alert-rule, GET .../alerts

Plan Quotas & Atomic usage_ledger

One observation equals one newly queued prompt-provider request. Active duplicate jobs do not consume quota, while failed or interrupted requests retain their reservation because upstream API charges may occur (demo fixtures are excluded).

Reservations are recorded atomically in PostgreSQL usage_ledger and persist across project deletions. There are no automatic overage charges; reaching a cap blocks new collection while preserving read and export access.

PlanMonthly Price (ex-tax)ProjectsPromptsSeatsObservations / Period
Trial (14 days)¥01101100 total (14 days)
Starter¥9,80035031,000 / billing period
Growth¥29,80010250105,000 / billing period
Agency¥79,800501,0003020,000 / billing period
Self-hosted—Unlimited (-1)Unlimited (-1)Unlimited (-1)Unlimited (-1)

AI Search Providers & Grounding Contract

Search-enabled runs (search: true) must receive verifiable evidence of completed native web search (source="api_grounded"); Owlly never silently falls back to ungrounded model output or across providers.

Provider IDDefault / Recommended ModelTransport & GroundingAvailability
openaiOPENAI_MODEL (default gpt-6.1-sol / lightweight SaaS slug)Responses API with web_search tool (user_location.country)Primary (SaaS default)
claudeCLAUDE_MODEL (default claude-opus-5-5 / Sonnet or Haiku)Messages API with web_search_20250305 (max_uses: 2)Primary (SaaS default)
geminiGEMINI_MODEL (default gemini-3.8-flash)Interactions API with google_search (sandboxed search suggestions)Primary (SaaS default)
perplexityPERPLEXITY_MODEL (default perplexity/sonar)Agent API (/v1/responses) with web_search_options (search_context_size: medium)Primary (SaaS default)
deepseekDEEPSEEK_MODEL (default deepseek-v4-pro)Responses API native search (requires deepseek-v4-pro)Optional (optional: true)
braveBRAVE_MODEL (default brave-web-grounding)Web Search API GET /web/search (country=JP, search_lang=jp)Optional & Quick Check fallback
chatgptCHATGPT_MODEL (default gpt-6.1-sol)ChatGPT plan OAuth (siwc-login)Self-hosted only