Skip to content

Start data import

POST
/rest/imports/start
curl --request POST \
--url https://api.shypr.app/rest/imports/start \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <X-API-KEY>' \
--data '{ "iri": "example", "mapping": { "additionalProperty": 1 }, "onMatch": "skip", "dateOrder": "dmy" }'

Creates a DataImport resource.

The new DataImport resource

The import of one CSV file of one type. The create reads the header and a few rows, the user maps the columns, and RunDataImport imports the rows in the worker. Each row gets a DataImportRow.

object
iri
required

The IRI of the import, its id in GraphQL.

string
mapping
required

The column of each field: the name of the field and the index of the column in the header, from 0. A field without a column is not in the map.

object
key
additional properties
integer
onMatch
required
string
default: skip
Allowed values: skip update
dateOrder

The order of the day and the month in a date such as 03-04-2026: “dmy” or “mdy”. A date as 2026-04-03 is always read.

string
default: dmy
Allowed values: dmy mdy

DataImport resource created

The import of one CSV file of one type. The create reads the header and a few rows, the user maps the columns, and RunDataImport imports the rows in the worker. Each row gets a DataImportRow.

object
status
string
default: mapping
Allowed values: mapping queued running finished failed cancelled
mapping

The column of each field, see DataImportStartInput::$mapping. Before the start it holds the suggestion of the create.

object
key
additional properties
integer
onMatch
string
default: skip
Allowed values: skip update
dateOrder

“dmy” or “mdy”, see DataImportStartInput::$dateOrder.

string
default: dmy
totalRows

The data rows of the file, without the header. Null until the worker counted them.

integer | null
processedRows
integer
0
processedOffset

The byte in the file after the last imported row. The next chunk starts there.

Any of:
integer
createdRows
integer
0
updatedRows
integer
0
skippedRows
integer
0
failedRows
integer
0
startedAt
string | null format: date-time
finishedAt
string | null format: date-time
error

Why the import stopped, for the status failed.

string | null
type
string
Allowed values: categories attributes suppliers customers tasks contacts addresses products price_lists lots inventory quotes sales_orders proformas invoices credit_notes purchase_orders payments packing_lists complaints notes
header

The names of the columns, the first line of the file.

Array<string>
sampleRows

The first SAMPLE_ROWS data rows.

Array<Array<string>>
delimiter
string
creator
string format: iri-reference
createdAt
string format: date-time
updatedAt
string | null format: date-time
file
string format: iri-reference
id

More information

string format: uuid
uid
string
typeValue
string
typeLabel
string
statusValue
string
onMatchValue
string

Example

{
"status": "mapping",
"onMatch": "skip",
"dateOrder": "dmy",
"processedRows": 0,
"processedOffset": 0,
"createdRows": 0,
"updatedRows": 0,
"skippedRows": 0,
"failedRows": 0,
"type": "categories",
"creator": "https://example.com/",
"file": "https://example.com/"
}

Invalid input

A representation of common errors.

object
title

A short, human-readable summary of the problem.

string | null
detail

A human-readable explanation specific to this occurrence of the problem.

string | null
status
integer | null
default: 400
instance

A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.

string | null
type

A URI reference that identifies the problem type

string

Example

{
"status": 400
}

Forbidden

A representation of common errors.

object
title

A short, human-readable summary of the problem.

string | null
detail

A human-readable explanation specific to this occurrence of the problem.

string | null
status
integer | null
default: 400
instance

A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.

string | null
type

A URI reference that identifies the problem type

string

Example

{
"status": 400
}

An error occurred

Unprocessable entity

object
status
integer
default: 422
violations
Array<object>
object
propertyPath
required

The property path of the violation

string
message
required

The message associated with the violation

string
code

The code of the violation

string
hint

An extra hint to understand the violation

string
payload

The serialized payload of the violation

object
key
additional properties
any
detail
string
type
string
title
string | null
instance
string | null

Example

{
"status": 422
}