Device registry bulk import fails with schema validation errors on valid JSON

I’m attempting to bulk import 5000+ device records into the Watson IoT device registry using the bulk import API. The JSON file validates correctly against the published schema, but the import consistently fails with vague ‘schema validation error’ messages. When I import the same devices one-by-one via the console UI, they’re accepted without issues.

The error log shows:


Bulk import failed: Schema validation error at line 847
Invalid field structure in device metadata

But line 847 looks identical to devices that imported successfully through the UI. I’ve checked the bulk import format requirements in the documentation and our JSON structure matches exactly. The metadata fields are all standard attributes - deviceId, typeId, authToken, and metadata object with location and model info. Is there something different about schema requirements for bulk imports versus individual device registration?

The bulk import uses a different validation pipeline than interactive registration. One common issue is nested metadata structure depth. The bulk validator has a hard limit of 3 levels deep for metadata objects, while UI allows 4. Also check your array fields - if you have any arrays in metadata, they must not exceed 50 elements for bulk import. Can you share a sanitized sample of the device record that’s failing?

I’ve validated the JSON file - no null values in required fields, and I tried both LF and CRLF line endings with same result. The error message points to line 847 but doesn’t specify which field is problematic. Is there a way to get more detailed validation output from the bulk import API? The current error messages are too generic to debug effectively.

I’ve dealt with this exact scenario multiple times. The error message is misleading - it’s usually not about the device record at the line number shown. The bulk import validator processes records in batches of 500, and if ANY record in a batch fails, it reports the last record it processed. So line 847 might be in batch 2, but the actual problem could be in record 501-846. Try splitting your import file into smaller chunks of 100-200 devices to isolate the problematic record.