Skip to Content

Public APIs

The public gateway is a separate FastAPI app (app.public_api.main:app) on port 8004. It validates a public credential, forwards the caller’s JWT to private Workbench :8001/api/v1, and writes audit events. It never uses a shared operator token for interactive user requests.

PUBLIC_API_INTERNAL_SERVICE_TOKEN is an optional server-only fallback for automated jobs, not for people.

Local OpenAPI: http://localhost:8004/docs (disable with PUBLIC_API_DOCS_ENABLED=false). Prefix default: /public/v1.

Administration → API Keys → Public API Access → Public APIs is generated from the same catalog as this page (admin_public_api_catalog). Badges follow the scopes on the selected credential.

Auth

GET http://localhost:8004/public/v1/health X-API-Key: ewb_public_… Authorization: Bearer <workbench-jwt>
  • Public API key — which gateway routes are allowed
  • User JWT — that user’s Workbench roles on the private backend

Login (no public key):

curl -s -X POST http://localhost:8004/public/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"email":"you@example.com","password":"your-password"}'

Then:

import os import requests BASE = "http://localhost:8004/public/v1" headers = { "X-API-Key": os.environ["EWB_PUBLIC_API_KEY"], "Authorization": f"Bearer {os.environ['EWB_USER_JWT']}", } projects = requests.get(f"{BASE}/entities/projects", headers=headers, params={"limit": 20}) print(projects.json())

Health and login do not require a public key. Every other /public/v1 route does.

Grantable scopes

ScopeUnlocks
entities:read / entities:writeEntity collections and campaign reads/writes
catalogs:read / catalogs:writeContact Sets. Public catalog routes listed below are GET; writes go through private contacts or MCP call_endpoint
contacts:read / contacts:writeContact Set records
frames:readReserved on credentials (not a CORE catalog group yet)
predictions:runBatch scoring, Spend Personality runtime score, /v1/models
jobs:readAsync job status, campaign runs
runtime:evidence:readReserved on credentials (not a CORE catalog group yet)
networks:jobs / networks:read / networks:analyzeGraph jobs and analysis
spend-personality:configs / spend-personality:runsSpend Personality configs, pipeline, drift
money-personality:runsMoney Personality process
sentimental-equilibrium:runsSentimental equilibrium process
two-tower:configs / two-tower:trainTwo-Tower configs, train, export, batch-score
ontology:read / ontology:writeOntology documents and mappings

Grant the minimum set. Polling async work also needs jobs:read.


Auth & health

MethodPathScopePurpose
POST/public/v1/auth/loginnoneEmail/password → JWT
GET/public/v1/healthnoneGateway health

Contact catalogs

Contact Sets (not entity collections).

MethodPathScopePurpose
GET/public/v1/catalogscatalogs:readList Contact Sets
GET/public/v1/catalogs/{catalog_id}catalogs:readRead one Contact Set
GET/public/v1/catalogs/{catalog_id}/recordscontacts:readList records

Jobs & predictions

MethodPathScopePurpose
GET/public/v1/jobs/{job_id}jobs:readAsync job status
POST/public/v1/batch-scoring/jobspredictions:runStart backend batch-scoring
GET/public/v1/batch-scoring/jobs/{job_id}jobs:readBatch-scoring progress
POST/public/v1/predictions/runpredictions:runSpend Personality runtime scoring

POST /predictions/run scores through a Runtime deployment. Closed-loop learning still uses Runtime POST /response with that row’s uuid and offer_name.

Networks

Same contract as Networks Jobs & API. Responses never include the full analysis graph — only a display sample, stats, and metrics summary.

MethodPathScope
POST/public/v1/networks/jobsnetworks:jobs
GET/public/v1/networks/jobs/{job_id}networks:read
GET/public/v1/networks/jobs/{job_id}/eventsnetworks:read
GET/public/v1/networks/jobs/{job_id}/resultnetworks:read
DELETE/public/v1/networks/jobs/{job_id}networks:jobs
GET/public/v1/networks/graphs/{graph_id}/displaynetworks:read
GET/public/v1/networks/graphs/{graph_id}/metricsnetworks:read
POST/public/v1/networks/graphs/{graph_id}/analyzenetworks:analyze
POST/public/v1/networks/graphs/{graph_id}/temporal/{category}networks:analyze

Spend Personality

Needs spend-personality:configs, spend-personality:runs, and jobs:read (plus predictions:run for optional score proof). POST /runs is fire-and-forget — poll GET /public/v1/jobs/{job_id} until lifecycle_state is Completed. Keep polling Queued / Running / Stalled. Treat Failed / Cancelled as errors.

MethodPathScopePurpose
GET / POST/public/v1/spend-personality/configsspend-personality:configsList or upsert algorithm config
GET/public/v1/spend-personality/configs/{config_id}spend-personality:configsRead config and run_log
POST/public/v1/spend-personality/runsspend-personality:runsPhased or full pipeline
POST/public/v1/spend-personality/driftspend-personality:runsRecompute personality drift

POST /runs fields: algorithm_config_id (required), optional phases (import_check, enrich, score_unscored, prepare_model, deploy), running_config_id from the first response so later phases share leader model ids, plus project_id / week_start_day.

Money Personality

MethodPathScopePurpose
POST/public/v1/money-personality/processmoney-personality:runsStart scoring; poll jobs

Sentimental Equilibrium

MethodPathScopePurpose
POST/public/v1/sentimental-equilibrium/processsentimental-equilibrium:runsStart analysis from prediction logs; poll jobs

Two-Tower

MethodPathScopePurpose
GET / POST/public/v1/two-tower/configstwo-tower:configsList or upsert
GET / PUT/public/v1/two-tower/configs/{config_id}two-tower:configsRead / update
GET/public/v1/two-tower/predictorstwo-tower:configsDistinct predictors in flatten
GET/public/v1/two-tower/predictor-date-boundstwo-tower:configsDate range and row count
GET/public/v1/two-tower/runstwo-tower:configsRecent training runs
POST/public/v1/two-tower/preview-schematwo-tower:configsPreview flatten schema (async)
POST/public/v1/two-tower/prepare-feature-frametwo-tower:trainH2O frame without training
POST/public/v1/two-tower/traintwo-tower:trainStart training
POST/public/v1/two-tower/concept-testtwo-tower:trainSync concept rank for one customer
POST/public/v1/two-tower/export-embeddingstwo-tower:trainExport user/item embeddings
POST/public/v1/two-tower/batch-scoretwo-tower:trainTop-K offers to a collection
POST/public/v1/two-tower/generate-pythontwo-tower:trainRunnable Python + explanation

Ontology

Updates use POST, not PUT/PATCH. Same contract as private /api/v1/ontology/*.

MethodPathScope
GET/public/v1/ontologyontology:read
GET / POST / DELETE/public/v1/ontology/{ontology_id}read / write / write
POST/public/v1/ontology/from-data-sourceontology:write
GET / POST/public/v1/ontology/{ontology_id}/mappingsread / write
POST/public/v1/ontology/{ontology_id}/mappings/suggest-multiontology:write
POST/public/v1/ontology/{ontology_id}/mappings/{mapping_id}ontology:write
POST/public/v1/ontology/{ontology_id}/resolve-termontology:read
POST/public/v1/ontology/{ontology_id}/resolve-questionontology:read

Campaigns

Campaign delivery channels (email, WhatsApp, SMS, …) are not Runtime scoring channel (app / web / api).

MethodPathScopePurpose
GET/public/v1/campaignsentities:readList campaigns
GET/public/v1/campaigns/channel-catalogentities:readPlatform delivery channel catalog
GET/public/v1/campaigns/{campaign_id}entities:readRead one
GET/public/v1/campaigns/{campaign_id}/channelsentities:readOptions, selection, send_track
PUT/public/v1/campaigns/{campaign_id}/channel-selectionentities:writeSet option ids
POST/public/v1/campaigns/{campaign_id}/triggerentities:writeTrigger a run
POST/public/v1/campaigns/{campaign_id}/apply-paramsentities:writeParameter overrides
GET / PUT/public/v1/campaigns/{campaign_id}/schedulesread / writeEmbedded schedules
POST/public/v1/campaigns/{campaign_id}/schedules/syncentities:writeSave and arm crons
POST/public/v1/campaigns/{campaign_id}/schedules/generateentities:readNatural-language draft (no write)
POST/public/v1/campaigns/{campaign_id}/scheduleentities:writeRegister one cron
DELETE/public/v1/campaigns/{campaign_id}/schedules/{schedule_id}entities:writeUnregister one
DELETE/public/v1/campaigns/{campaign_id}/scheduleentities:writeUnregister one (schedule_id) or all
GET/public/v1/campaigns/{campaign_id}/runsjobs:readList runs
GET/public/v1/campaigns/runs/{run_id}jobs:readRead run
GET/public/v1/campaigns/runs/{run_id}/progressjobs:readProgress
POST/public/v1/campaigns/runs/{run_id}/stopentities:writeStop run

Analytics dashboards

Workbench analytics dashboards (not Data Agents report jobs).

MethodPathScopePurpose
GET/public/v1/analytics/dashboardsentities:readList
GET/public/v1/analytics/dashboards/{dashboard_id}entities:readRead
GET / POST/public/v1/analytics/dashboards/{dashboard_id}/shareread / writeShare metadata

Account & models

MethodPathScopePurpose
GET/public/v1/me/apisnone (key identifies credential)Endpoints this credential can reach
GET/v1/models (also /models)predictions:runOpenAI-compatible model list

Entity collections

CRUD at /public/v1/entities/{collection}. List names: GET /public/v1/entities/collections.

ActionMethodPathScope
ListGET/public/v1/entities/{collection}entities:read
ReadGET/public/v1/entities/{collection}/{entity_id}entities:read
CreatePOST/public/v1/entities/{collection}entities:write
UpdatePUT/public/v1/entities/{collection}/{entity_id}entities:write
DeleteDELETE/public/v1/entities/{collection}/{entity_id}entities:write

List query params: skip, limit, q, fields.

Public collections include: projects, agent configs / nodes / channels, custom channel modules, calendar, fact injection (chat_config), dashboards, data wizards, dynamic engagement, enrichment configs and pipelines, frames, predictions, data connections, offer matrix (+ history), prompt library, responder analytics and API config, simulation, networks, campaigns.

Settings (operators)

SettingDefaultRole
PUBLIC_API_PREFIX/public/v1Path prefix
PUBLIC_API_CORS_ORIGINSCORS
PUBLIC_API_SECRET_PEPPERHash secrets and IPs
PUBLIC_API_INTERNAL_BASE_URLhttp://localhost:8001/api/v1Private proxy target
PUBLIC_API_INTERNAL_SERVICE_TOKENJob fallback only
PUBLIC_API_AUDIT_TTL_DAYS0 = keepAudit TTL

Related: Private APIs, API Keys, MCP.

Last updated on