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

# Reprocess Corrected Rows

> Save again the rows of a submitted import corrected since it did not save them

[← Imports](https://code.dcycle.io/api-reference/imports/overview.md)

A submitted import may not save some rows: rows left out at validation (`ignore_errors: true`), rows the import could
not save, or rows saved whose calculation failed. [Get rows](https://code.dcycle.io/api-reference/imports/get-rows.md) marks them
(`stage: processing`), and `correctable: true` says a row can still be fixed. Correct its cells with
[Correct rows](https://code.dcycle.io/api-reference/imports/patch-rows.md), as before the submit; the row reads `reprocess: "pending"`. This
endpoint then saves the corrected rows with no errors left, without uploading the file again.

The rows go as an import of their own, which keeps their row numbers: [Get rows](https://code.dcycle.io/api-reference/imports/get-rows.md) of
the original import follows them (`reprocess: "running"`, then saved or marked with their new reason). A row that left
a record saved with an error (a purchase whose calculation failed) has that record replaced, so it is saved once; if
that record is no longer in error (recalculated since), the row is saved already and is not sent again.

Calling it twice sends the rows once: the second call answers `400 IMPORT_NOTHING_TO_REPROCESS`. If the rows could not
be sent, they wait again (`reprocess: "pending"`) and a new call sends them.

## Request

### Headers

**x-api-key** `string` *required*

Your API key for authentication

**x-organization-id** `string` *required*

Your organization UUID

**x-partner** `string` *required*

Partner identifier for the submitting application

**Example:** `dcycle`

### Path Parameters

**import\_id** `string` *required*

UUID of the submitted import session whose corrected rows to save

## Response

**import\_id** `string`

UUID of the import that saves the corrected rows

**processing\_job\_id** `string | null`

UUID of its processing job

**rows\_submitted** `integer`

Number of corrected rows sent to be saved

## Example

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.dcycle.io/v2/imports/11111111-1111-1111-1111-111111111111/reprocess" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "x-partner: dcycle"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "import_id": "44444444-4444-4444-4444-444444444444",
  "processing_job_id": "55555555-5555-5555-5555-555555555555",
  "rows_submitted": 3
}
```

## Common Errors

### 400 Bad Request

**Cause:** The import was not submitted.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"code": "IMPORT_NOT_SUBMITTED", "detail": "Only a submitted import's corrected rows are reprocessed"}
```

**Cause:** No corrected row is ready: none was corrected, or the corrected ones still have errors.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"code": "IMPORT_NOTHING_TO_REPROCESS", "detail": "No corrected row is ready to be saved again"}
```

### 404 Not Found

**Cause:** The import session does not exist or belongs to another organization.

### 409 Conflict

**Cause:** A row left a record in error the template cannot replace.

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"code": "IMPORT_ROW_NOT_CORRECTABLE", "detail": "The template cannot replace the records these rows left in error"}
```


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