# Import payload

> Callback and webhook delivery share the same core import payload and preserve enough source context to report errors against original CSV rows.

Canonical HTML: https://www.csvjetty.com/docs/reference/import-payload

## Payload shape

```js
{
  importId: "IMPORT_ID",
  fileName: "contacts.csv",
  rows: [
    {
      name: "Ada",
      email: "ada@example.com",
    },
  ],
  rowNumbers: [1],
  skippedRows: 0,
  uploadedFileHeaders: ["Full Name", "Email"],
  matchedColumnsMap: {
    name: "Full Name",
    email: "Email",
  },
}
```

## Fields

| Field | Type | Purpose |
| --- | --- | --- |
| `importId` | string | Unique import ID. Useful for idempotency. |
| `fileName` | string | Sanitized uploaded CSV filename. |
| `rows` | array | Mapped and cleaned records for the delivery batch. |
| `rowNumbers` | number[] | Original data-row numbers corresponding to `rows`. |
| `skippedRows` | number | Invalid rows excluded when filtering is enabled. |
| `uploadedFileHeaders` | string[] | Headers found in the uploaded CSV. |
| `matchedColumnsMap` | object | Destination field name to selected source-header mapping. |
| `batch` | number | Webhook only: zero-based batch number. |
| `totalBatches` | number | Webhook only: total number of batches. |

## Row numbers

Row numbers start at 1 for the first data row after the CSV header. They preserve original source-row identity when invalid rows are filtered out.

Pair `importId` with row or batch identity when the receiving API needs idempotent writes.

## Unmatched data

When unmatched-column delivery is enabled, each row can contain an `_unmatched` object:

```js
{
  email: "ada@example.com",
  _unmatched: {
    "Legacy ID": "1234"
  }
}
```

## Callback result

Return nothing or an empty errors array when a callback batch succeeds:

```js
return { errors: [] };
```

Reject specific original CSV rows with:

```js
return {
  errors: [
    { row: 2, message: "Email already exists" },
  ],
};
```

Error messages must be nonempty and should reference original row numbers supplied in `rowNumbers`.
