We're trying to parse the Zendesk JSON ticket export file that we downloaded from the admin center. The documentation article Why is my full JSON export not a valid JSON?, says the following:
“While the file is not a valid JSON, each line within the file is valid JSON…”
And later says…
“Copy and paste the result into a JSON Validator, such as jsonlint.com, to see the format of the data.”
Also, the export documentation says that the JSON export file has each line starting with…
“{"ticket":{"id":....}}”
…but we actually see…
“{"url":"https://xxxxxx.zendesk.com/api/v2/tickets/12345.json","id":12345,”
…which makes us think that something is wrong in the export file from our account.
Additionally, when using tools like jsonlint.com, for many lines of the NDJSON exported file, I'm getting errors. For example, I'm getting an error…
Error: Parse error on line 1:
...26T15:34:48.000Z"}},{"id":41234567889,"
-----------------------^
Expecting 'STRING', got ‘{’
…which is happening nearby the first of the comment nodes.
We really need to be able to parse the JSON, but it looks like it's malformed…and we can't seem to find a standard pattern to fix it. Any thoughts?


Thanks for sharing your findings and the detailed examples. As noted, the Zendesk JSON export uses NDJSON format, where each line is a standalone JSON object rather than a single, consolidated JSON array. This is why traditional JSON validators show errors when checking the entire file at once.
Wrapping the lines into an array, as Domenic suggested, is a common approach to convert NDJSON into standard JSON. Additionally, keep an eye out for any escaping issues or malformed lines which can cause parsing errors.
If the export format doesn't match your expectations or you continue to see irregularities, I recommend reaching out to Zendesk Support with a sample file. They can help verify if there are any account-specific settings or recent changes affecting your export.
Hope this helps you move forward!