GuideLab Docs

Validate import data before importing

Dry-run validation of mapped CSV rows for a given import type. Returns per-row validation results and a summary of valid/invalid counts without persisting anything. Lab-only endpoint.

POST
/import/validate

Dry-run validation of mapped CSV rows for a given import type. Returns per-row validation results and a summary of valid/invalid counts without persisting anything. Lab-only endpoint.

Authorization

__Secure-guidelab-prod.session_token<token>

Production session cookie set for the guidelab.co domain by Better Auth

In: cookie

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/import/validate" \  -H "Content-Type: application/json" \  -d '{    "importType": "products",    "mappings": [      {        "sourceColumn": "string",        "targetField": "string"      }    ],    "rows": [      {        "property1": "string",        "property2": "string"      }    ]  }'
{  "isValid": true,  "errors": [    {      "row": 1,      "field": "string",      "code": "required",      "message": "string",      "value": "string",      "severity": "error"    }  ],  "warnings": [    {      "row": 1,      "field": "string",      "code": "required",      "message": "string",      "value": "string",      "severity": "error"    }  ],  "validRows": 0,  "invalidRows": 0,  "rowResults": [    {      "rowIndex": 0,      "isValid": true,      "data": {        "property1": null,        "property2": null      },      "errors": [        {          "row": 1,          "field": "string",          "code": "required",          "message": "string",          "value": "string",          "severity": "error"        }      ],      "warnings": [        {          "row": 1,          "field": "string",          "code": "required",          "message": "string",          "value": "string",          "severity": "error"        }      ]    }  ],  "summary": {    "total": 0,    "valid": 0,    "invalid": 0  }}
Empty