Suggest a column mapping for an import file
Send only the column headers and a few sample rows. AI identifies whether the file holds items, customers or vendors and proposes a column-to-field mapping with confidence scores, for review before importing.
How to use it
- Read the column headers and up to 30 sample rows from the file on your side.
- Send fileName, columns, sampleRows and rowCount; add entityTypeHint to force the record type.
- Review and edit the proposed mappings, then convert all rows and send them to Import a batch of records. Nothing is saved by this call.
BearerAuthAuthorizationBearer <JWT>application/json- body
fileName*stringName of the file being imported (max 255 characters); helps the AI guess the record type.
0 <= length <= 255columns*array<string>Column headers from the file, in order (1 to 80). Headers must be unique and not blank.
0 <= items <= 80sampleRows*array<array<string>>Sample rows (1 to 30), each a list of cell values in the same order as columns. Only the first 20 are sent to the AI and long cells are cut to 120 characters. Never send the whole file.
0 <= items <= 30rowCount*integerTotal number of data rows in the file; informational only.
int64entityTypeHint?|Optional: force the record type (ITEM, CUSTOMER or VENDOR) instead of letting the AI decide.
"ITEM""CUSTOMER""VENDOR"nullOK
*/*- response
status*stringOutcome of the request: SUCCESS when it worked; errors return an error status with the reason in message.
message*stringShort human-readable message describing the outcome.
data?The proposed record type and column-to-field mapping, for review before importing.
curl -X POST 'https://beta.iotoms.com/api/v1/ai/import/analyze' \ -H 'Content-Type: application/json' \ -d '{ "fileName": "string", "columns": [], "sampleRows": [], "rowCount": 0}'{ "status": "string", "message": "string", "data": { "entityType": "ITEM", "entityConfidence": 0.1, "reasoning": "string", "mappings": [ { "sourceColumn": "string", "targetField": "string", "confidence": 0.1, "transform": { "type": "string", "valueMap": { "property1": "string", "property2": "string" }, "defaultValue": "string" }, "note": "string" } ], "unmappedColumns": [ "string" ], "targetFields": [ { "name": "string", "type": "string", "required": true, "description": "string", "enumValues": [ "string" ] } ] }}