Get Import Rows
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
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"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/imports/{import_id}/rows \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"import_id": "<string>",
"rows": {
"row_index": 123,
"data": {},
"errors": {}
},
"page": 123,
"page_size": 123,
"total_pages": 123,
"total_rows": 123
}Get Import Rows
Retrieve paginated rows from an import session with filtering and sorting
GET
/
v2
/
imports
/
{import_id}
/
rows
Get Import Rows
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
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"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/imports/{import_id}/rows \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"import_id": "<string>",
"rows": {
"row_index": 123,
"data": {},
"errors": {}
},
"page": 123,
"page_size": 123,
"total_pages": 123,
"total_rows": 123
}← Imports
Retrieve the parsed and validated rows of an import session. Supports pagination, error-only filtering, column sorting, and cascading column filters for building review UIs.
Cause: The session’s project is no longer one your organization can import into (for example, the organization was unlinked from it). Every step of the session answers this, not only the submit. Create a new session on a project you work in.
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"Query Parameters
integer
default:"1"
Page number (1-indexed)
integer
default:"50"
Rows per page (1–500)
boolean
default:"false"
When
true, only return rows with validation errorsstring
Column key to sort by. Must match
[a-zA-Z0-9_]+.Example: sort_by=weightstring
Sort direction:
asc or desc. Only used when sort_by is set.string
JSON-encoded object mapping column keys to arrays of allowed values. AND across columns, IN within a column.Example:
filters={"country":["Spain","France"],"fuel":["diesel"]}Limits: max 20 filter keys, 500 values per key.Response
string
UUID of the import session
array[object]
integer
Current page number
integer
Rows per page
integer
Total number of pages
integer
Total row count (respects
errors_only and filters)Example
curl -X GET "https://api.dcycle.io/v2/imports/11111111-1111-1111-1111-111111111111/rows?page=1&page_size=20&errors_only=true&sort_by=weight&sort_direction=asc" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
}
import_id = "11111111-1111-1111-1111-111111111111"
response = requests.get(
f"https://api.dcycle.io/v2/imports/{import_id}/rows",
headers=headers,
params={
"page": 1,
"page_size": 20,
"errors_only": True,
"sort_by": "weight",
"sort_direction": "asc",
},
)
result = response.json()
print(f"Showing {len(result['rows'])}/{result['total_rows']} error rows")
for row in result["rows"]:
print(f" Row {row['row_index']}: {list(row['errors'].keys())}")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
};
const importId = '11111111-1111-1111-1111-111111111111';
axios.get(`https://api.dcycle.io/v2/imports/${importId}/rows`, {
headers,
params: { page: 1, page_size: 20, errors_only: true, sort_by: 'weight', sort_direction: 'asc' },
}).then(response => {
const { rows, total_rows } = response.data;
console.log(`${rows.length}/${total_rows} error rows`);
rows.forEach(r => console.log(` Row ${r.row_index}: ${Object.keys(r.errors)}`));
});
Successful Response
{
"import_id": "11111111-1111-1111-1111-111111111111",
"rows": [
{
"row_index": 14,
"data": {
"origin": "Valencia",
"destination": "Sevilla",
"weight": "abc",
"vehicle_type": "van",
"date": "2024-03-16"
},
"errors": {
"weight": [
{
"rule": "type_numeric",
"params": {"value": "abc"},
"message": "Expected a numeric value"
}
]
}
}
],
"page": 1,
"page_size": 20,
"total_pages": 1,
"total_rows": 3
}
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"}
{"code": "PROJECT_NOT_FOUND", "detail": "Project with id='9a8b7c6d-5e4f-3a2b-1c0d-e9f8a7b6c5d4' not found"}
Related Endpoints
Patch Rows
Fix validation errors in specific rows
Validate Import
Run validation on mapped rows
Was this page helpful?