Patch Import Rows
const options = {
method: 'PATCH',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({corrections: {}})
};
fetch('https://api.dcycle.io/v2/imports/{import_id}/rows', 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"
payload = { "corrections": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.dcycle.io/v2/imports/{import_id}/rows \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"corrections": {}
}
'{
"updated_rows": {},
"total_errors_remaining": 123
}Patch Import Rows
Apply row-level corrections and revalidate corrected rows
PATCH
/
v2
/
imports
/
{import_id}
/
rows
Patch Import Rows
const options = {
method: 'PATCH',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({corrections: {}})
};
fetch('https://api.dcycle.io/v2/imports/{import_id}/rows', 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"
payload = { "corrections": {} }
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)curl --request PATCH \
--url https://api.dcycle.io/v2/imports/{import_id}/rows \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"corrections": {}
}
'{
"updated_rows": {},
"total_errors_remaining": 123
}← Imports
Apply corrections to individual cells in the import session. The backend revalidates the corrected rows and returns updated row data with the remaining error count. Use this to fix validation errors without re-uploading the file.
Corrections are applied cell-by-cell. Each correction targets one row and one column. You can send up to 10,000 corrections per request.
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[object]
required
Response
array[object]
The corrected rows after revalidation, each with
row_index, data, and errorsinteger
Total number of rows with errors remaining in the entire session after applying corrections
Example
curl -X PATCH "https://api.dcycle.io/v2/imports/11111111-1111-1111-1111-111111111111/rows" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"corrections": [
{"row_index": 14, "column": "weight", "value": 800},
{"row_index": 87, "column": "date", "value": "2024-03-20"}
]
}'
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"
response = requests.patch(
f"https://api.dcycle.io/v2/imports/{import_id}/rows",
headers=headers,
json={
"corrections": [
{"row_index": 14, "column": "weight", "value": 800},
{"row_index": 87, "column": "date", "value": "2024-03-20"},
]
},
)
result = response.json()
print(f"Errors remaining: {result['total_errors_remaining']}")
for row in result["updated_rows"]:
status = "fixed" if not row["errors"] else "still has errors"
print(f" Row {row['row_index']}: {status}")
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';
axios.patch(`https://api.dcycle.io/v2/imports/${importId}/rows`, {
corrections: [
{ row_index: 14, column: 'weight', value: 800 },
{ row_index: 87, column: 'date', value: '2024-03-20' },
],
}, { headers })
.then(response => {
console.log(`Errors remaining: ${response.data.total_errors_remaining}`);
});
Successful Response
{
"updated_rows": [
{
"row_index": 14,
"data": {
"origin": "Valencia",
"destination": "Sevilla",
"weight": "800",
"vehicle_type": "van",
"date": "2024-03-16"
},
"errors": {}
},
{
"row_index": 87,
"data": {
"origin": "Bilbao",
"destination": "Madrid",
"weight": "1200",
"vehicle_type": "truck",
"date": "2024-03-20"
},
"errors": {}
}
],
"total_errors_remaining": 1
}
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"}
422 Unprocessable Entity
Cause: Invalid corrections format or missing required fields{
"detail": [
{
"loc": ["body", "corrections"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Related Endpoints
Get Import Rows
View rows and identify errors
Delete Rows
Remove rows instead of fixing them
Submit Import
Submit once all errors are resolved
Was this page helpful?