Create an export
Starts a file export of balances, ledger entries, outcome charges or revenue. Exports run in the background; export.ready fires when the file can be downloaded. Every customer’s balance can be exported at any time, so your records never depend on Runledger staying available.
Authentication
A secret key (rl_sk_test_..., rl_sk_live_...) or a restricted key with limited scopes (rl_rk_test_..., rl_rk_live_...). A restricted key can carry agent: true and an expires_at, and is what a coding agent should hold. Keys end in a checksum so secret scanners can recognize them. People create, roll and revoke keys in the dashboard; GET /v1/api_keys lists them, masked.
Request
balances only: balances as they stood at this time. Defaults to now.
Required for every type except balances.
Response
pending while the worker writes the file, ready once it can be downloaded, failed with error saying why, and expired once the file has been removed, seven days after it was ready; create the export again for a fresh file.
How the export was created: dashboard for a person in the dashboard, api for a call to POST /v1/exports with an ordinary key, agent for a call made by an agent (an agent key or the MCP server). Returned by GET /v1/exports and GET /v1/exports/{export_id}.
Present when ready, on GET /v1/exports/{export_id}. Left out of GET /v1/exports. Expires after an hour; retrieve the export again for a fresh one.
When download_url stops working.