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));import requests
url = "https://api.dcycle.io/v2/imports/{import_id}/rows/delete"
payload = {
"row_indices": {},
"delete_all_errors": True
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/imports/{import_id}/rows/delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"row_indices": {},
"delete_all_errors": true
}
'{
"deleted_count": 123,
"total_rows": 123,
"valid_rows": 123,
"error_rows": 123
}Delete Import Rows
Physically delete rows from a validated import session
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));import requests
url = "https://api.dcycle.io/v2/imports/{import_id}/rows/delete"
payload = {
"row_indices": {},
"delete_all_errors": True
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.dcycle.io/v2/imports/{import_id}/rows/delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"row_indices": {},
"delete_all_errors": true
}
'{
"deleted_count": 123,
"total_rows": 123,
"valid_rows": 123,
"error_rows": 123
}← Imports
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
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
UUID of the import sessionExample:
"11111111-1111-1111-1111-111111111111"Body Parameters
array[integer]
Zero-based indices of rows to delete (max 10,000). When
null and delete_all_errors is false, no rows are deleted.boolean
default:"false"
When
true, delete all rows that have validation errors, regardless of row_indices.Response
integer
Number of rows that were deleted
integer
Total rows remaining after deletion
integer
Valid rows remaining
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}'
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
"Content-Type": "application/json",
}
import_id = "11111111-1111-1111-1111-111111111111"
# Delete all error rows
response = requests.post(
f"https://api.dcycle.io/v2/imports/{import_id}/rows/delete",
headers=headers,
json={"delete_all_errors": True},
)
result = response.json()
print(f"Deleted: {result['deleted_count']} rows")
print(f"Remaining: {result['total_rows']} ({result['valid_rows']} valid)")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
'Content-Type': 'application/json',
};
const importId = '11111111-1111-1111-1111-111111111111';
// Delete specific rows
axios.post(`https://api.dcycle.io/v2/imports/${importId}/rows/delete`, {
row_indices: [14, 87, 203],
}, { headers })
.then(response => {
const { deleted_count, total_rows } = response.data;
console.log(`Deleted ${deleted_count}, ${total_rows} remaining`);
});
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. Both cases return the same response, so a session id from another organization is indistinguishable from one that does not exist.{"code": "NOT_FOUND", "detail": "ImportSessionModel with id='1b2c3d4e-5f60-7182-93a4-b5c6d7e8f901' not found"}
Related Endpoints
Patch Rows
Fix rows instead of deleting them
Get Import Rows
Review rows before deletion
Submit Import
Submit after cleaning up errors
Was this page helpful?