API Reference
PBCP
Overview

PBCP API Reference

Base URL: https://pbcp-api.pcampus.co
Local dev: http://localhost:9999

APIs

APIPathPurpose
Event API/eventsIngest business events into the platform
Context API/v1/context/*Read aggregated business context per entity
Story API/v1/story/*Compose and resolve business stories
Intelligence API/v1/intelligence/* /v1/recommendations/*Insights, funnel analysis, recommendations
Business Pulse/metrics/business-pulseToday's business summary (Pulse dashboard)

Authentication

Bootstrap (Phase 1): tenant scoping via header only — no token required.

x-tenant-id: pharmacy-demo

Production auth (API keys + RBAC) is deferred to a later goal.

Common headers

HeaderRequiredDescription
x-tenant-idYes (all endpoints)Tenant identifier
Content-TypeYes (POST)application/json

Error format

All errors return:

{
  "code": "ERROR_CODE",
  "message": "Human-readable description",
  "details": [{ "path": "fieldName", "message": "..." }]
}
HTTPCodeWhen
400VALIDATION_ERRORMissing fields or bad format
400SCHEMA_VERSION_UNSUPPORTEDUnknown event schema version
404NOT_FOUNDNo context/story for this entity
409DUPLICATE_EVENTSame (tenantId, eventId) already stored
500INTERNALUnexpected server error

Health check

GET /health
{ "status": "ok", "service": "pbcp-api" }

PBCP API Reference

Base URL: https://pbcp-api.pcampus.co
Local dev: http://localhost:9999

APIs

APIPathPurpose
Event API/eventsIngest business events into the platform
Context API/v1/context/*Read aggregated business context per entity
Story API/v1/story/*Compose and resolve business stories
Intelligence API/v1/intelligence/* /v1/recommendations/*Insights, funnel analysis, recommendations
Business Pulse/metrics/business-pulseToday's business summary (Pulse dashboard)

Authentication

Bootstrap (Phase 1): tenant scoping via header only — no token required.

x-tenant-id: pharmacy-demo

Production auth (API keys + RBAC) is deferred to a later goal.

Common headers

HeaderRequiredDescription
x-tenant-idYes (all endpoints)Tenant identifier
Content-TypeYes (POST)application/json

Error format

All errors return:

{
  "code": "ERROR_CODE",
  "message": "Human-readable description",
  "details": [{ "path": "fieldName", "message": "..." }]
}
HTTPCodeWhen
400VALIDATION_ERRORMissing fields or bad format
400SCHEMA_VERSION_UNSUPPORTEDUnknown event schema version
404NOT_FOUNDNo context/story for this entity
409DUPLICATE_EVENTSame (tenantId, eventId) already stored
500INTERNALUnexpected server error

Health check

GET /health
{ "status": "ok", "service": "pbcp-api" }