For the complete documentation index, see llms.txt. This page is also available as Markdown.

Audit

Search Events

get

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.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Query parameters
event_typestring · nullableOptional
event_classstring · nullableOptional
user_idstring · nullableOptional
execution_idstring · nullableOptional
resultstring · nullableOptional
startinteger · nullableOptional
endinteger · nullableOptional
orgstring · nullableOptional
limitinteger · max: 500OptionalDefault: 50
cursorstring · nullableOptional
Responses
200

Successful Response

application/json
anyOptional
get/api/v1/audit/events
GET /api/v1/audit/events HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Get Event

get

Retrieve a single audit event by id (proxied), org-scoped.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
event_idstringRequired
Responses
200

Successful Response

application/json
anyOptional
get/api/v1/audit/events/{event_id}
GET /api/v1/audit/events/{event_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Export Events

get

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.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Query parameters
fmtstringOptionalDefault: csvPattern: ^(csv|json|ndjson)$
event_typestring · nullableOptional
startinteger · nullableOptional
endinteger · nullableOptional
orgstring · nullableOptional
Responses
200

Successful Response

application/json
anyOptional
get/api/v1/audit/export
GET /api/v1/audit/export HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Recall Prompt

get

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).

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
execution_idstringRequired
Responses
200

Successful Response

application/json
anyOptional
get/api/v1/audit/prompt/{execution_id}
GET /api/v1/audit/prompt/{execution_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

List Export Jobs

get

Download History — the caller's own export jobs, newest first.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Responses
200

Successful Response

application/json
anyOptional
get/api/v1/audit/export/jobs
GET /api/v1/audit/export/jobs HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful Response

No content

Create Export Job

post

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.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Body
fmtstringOptionalDefault: csv
event_typestring · nullableOptional
startinteger · nullableOptional
endinteger · nullableOptional
Responses
200

Successful Response

application/json
anyOptional
post/api/v1/audit/export/jobs
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

Get Export Job

get

Poll a single export job's status/metadata.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idintegerRequired
Responses
200

Successful Response

application/json
anyOptional
get/api/v1/audit/export/jobs/{job_id}
GET /api/v1/audit/export/jobs/{job_id} HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Download Export Job

get

Download a completed export artifact. 409 while it's still building, 404 if the artifact is missing/expired.

Authorizations
AuthorizationstringRequired

Enter your JWT token (without 'Bearer ' prefix)

Path parameters
job_idintegerRequired
Responses
200

Successful Response

application/json
anyOptional
get/api/v1/audit/export/jobs/{job_id}/download
GET /api/v1/audit/export/jobs/{job_id}/download HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated