Overview
The hooks ingest endpoint receives telemetry events from the Promptster CLI and MCP server. This is the primary path through which session data enters Promptster. The CLI handles this automatically when a candidate runspromptster start — you only need to call this endpoint directly if you are building a custom integration.
Each call to POST /v1/hooks/ingest delivers a single event. The server normalizes the event kind, upserts the session, appends the event to the timeline, and enqueues background analytics jobs.
Ingest an event
POST /v1/hooks/ingest
Authentication: X-API-Key header with a valid candidate key (PST-XXXX-XXXX).
Rate limit: 100 requests per minute per API key.
Sessions are created automatically on first event ingest. You do not need to create a session before sending events.
Event envelope
Stable event ID. Re-posting an event with the same
id is safe — the duplicate is silently ignored (idempotent).The session this event belongs to. Sessions are created on-demand the first time a new
sessionId is seen.Event timestamp, including timezone offset (e.g.
2026-04-01T10:15:00Z).Event type. See canonical kinds below.
Metadata about where the event originated.
The actor that triggered the event.
Attribution metadata for this event.
Schema version. Use
1.Event-specific payload. Schema requirements vary by
kind — see the table below.Responses
201— Event accepted. Returns{ ok: true, id: "<event-id>" }.200— Event was a duplicate (sameidwas already processed). Returns{ ok: true, skipped: true }.400— Invalid event envelope or strict schema validation failed for the eventkind.401— Missing or invalidX-API-Key.429— Rate limit exceeded (100 req/min per key).
Canonical event kinds
Every event you send must have akind from this list. The data payload requirements differ by kind.
| Kind | Required data fields | Notes |
|---|---|---|
prompt | text, tokenCount | AI prompt sent by the candidate |
ai_response | — | Response from the AI tool |
file_diff | path | diff, linesAdded, linesRemoved are optional but recommended |
file_create | path | content, linesAdded, sizeBytes are optional |
file_delete | — | |
command | command | exitCode, durationMs, stdout, stderr optional |
test_run | — | suite, passed, failed, skipped, durationMs optional |
build_run | — | |
git_action | action | ref, message, commit optional |
decision_event | — | title, chosenOption, context, tradeoffs, rationale, impactScore are indexed by the reviewer dashboard |
session_start | — | cwd and assessmentId in data are auto-promoted into session metadata |
session_end | — | Triggers session finalization and scoring pipeline |
checkpoint | — | label, trigger, summary optional |
tool_use | — | |
tool_result | — | tool_call is accepted as a legacy alias and normalized to tool_result |
planning | — | |
mcp_call | — |
decision_event, the following data fields are indexed in the decisions table and surfaced in the reviewer dashboard:
| Field | Type | Description |
|---|---|---|
title | string | Short description of the decision |
chosenOption | string | The option the candidate selected |
context | string | Background and constraints |
tradeoffs | string | Alternatives considered |
rationale | string | Reasoning for the chosen option |
impactScore | integer (1–5) | Estimated impact of the decision |