Sources verified against the orchestrator: audit.controller.ts, audit.service.ts, dto/query-audit-logs.dto.ts, audit.types.ts, and redaction.service.ts.
Reference for GET /audit/logs — query the marketplace audit trail with filters and cursor pagination. Requires the support scope.
The audit trail records every mutation performed through the OFFER-HUB Orchestrator — including dispute assignments (DISPUTE_ASSIGNED) and resolutions (DISPUTE_RESOLVED) — so marketplaces can demonstrate compliance and trace any state change back to its actor. Entries are written asynchronously by AuditService (apps/api/src/modules/audit-logs/audit.service.ts) and stored in the AuditLog Prisma model (packages/database/prisma/schema.prisma, audit_logs table).
Sources verified against the orchestrator: audit.controller.ts, audit.service.ts, dto/query-audit-logs.dto.ts, audit.types.ts, and redaction.service.ts.
GET /api/v1/audit/logs is guarded by ApiKeyGuard + ScopeGuard with @Scopes('support') (see audit.controller.ts). Your API key must therefore include the support scope.
Keys without the support scope are rejected with 403 INSUFFICIENT_SCOPE (ForbiddenException — message Insufficient scope) by the ScopeGuard.
The marketplace is resolved server-side from the API key (req.apiKey.id → marketplaceId), so you only ever see your own marketplace's entries — there is no marketplaceId query parameter.
GET /api/v1/audit/logs
Returns audit entries for your marketplace, ordered by occurredAt descending, then id descending (stable tie-breaker for cursor pagination). Results are cursor-paginated; the controller fetches limit + 1 rows to compute hasMore.
Query parameters — QueryAuditLogsDto (apps/api/src/modules/audit-logs/dto/query-audit-logs.dto.ts)
Response — 200 OK
The response is returned directly by the controller (not wrapped in the success envelope — the global response interceptor detects data + pagination and passes it through):
Row fields
Fields stored on the model but not returned by the endpoint — marketplaceId, userId, error, idempotencyKey, ip, userAgent — remain internal (see the select projection in audit.service.ts).
Payload redaction
payloadBefore / payloadAfter are run through RedactionService before storage. Keys matching the configured fields (apiKey, secret, password, token, …) or patterns (/email/i, /account/i, /key/i, …) are replaced with ***REDACTED*** (emails are partially masked, account-like values keep their last 4 characters). Expect sensitive keys to be masked in every row.
Cursor pagination over (occurredAt DESC, id DESC):
limit.pagination.hasMore is true, request the next page passing cursor=<pagination.nextCursor>.hasMore is false (nextCursor is then absent).hasMore is computed by fetching limit + 1 rows, so a returned page never exceeds your limit and an empty page means you have reached the end.
Dispute history for one order's dispute:
Everything a user did in a time window:
The SDK does not expose an audit resource yet (packages/sdk/src/resources has no audit client), so call the endpoint with a typed HTTP client:
This is a GET endpoint, so idempotency headers are not applicable.
DISPUTE_ASSIGNED / DISPUTE_RESOLVED entries