Bulk import of campaign leads via API fails with 'Invalid JSON' error

We’re trying to bulk upload leads to our marketing campaign using the Zendesk Sell REST API, but consistently getting ‘Invalid JSON format’ errors. The import endpoint rejects our payload even though the JSON validates in external tools.

Our request structure includes an array of lead objects with standard fields (name, email, phone, campaign_id). We’ve verified the required fields are present and the JSON array formatting looks correct. The same data imports fine through the UI, but the API import fails every time.

Has anyone encountered similar issues with the bulk lead import endpoint? We’re on zs-2021 and this is blocking our automated campaign workflows.

Example of our request payload:

[
  {"name": "John Doe", "email": "john@example.com",
   "phone": "+1234567890", "campaign_id": "camp_12345"}
]

Looking at your payload, I notice you’re missing the wrapper object that mike mentioned. But there’s more - the bulk import endpoint has specific requirements for array formatting and field ordering in zs-2021.

The endpoint is pretty sensitive to payload size too. If you’re importing large batches, try breaking them into smaller chunks of 50-100 leads per request. We’ve seen the parser choke on larger arrays even when the JSON is technically valid.

We had this exact problem last month. The issue was with how we structured the JSON array. Make sure there are no trailing commas in your array elements and that all string values are properly escaped. Even though validators pass it, the Zendesk Sell parser is stricter.

Also check your character encoding - we had issues with UTF-8 BOM markers causing silent failures that manifested as JSON errors.

Have you checked the API documentation for the required fields list? In my experience, the bulk endpoint often requires additional fields that aren’t mandatory in the UI. Things like ‘source’ or ‘status’ fields might be required even if they have defaults in the web interface.

Try adding a ‘source’: ‘api’ field to each lead object and see if that helps. Also, some versions require explicit null values for optional fields rather than omitting them entirely.

I’ve seen this before. The bulk import endpoint in zs-2021 has some quirks with the schema. Check if you’re wrapping your leads array in a parent object with a ‘leads’ key. The endpoint expects {"leads": [...]} not just the raw array.

Also verify your field names match exactly what the API expects. In zs-2021, some fields use snake_case while others use camelCase. For example, ‘campaign_id’ might need to be ‘campaignId’ depending on the endpoint version. The error message isn’t always helpful about which field is causing the issue.

Another thing - make sure you’re setting the Content-Type header to ‘application/json’. I’ve seen cases where missing headers cause validation failures that report as JSON errors.