POST https://api.prompt-wall.com/v1/events
This endpoint is observe-only — there is no enforcement, no
mutation, no upstream call. Use it when PromptWall did not run the LLM.
Request
Required headers
| Header | Value |
|---|---|
X-API-Key | Your PromptWall API key (pw_…) |
Content-Type | application/json |
Authorization: Bearer pw_… is also accepted.
Body — single event
Body — batch (up to 500 events)
Field reference
| Field | Required | Notes |
|---|---|---|
request_id | yes | 1–64 chars. Primary key. Re-submitting is idempotent. |
mode | no | ingest (default) · proxy · sdk · vendor |
started_at | no | ISO-8601 or epoch seconds. Defaults to “now”. |
finished_at | no | Used to compute latency when latency_ms is omitted. |
provider | no | openai · anthropic · azure · google · … |
model | no | Free-form. Useful for cost rollups. |
use_case, team_id, integration_id, end_user_id, session_id | no | Dashboard dimensions. |
prompt_tokens, completion_tokens, total_tokens | no | Tokens. total_tokens is computed if you only send the splits. |
cost_usd | no | Numeric. If omitted PromptWall doesn’t estimate. |
latency_ms | no | Integer ms. Computed from timestamps if omitted. |
status | no | ok · error · blocked · rewritten · regenerated |
final_decision | no | Outcome label for the trace. |
risk_score | no | 0.0 – 1.0. |
policy_hits | no | Array — what policies fired in your own pipeline. |
Response
Single event accepted
Batch with mixed outcomes
| Status | When |
|---|---|
| 200 | All events accepted (or all skipped as duplicates) |
| 207 | Mixed — some accepted, some rejected |
| 400 | Whole batch rejected (e.g. all events failed validation) |
| 401 | Missing / invalid PromptWall API key |
Idempotency
request_id is the primary key in the canonical traces table.
Submitting the same request_id twice never creates two rows — the
second call returns skipped: true. This makes batch retries safe.