Scribe intake

CSV Import

Broker CSVs enter through Scribe first: dry-run the normalization, inspect the preview, then commit with idempotency protection.

Scribe dry-run

Use the session dry-run form before any real import. Tradebok verifies the account belongs to the current user, parses the CSV through Scribe, and returns a preview without writing to the ledger.

Session-authenticated dry-runs check account ownership first and never write trades.

POST /api/v1/import/csv?accountId=acct_123&dryRun=true
Authorization: Bearer tbk_...
Content-Type: text/csv

Ticket,Open Time,Type,Symbol,Volume,Open Price,Close Price
detectedTrades
unmappedRows
model
cached
preview

Upload broker CSV

Send raw broker exports as text/csv to the import endpoint. The current guardrail is a 2MB cap.

Run Scribe dry-run

Append dryRun=true to preview normalized trades, model routing, cache status, detectedTrades, and unmappedRows before writing.

Review normalized trades

Confirm symbols, direction, decimal strings, UTC timestamps, and broker external IDs before committing.

Commit imported records

Retry safely with X-Idempotency-Key. Duplicate external IDs are skipped instead of creating double trades.