> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paperjoy.co/llms.txt
> Use this file to discover all available pages before exploring further.

# CSV campaign: many handwritten cards from one file

> Send up to 100 cards at once: upload a CSV of addresses, write one message with variables, confirm.

A campaign creates up to 100 postcards from one CSV file. Each row is one recipient. You write the message once in the Paperjoy app, and variables such as `{{imie}}` (first name) or `{{kod_rabatowy}}` (discount code) are filled in from each row. No code or API key needed.

![The first campaign step: a drop zone for the CSV file and the list of headers Paperjoy recognizes.](https://mintcdn.com/paperjoy/FYtEKC5NBJj6lKHu/images/app/campaign-upload.webp?fit=max\&auto=format\&n=FYtEKC5NBJj6lKHu\&q=85\&s=bceb13eba6fe29704ad622e72b7991be)

## Prepare the file

Export your recipient list from a CRM, shop, or spreadsheet. The first row holds the column headers, and every other row is one card. The easiest start is the template: click **Pobierz szablon CSV** (Download CSV template) on the first campaign step.

```csv customers-spring.csv theme={null}
imie;nazwisko;firma;adres;kod_pocztowy;miasto;kod_rabatowy;qr_url
Anna;Kowalska;;ul. Kwiatowa 12/4;00-511;Warszawa;ANNA10;https://example.com/spring
Piotr;Wiśniewski;Hotel Pod Dębem;ul. Długa 5;31-147;Kraków;PIOTR10;https://example.com/spring
Michał;Zieliński;;ul. Piotrkowska 120;90-006;Łódź;MICHAL10;
```

Paperjoy recognizes these columns:

| Header | Field | Required |
| - | - | - |
| `zwrot` | Courtesy title, e.g. "Pani" | No |
| `imie` | First name | `imie` or `firma` |
| `nazwisko` | Last name | No |
| `firma` | Company | `imie` or `firma` |
| `adres` | Address line 1 | Yes |
| `adres_2` | Address line 2 | No |
| `kod_pocztowy` | Postal code | Yes |
| `miasto` | City | Yes |
| `kraj` | Country. Empty means Poland. | No |
| `qr_url` | URL for this card's [QR code](https://docs.paperjoy.co/en/postcards/qr-codes.md) | No |

Headers don't have to match exactly. Case and Polish characters are ignored, and Paperjoy also knows common alternatives, such as `Imię`, `first_name`, `Ulica`, `postal_code`, `city`, or `Link QR`. Any other column becomes a variable you can use in the message (see below).

> [!NOTE]
>
> The file holds only recipients and variable values. You choose the message, handwriting, and signature in the app, the same for the whole campaign.

### File requirements

* A `.csv` file up to 1 MB, with at most 100 data rows and 50 columns. Split a longer list into several campaigns.
* Semicolon (`;`) or comma (`,`) separators. Paperjoy detects which one you use.
* UTF-8 encoding. Files from older Excel versions (Windows-1250) work too. In Excel, choose **Save as** → **CSV UTF-8**.
* Wrap cells that contain a comma, semicolon, or line break in quotes. Empty rows are ignored.
* You can write a Polish postal code without the dash: `00511` becomes `00-511`.

## Create a campaign

**1. Upload the file**

Click **Kampanie** (Campaigns) in the top menu, or **Nowa kampania CSV** (New CSV campaign) on the **Panel** (Dashboard) page. Drop the file on the page or click **Wybierz plik** (Choose file).

**2. Check the column mapping**

Paperjoy maps columns to card fields by their headers and shows examples from the first rows. A column without a card field becomes a message variable.

![Column mapping: the Imię, Nazwisko, Firma, Ulica, Kod pocztowy, and Miasto columns go to card fields, Kod rabatowy becomes a variable, and Link QR becomes the QR code URL.](https://mintcdn.com/paperjoy/FYtEKC5NBJj6lKHu/images/app/campaign-mapping.webp?fit=max\&auto=format\&n=FYtEKC5NBJj6lKHu\&q=85\&s=eff45e27465168865bde2407c705dcc3)

Click **Zatwierdź i przejdź do treści** (Approve and continue to the message). If something is wrong, click **Zmień ręcznie** (Change manually) and pick a field for each column, or **Nie używaj** (Don't use).

**3. Write the message**

Write one message for the whole campaign. Click a variable under **Treść** (Message) to insert it at the cursor. Then choose **Profil pisma** (Handwriting), **Pomyłka** (Mistake), and **Podpis** (Signature): typed or your [own](https://docs.paperjoy.co/en/postcards/custom-signatures.md).

![The message step: a message with the imie and kod\_rabatowy variables, a handwritten preview of the first recipient's card with a QR sticker, and the handwriting and signature settings.](https://mintcdn.com/paperjoy/FYtEKC5NBJj6lKHu/images/app/campaign-content.webp?fit=max\&auto=format\&n=FYtEKC5NBJj6lKHu\&q=85\&s=c572da5b37d87ea3cab9a1f70c274713)

The preview shows the first recipient's card and envelope with the variables filled in. Click **Zapisz i sprawdź wiersze** (Save and check rows).

**4. Fix or skip rows with errors**

Paperjoy checks every row with the same rules as a card from the editor: the address, the text length, and whether the message fits on the card. Fix a row in place with **Popraw** (Fix), or leave it out with **Pomiń** (Skip). A skipped row doesn't become a card, and **Przywróć** (Restore) brings it back.

![Row validation: two rows to fix, a missing postal code in an open fix form and an invalid QR code URL, next to a summary with 10 rows ready.](https://mintcdn.com/paperjoy/FYtEKC5NBJj6lKHu/images/app/campaign-validation.webp?fit=max\&auto=format\&n=FYtEKC5NBJj6lKHu\&q=85\&s=e1a2acd7015a44ba0bfdc8974ea393ea)

When no row is waiting for a fix, click **Dalej: potwierdzenie** (Next: confirmation).

**5. Confirm**

The last step shows the message, the settings, the number of cards, the cost, and your balance after the campaign. Click **Utwórz** (Create), e.g. **Utwórz 11 kartek** (Create 11 cards).

![Campaign confirmation: a card preview, the message and settings, and an order of 11 cards, 10 of them with a QR code, for 11 credits, balance 48 → 37.](https://mintcdn.com/paperjoy/FYtEKC5NBJj6lKHu/images/app/campaign-confirm.webp?fit=max\&auto=format\&n=FYtEKC5NBJj6lKHu\&q=85\&s=221e9b00468e0e3c65dd3738832c7bb8)

Each row becomes a regular postcard. It goes through content review, joins the writing queue, and shows up on the **Panel** (Dashboard) page with its own [status](https://docs.paperjoy.co/en/postcards/statuses.md).

![The screen after creating a campaign: 11 cards on their way, the next stages review, writing, and mailing, and buttons for a new campaign and the dashboard.](https://mintcdn.com/paperjoy/FYtEKC5NBJj6lKHu/images/app/campaign-completed.webp?fit=max\&auto=format\&n=FYtEKC5NBJj6lKHu\&q=85\&s=85398645a98d31180b84b87ed88575c4)

After you confirm, the cards wait for content review.

## Variables in the message

A variable is a column name in double curly braces. For each card, Paperjoy replaces it with the value from that row.

* **A column mapped to a field** is named after the header in the table above, such as `{{imie}}`, `{{nazwisko}}`, `{{firma}}`, or `{{miasto}}`, whatever it's called in your file. The exception is `qr_url`: the URL goes on the sticker, not into the text.
* **Any other column** is named after its own header in lowercase, without Polish characters, and with spaces replaced by `_`. A `Kod rabatowy` column is `{{kod_rabatowy}}`.

The message:

```text theme={null}
Dzień dobry {{imie}}!
Dziękujemy, że byliście z nami przez cały rok. Na wiosnę mamy dla Was 10% rabatu na bukiety z kodem {{kod_rabatowy}}.
```

reads "Dzień dobry Anna! (…) z kodem ANNA10." on Anna's card and "Dzień dobry Piotr! (…) z kodem PIOTR10." on Piotr's.

> [!WARNING]
>
> A variable inserts the value exactly as it is in the file. Polish names are not declined. If you need the vocative ("Droga Anno"), add a separate column such as `powitanie` (greeting) and use `{{powitanie}}`.

* The template can be up to 1,000 characters. With the values filled in, each card must fit in 300 characters and on the card. You'll see rows that don't fit in the validation step.
* A variable that isn't in the file blocks saving. The error lists the available names.
* A row with an empty value for a variable you use is flagged for fixing.
* Case and spaces inside the braces don't matter: `{{ Imię }}` works like `{{imie}}`.

## QR codes in a campaign

Add a `qr_url` column to give each card a [QR code](https://docs.paperjoy.co/en/postcards/qr-codes.md) sticker. Each row can point somewhere else, for example a link with its own discount code. An empty cell means a card without a code. The URL must start with `http://` or `https://`.

Each card gets its own code, so the [scan statistics](https://docs.paperjoy.co/en/postcards/qr-codes.md) show which cards were scanned. The QR code is included in the card's price.

## Cost and limits

| | Live | [Test mode](https://docs.paperjoy.co/en/getting-started/test-mode.md) |
| - | - | - |
| Cost | 1 credit per card, QR code included | Free |
| When credits are charged | At confirmation, for all cards at once | Never |
| Cards are written and mailed | Yes | No |

* If you don't have enough credits, the **Utwórz** (Create) button is disabled. [Top up](https://paperjoy.co/billing) or go back and skip some rows.
* Every card in the campaign counts toward the daily postcard ordering limit. See [Errors and rate limits](https://docs.paperjoy.co/en/reference/errors-and-rate-limits.md).
* Cards rejected in content review are refunded automatically.
* A campaign creates all of its cards or none. If a row stops passing validation at confirmation, nothing is created or charged, and the campaign goes back to the validation step with the rows flagged.

## Come back to a campaign

Paperjoy saves the campaign after every step. You can close the tab and come back later: unfinished campaigns are listed under **Niedokończone kampanie** (Unfinished campaigns) below the upload area. Campaigns unchanged for 7 days are deleted.

The **Mapowanie** (Mapping), **Wróć do treści** (Back to message), and **Wróć do weryfikacji** (Back to validation) buttons go back one step.

> [!WARNING]
>
> Saving the message again rebuilds every row from the file. Fixes and skips from the validation step are lost, so go back to the message before you fix rows, not after.

## Campaigns in the API

You create a campaign in the Paperjoy app, but you can read its progress and postcards through the API, for example to record statuses and scans in your CRM after the cards go out. The API never changes a campaign. An API key only sees campaigns in its own [mode](https://docs.paperjoy.co/en/getting-started/test-mode.md).

| Endpoint | Returns |
| - | - |
| `GET /api/campaigns` | Your campaigns, newest first, unfinished ones included. `?status=completed` keeps only confirmed ones. |
| `GET /api/campaigns/{id}` | The campaign's step, message, options, and counts of rows, skipped rows, and created postcards. |
| `GET /api/campaigns/{id}/postcards` | The postcards the campaign created, with their [statuses](https://docs.paperjoy.co/en/postcards/statuses.md) and [QR code scans](https://docs.paperjoy.co/en/postcards/qr-codes.md). |

The campaign ID (`cmp_…`) is also in the campaign's address in the Paperjoy app.

```bash theme={null}
curl "https://paperjoy.co/api/campaigns/cmp_4kQ9xW2mTb/postcards?status=sent" \
  --header "Authorization: Bearer $PAPERJOY_API_KEY" \
  --header "Accept: application/json"
```

Lists are paginated like the [postcard list](https://docs.paperjoy.co/en/postcards/list-and-retrieve.md): use `page` and `per_page`, and follow `links.next`. The API never returns the CSV file's columns or rows, so recipient data is only on the postcards.

## Common problems

> [accordion] Polish characters look garbled
>
> The file uses an unusual encoding. In Excel, save it as **CSV UTF-8**. From Google Sheets, download it as CSV.

> [accordion] "Wiersz ma więcej kolumn niż nagłówek" (The row has more columns than the header)
>
> The row contains a comma or semicolon outside quotes, e.g. in an address like "ul. Długa 5, lok. 2". Fix the row in the validation step or wrap the cell in quotes in the file.

> [accordion] The file has more than 100 rows
>
> Split it into files of up to 100 rows and create a separate campaign from each.

> [accordion] The message doesn't fit on the card
>
> Longer names or variable values make the text longer. Shorten the message or fix the value in the row. A QR code and a custom signature take up room, so the lines next to them are shorter.

> [!TIP]
>
> Try a campaign in [test mode](https://docs.paperjoy.co/en/getting-started/test-mode.md). You go through every step and see the previews, and nothing is sent or charged.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.