Get borrower activity logs
Get on-chain activity logs for a borrower. Works for both v2 and v3 borrowers, and contains two kinds of events:
- Financing events — borrows/draws, repayments, deposits, withdrawals, fees, and (v3) interest accruals, emitted by the borrower's credit facilities.
- Status events (v3 only) — covenant, collateral, and servicing changes.
Each item carries a source (facility, servicing, covenant, or collateral) indicating which contract emitted it, and lineTokenId identifying the individual credit line (position) where applicable.
Supports three response formats via the format query parameter:
- json (default) — paginated JSON (default limit 20, max 1000).
- csv — streamed CSV file download (up to 1 000 000 rows).
- event-stream — Server-Sent Events stream (up to 1 000 000 rows). Each log is emitted as a named log event with JSON data. A final done event carries {"total": N}. Connect with EventSource or fetch:
const es = new EventSource('/v3/borrowers/{id}/logs?format=event-stream', {
headers: { 'x-api-key': 'cc_...' },
});
es.addEventListener('log', (e) => console.log(JSON.parse(e.data)));
es.addEventListener('done', (e) => { console.log('total:', JSON.parse(e.data).total); es.close(); });
Event types by protocol version —
- v1/v2: AddCredit, Borrow, IncreaseCredit, PayServicingFee, RepayInterest, RepayPrincipal, ReservesChanged, TransferOriginationFee, WithdrawDeposit, WithdrawProfit
- v3: AdvanceRateUpdated, Attested, BreachCured, BreachDeclared, Checkpointed, Claimed, CloseSurplusRecorded, Closed, CollateralAdded, CollateralReleaseFailed, CollateralReleased, CollateralRemoved, CommitmentAccrued, CommitmentClaimed, CommitmentClosed, CommitmentDrawn, CommitmentRepaid, CovenantAdded, CovenantEvalFailed, CovenantRemoved, FacilityAdded, FacilityCloseFailed, FacilityClosed, FacilityRemoved, Liquidated, Operated, OperatorUpdated, Originated, OwnerWithdrawn, Refinanced, ReleaseFailed, Released, ServicingClosed, SurplusClaimed, TargetAdded, TargetReleaseFailed, TargetReleased, TargetRemoved, TrusteeSet
Request
- Base URL: https://api.creditcoop.xyz
- URL: https://api.creditcoop.xyz/v3/borrowers/{id}/logs
- Auth: one of:
- API key in header x-api-key
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://clerk.creditcoop.xyz/oauth/authorize, token URL https://clerk.creditcoop.xyz/oauth/token)
Path parameters
Borrower organization ID. Example: 550e8400-e29b-41d4-a716-446655440000
Query parameters
Response format. "json" returns paginated JSON (default 20, max 1000). "csv" returns a streamed CSV file download. "event-stream" returns Server-Sent Events with each log as a named "log" event and a final "done" event.
Filter logs by CAIP-2 network identifier. Example: eip155:8453
Filter by protocol version(s). Comma-separated or repeated (e.g. ?protocolVersion=v1,v2 or ?protocolVersion=v1&protocolVersion=v2). Omit to return all versions.
Start date (YYYY-MM-DD). Example: 2025-01-15
End date, inclusive (YYYY-MM-DD). Example: 2025-01-15
Maximum number of results. For json: default 20, max 1000. For csv/event-stream: default 1000000, max 1000000.
Response
Borrower activity logs — financing events from the borrower's credit facilities (v2 and v3), plus v3 covenant/collateral/servicing status events. Response format depends on the format query parameter.
Example response
{
"organizationId": "550e8400-e29b-41d4-a716-446655440000",
"logs": [
{
"timestamp": "2025-01-15T10:30:00Z",
"token": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"contractAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"networkId": "eip155:1"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.