Overview
Import recipients from a CSV to send many letters. Two steps:- Map the columns —
POST /v1/csv-mapfigures out which header is the name, street, city, state, zip, and the variable letter content. - Create orders — one
POST /v1/ordersper recipient with the mapped fields.
Map the columns
Send the raw headers plus a few sample rows. The API returns a mapping onto the fields it recognizes —name, line1, line2, city, state, zip
— each one an array of matching header names, not a single string
(usually one element; only present for the headers it actually found, so
line2 is routinely absent from the response entirely):
text key in this mapping — the letter body isn’t something
/v1/csv-map maps for you. If your spreadsheet has a per-row message column,
read it yourself by header name and pass it as text when you build each
order (see the example below).
The mapping is guessed via a model with a deterministic fallback (
source: "heuristic" when no LLM is configured). Always review the mapping before sending real mail — a wrong mapping mails to the wrong address.