# Import & Export

Upload cards in bulk via JSON, and export your library to keep a portable copy.

## Import formats

Two JSON shapes are accepted.

### Option 1 — array of cards

```json
[
  {
    "front": "What is the capital of France?",
    "back": "Paris",
    "tags": ["geography", "europe"]
  },
  {
    "front": "What is 2 + 2?",
    "back": "4",
    "category": "math"
  }
]
```

### Option 2 — object with a `cards` key

```json
{
  "cards": [
    {
      "card_uuid": "my-unique-id",
      "front": "What is the capital of France?",
      "back": "Paris",
      "tags": ["geography"]
    }
  ]
}
```

## Fields

**Required:** `front` and `back` on every card.

**Optional:**

- `tags` — array of strings, used to organize and filter cards
- `category` — string, added as an extra tag
- `card_uuid` — string (max 36 chars), enables in-place updates

## In-place updates with `card_uuid`

When you include a `card_uuid`, re-uploading a file updates matching cards instead of creating duplicates. Your review history and due dates are preserved.

Workflow: export your cards (they'll include UUIDs), edit the JSON, re-upload. Cards without a UUID get one auto-generated.

## Actions

- [Upload cards](/cards/upload) — bulk-import a JSON file.
- [Export cards](/cards/export) — download your library as JSON.
