# operator-ops

Operator console: review queues (customers, payments, recipients, incoming), journal and manual postings, reconciliation, reports, dashboards, staff, impersonation and audit log.

## GET /audit-events

operationId: `listAuditEvents`
Summary: Audit log search
API key scopes: `audit:read`
Callable by: customer and operator keys
Parameters: `X-Tenant-Id` (header, required), `X-Request-Id` (header), `X-Access-Reason` (header), `cursor` (query), `limit` (query), `sort` (query), `filter` (query), `q` (query)
Responses: 200 `AuditEventPage`, 400 `Problem`, 401 `Problem`, 403 `Problem`, 429 `Problem`, default `Problem`

Operator staff: all events in the operator. Customer owners/admins: events for their own users only (FR-REP-03).

**Free-text search (scalability audit X-33):** with `q`, the search runs over a date window of at most 92 days: `filter[from]` / `filter[to]` bound it; when neither is sent the window is the last 30 days, when only one is sent the other end is 30 days from it, and a wider window returns `400 bad-request` (`errors[].field` `query.filter[from]`). Filters without `q` are not bounded.

**API key scopes:** `audit:read` (customer-level keys (`X-Tenant-Id` = the key's customer) and operator-level keys (`X-Tenant-Id` = the operator id), each with a scope of its own level).

## GET /audit-events/{auditEventId}

operationId: `getAuditEvent`
Summary: Get audit event
API key scopes: `audit:read`
Callable by: customer and operator keys
Parameters: `auditEventId` (path, required), `X-Tenant-Id` (header, required), `X-Request-Id` (header), `X-Access-Reason` (header)
Responses: 200 `AuditEvent`, 401 `Problem`, 403 `Problem`, 404 `Problem`, 429 `Problem`, default `Problem`

**API key scopes:** `audit:read` (customer-level keys (`X-Tenant-Id` = the key's customer) and operator-level keys (`X-Tenant-Id` = the operator id), each with a scope of its own level).

## POST /audit-events/exports

operationId: `exportAuditEvents`
Summary: Export audit events (CSV)
API key scopes: `audit:read`
Callable by: customer and operator keys
Parameters: `X-Tenant-Id` (header, required), `X-Request-Id` (header)
Request body: `AuditExportRequest`
Responses: 202 `Job`, 400 `Problem`, 401 `Problem`, 403 `Problem`, 409 `Problem`, 422 `Problem`, 429 `Problem`, default `Problem`

CSV of the caller's scope (operator, or the customer's own events) with the chain sequence and hash of sealed events; up to 50 000 rows; 90-day retention; audited `audit.exported`.

**API key scopes:** `audit:read` (customer-level keys (`X-Tenant-Id` = the key's customer) and operator-level keys (`X-Tenant-Id` = the operator id), each with a scope of its own level).
