Event API
Send a business fact from your system into PBCP.
Base URL: https://pbcp-api.pcampus.co
⚠️
Send events from your backend after the system confirms they happened. Do not embed an API key in the browser.
How to connect
POST https://pbcp-api.pcampus.co/events
Authorization: Bearer pip_YOUR_API_KEY
x-tenant-id: your-tenant-id
Content-Type: application/jsonSample request
{
"schemaVersion": "1.0",
"tenantId": "your-tenant-id",
"eventId": "550e8400-e29b-41d4-a716-446655440000",
"eventName": "order.created",
"occurredAt": "2026-07-15T10:00:00.000Z",
"actor": { "type": "user", "id": "user-001" },
"source": { "system": "your-app", "channel": "web" },
"payload": { "orderId": "ORD-1001" }
}Required in this example: schemaVersion, tenantId (must match the header), unique eventId, eventName, occurredAt, actor, source, payload
Sample response
{
"eventId": "550e8400-e29b-41d4-a716-446655440000",
"status": "accepted"
}| Status | When |
|---|---|
201 | Event accepted |
400 | Missing or invalid fields |
401 | Invalid token |
409 | This eventId was already sent |
More sample names: Example events