Skip to main content
POST
/
v2
/
imports
/
{import_id}
/
rows
/
delete
Delete Import Rows
const options = {
  method: 'POST',
  headers: {
    'x-api-key': '<x-api-key>',
    'x-organization-id': '<x-organization-id>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({row_indices: {}, delete_all_errors: true})
};

fetch('https://api.dcycle.io/v2/imports/{import_id}/rows/delete', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "deleted_count": 123,
  "total_rows": 123,
  "valid_rows": 123,
  "error_rows": 123
}

Delete Import Rows

Remove specific rows from an import session before submission. Use this when rows cannot be corrected and should be excluded from the import. You can delete individual rows by index or remove all error rows at once.
Deleted rows are physically removed and cannot be recovered. The row indices of remaining rows are not renumbered.

Request

Headers

x-api-key
string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
x-organization-id
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Path Parameters

import_id
string
required
UUID of the import sessionExample: "11111111-1111-1111-1111-111111111111"

Body Parameters

row_indices
array[integer]
Zero-based indices of rows to delete (max 10,000). When null and delete_all_errors is false, no rows are deleted.
delete_all_errors
boolean
default:"false"
When true, delete all rows that have validation errors, regardless of row_indices.

Response

deleted_count
integer
Number of rows that were deleted
total_rows
integer
Total rows remaining after deletion
valid_rows
integer
Valid rows remaining
error_rows
integer
Error rows remaining (0 if delete_all_errors was used)

Example

# Delete specific rows
curl -X POST "https://api.dcycle.io/v2/imports/11111111-1111-1111-1111-111111111111/rows/delete" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{"row_indices": [14, 87, 203]}'

# Or delete all error rows at once
curl -X POST "https://api.dcycle.io/v2/imports/11111111-1111-1111-1111-111111111111/rows/delete" \
  -H "x-api-key: ${DCYCLE_API_KEY}" \
  -H "x-organization-id: ${DCYCLE_ORG_ID}" \
  -H "Content-Type: application/json" \
  -d '{"delete_all_errors": true}'

Successful Response

{
  "deleted_count": 3,
  "total_rows": 237,
  "valid_rows": 237,
  "error_rows": 0
}

Common Errors

401 Unauthorized

Cause: Missing or invalid API key
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}

403 Forbidden

Cause: The authenticated user is not a member of the organization
{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}

404 Not Found

Cause: The import session does not exist or belongs to another organization
{"detail": "Not Found"}

Patch Rows

Fix rows instead of deleting them

Get Import Rows

Review rows before deletion

Submit Import

Submit after cleaning up errors