Audit
Search audit events (proxied to ones-audit-service).
start/end are epoch milliseconds → ONES from/to. When omitted the window defaults to all-time (so older and runtime events aren't hidden by the ONES 24h default). limit → ONES size.
Org filtering is optional (?org=<id>). Audit read is a privileged super-admin capability that may span organizations by design (per PRD), so results are not auto-scoped to the caller's org; passing org narrows them to that organization. The id is validated to exist — a non-existent org is a 404, not a silent empty 200 (NCP-3912). Platform/runtime events (agent/llm/ tool) that carry no org_id remain visible regardless of the filter.
execution_id has no server-side filter on ones-audit-service today (its /events search has no correlationId predicate), so it's applied as a best-effort post-filter over the fetched page here — it narrows the current page's results rather than the underlying query, so a small limit may undercount matches. Proper support requires adding a correlationId filter to ones-audit-service itself.
Enter your JWT token (without 'Bearer ' prefix)
50Successful Response
Validation Error
GET /api/v1/audit/events HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Retrieve a single audit event by id (proxied), org-scoped.
Enter your JWT token (without 'Bearer ' prefix)
Successful Response
Validation Error
GET /api/v1/audit/events/{event_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Export the filtered audit set (proxied). Emits an export.audit_log event.
start/end are epoch milliseconds and map to the ONES from/to params, which are required on the export endpoint — if omitted we default to the last 7 days.
Org scoping (NCP-3911): pass ?org=<id> to export only that organization's events (forwarded to ones-audit-service as orgId). The current admin role is a global super-admin, so an unscoped export returns all organizations; the org filter lets it be narrowed to (and downloaded per) a single org. A non-existent org id is rejected (404) rather than silently exporting nothing (NCP-3912). The org used is recorded on the export.audit_log audit-of-audit event below, so a cross-org (all-org) export is itself traceable.
Enter your JWT token (without 'Bearer ' prefix)
csvPattern: ^(csv|json|ndjson)$Successful Response
Validation Error
GET /api/v1/audit/export HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Recall raw prompt/response text for an execution from the LOCAL store.
Served entirely by ncp-api (raw text never lives in ONES). Every recall is itself audited as export.prompt.recalled (Must-11).
Enter your JWT token (without 'Bearer ' prefix)
Successful Response
Validation Error
GET /api/v1/audit/prompt/{execution_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Download History — the caller's own export jobs, newest first.
Enter your JWT token (without 'Bearer ' prefix)
Successful Response
GET /api/v1/audit/export/jobs HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Successful Response
No content
Queue an async audit export. Returns the pending job; poll it via GET /audit/export/jobs/{id} and download when status == completed.
Emits an export.audit_log event (audit-of-audit) recording the request.
Enter your JWT token (without 'Bearer ' prefix)
csvSuccessful Response
Validation Error
POST /api/v1/audit/export/jobs HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 51
{
"fmt": "csv",
"event_type": "text",
"start": 1,
"end": 1
}No content
Poll a single export job's status/metadata.
Enter your JWT token (without 'Bearer ' prefix)
Successful Response
Validation Error
GET /api/v1/audit/export/jobs/{job_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Download a completed export artifact. 409 while it's still building, 404 if the artifact is missing/expired.
Enter your JWT token (without 'Bearer ' prefix)
Successful Response
Validation Error
GET /api/v1/audit/export/jobs/{job_id}/download HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated
