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

# talkvalue path import failed-export

> Stream the rejected rows from an import job as CSV so you can fix and re-import them.

Stream every rejected row from an import job to stdout as CSV. The `failedRows` field on the job record only carries a small inline sample. This command returns the full list, ready to redirect to a file or pipe into another tool. The output is always CSV. The global `--format` and `--json` flags emit a stderr warning and are otherwise ignored.

## Synopsis

```bash theme={null}
talkvalue path import failed-export <id> > failed.csv
```

## Arguments

| Argument | Type    | Description                                                                        |
| -------- | ------- | ---------------------------------------------------------------------------------- |
| `<id>`   | integer | The `importJobId` returned by [`import create`](/cli/commands/path/import/create). |

## Examples

### 1. Save failures to a file

```bash theme={null}
talkvalue path import failed-export 4218 > failed-4218.csv
```

Captures the rejected rows. The CSV header is `rowNum,errorCode,errorMessage,rawValue` so you can sort and filter without re-parsing.

### 2. Count failures grouped by error code

```bash theme={null}
talkvalue path import failed-export 4218 \
  | tail -n +2 \
  | awk -F',' '{print $2}' \
  | sort | uniq -c | sort -rn
```

Skips the header, pulls `errorCode`, and prints the rank-ordered failure types. Useful when triaging which fix unlocks the most rows.

### 3. Only run when the job had failures

```bash theme={null}
job_id=4218
failed=$(talkvalue path import get "$job_id" --json | jq -r '.data.failedCount')
if [ "$failed" -gt 0 ]; then
  talkvalue path import failed-export "$job_id" > "failed-$job_id.csv"
fi
```

Pairs `import get` with `failed-export` so the CSV file only appears when there is something to fix.

## Response

The command writes raw CSV to stdout, not the standard JSON envelope.

```csv theme={null}
rowNum,errorCode,errorMessage,rawValue
47,INVALID_EMAIL,Email could not be parsed,alice@@acme.com
214,MISSING_REQUIRED,Email column is empty,
```

If TalkValue returns a non-200 status the command fails with a usage error carrying the HTTP status. No CSV is written.

## See also

* [`import get`](/cli/commands/path/import/status). Branch on `failedCount` before exporting.
* [`import create`](/cli/commands/path/import/create). Re-import the fixed CSV with the same channel and mode.
* [Recipe: CSV import](/cli/recipes/csv-import). Uses this command in the failure-recovery branch.
