Skip to main content

Overview

Import recipients from a CSV to send many letters. Two steps:
  1. Map the columnsPOST /v1/csv-map figures out which header is the name, street, city, state, zip, and the variable letter content.
  2. Create orders — one POST /v1/orders per 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):
There is no 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.

Send one per row

Iterate rows and create an order for each, substituting the mapped columns. Keep rate limits in mind (see Rate limits).

Row validation

Bad rows (missing zip, non-numeric state, etc.) fail with a validation error and a fix instruction — handle each and continue. Never send a letter for a row that failed validation.
Last modified on September 17, 2026