Skip to main content
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
}

Get Import Rows

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.

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"

Query Parameters

page
integer
default:"1"
Page number (1-indexed)
page_size
integer
default:"50"
Rows per page (1–500)
errors_only
boolean
default:"false"
When true, only return rows with validation errors
sort_by
string
Column key to sort by. Must match [a-zA-Z0-9_]+.Example: sort_by=weight
sort_direction
string
Sort direction: asc or desc. Only used when sort_by is set.
filters
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

import_id
string
UUID of the import session
rows
array[object]
Paginated row data
page
integer
Current page number
page_size
integer
Rows per page
total_pages
integer
Total number of pages
total_rows
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
{"detail": "Not Found"}

Patch Rows

Fix validation errors in specific rows

Validate Import

Run validation on mapped rows