Upload Data Import
POST/api/v2/data-imports
Uploads mapped CSV data for import and kicks off background validation. Returns the data import ID and a tracked job log ID to poll for validation progress.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Authentication: Requires Bearer token.
Per-entity authorization: For the gated entity types (customers, warehouses, suppliers, sales_reps, categories) the user must hold the matching <entity>.import permission (e.g. customers.import). Other entity types are not gated here. The check resolves through the granular_permissions feature flag — it is a no-op while that flag is off. Returns 403 when the user lacks the required permission.
Request Body:
- entity_type (required, string): Type of entity being imported (e.g. products, customers, warehouses, suppliers, sales_reps)
- file_name (required, string, max:255): Original filename for display
- column_mapping (required, array): Maps column positions to field names
- mapped_rows (required, array, min:1): Array of row objects with mapped field values
- metadata (nullable, array): Optional metadata
Request
Responses
- 201
- 401
- 403
- 422
- 429
Created
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.