Skip to content

Search loyalty ledger entries (paginated; optional per-user balance; CSV export)

Requires VIEWER. export=csv returns a text/csv attachment instead of JSON.

projectId
required
string

Project (tenant) identifier. Row-level tenant isolation is enforced on every query.

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
default: 1 >= 1
pageSize
integer
default: 20 >= 1 <= 200
export
string
Allowed values: csv

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

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
json
{
"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
json
{
"error": "example",
"message": "example"
}