Newman "The top-level 'item'" bad collection export version in CI
Newman only runs collections exported in the Postman Collection Format v2.1 schema, where requests live under a top-level item array. An older v1 export uses different keys, so Newman reports the structure is invalid.
What this error means
Newman aborts with a schema message such as "The top-level 'item' property is missing" or "collection is invalid" for a collection exported in the old v1 format.
error: collection could not be loaded
The top-level 'item' property is missing or malformed
(expected Collection Format v2.1.0)Common causes
The collection was exported as v1
An old export or an old Postman version produced Collection Format v1, which lacks the v2.1 item structure Newman parses.
The file is not a Postman collection at all
A truncated file, an environment file, or unrelated JSON was passed where the collection is expected, so the item array is absent.
How to fix it
Re-export as Collection Format v2.1
- In Postman, export the collection choosing "Collection v2.1".
- Replace the committed collection with the v2.1 export.
- Re-run Newman, which now finds the top-level
itemarray.
Convert an old collection programmatically
Use the collection transformer to upgrade a v1 export to v2.1 without opening the app.
npx postman-collection-transformer convert \
-i old-collection.json -o collection.json \
-j 1.0.0 -p 2.1.0How to prevent it
- Always export collections in Collection Format v2.1.
- Commit the v2.1 export and keep it in sync with Postman.
- Validate the collection loads with a quick Newman dry run in CI.