Search loyalty ledger entries (paginated; optional per-user balance; CSV export)
Requires VIEWER. export=csv returns a text/csv attachment instead of JSON.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”projectId
required
string
Project (tenant) identifier. Row-level tenant isolation is enforced on every query.
Query Parameters
Section titled “Query Parameters”userId
string
state
string
from
ISO date lower bound (inclusive).
string
to
Date upper bound; expanded to end-of-day UTC.
string
days
Look-back window in days.
integer
page
integer
pageSize
integer
export
string
Responses
Section titled “Responses”Ledger page (JSON), or CSV attachment when export=csv.
object
entries
Array<object>
object
id
string
projectId
string
programId
string
userId
string
amount
integer
state
string
effectiveAt
string | null
expiresAt
string | null
sourceType
string
note
string | null
createdAt
string
total
integer
balance
Present only when userId filter supplied.
object
activeBalance
integer
pendingBalance
integer
lifetimeEarned
integer
lifetimeSpent
integer
string
Missing/invalid path input (e.g. projectId) or invalid JSON body.
Media typeapplication/json
object
error
required
Human-readable error message.
string
message
string
Examplegenerated
{ "error": "example", "message": "example"}Not authenticated (401 via requireAuthenticated) or insufficient project role (403).
Media typeapplication/json
object
error
required
Human-readable error message.
string
message
string
Examplegenerated
{ "error": "example", "message": "example"}