AI & Technology

n8n Instantly error: "JSON parameter needs to be valid JSON"

The n8n error "JSON parameter needs to be valid JSON" means the body n8n built for your Instantly request can't be parsed. The usual cause is an unescaped quote or line break inside an expression. Build the object first, then pass it as a real object or with JSON.stringify() instead of hand-writing JSON around expressions.

Sohail HussainSohail Hussain9 min read

Short answer

  • n8n is saying the body it built for the Instantly request is not parseable JSON, usually because an expression inserted a double quote, a line break or an object inside a hand-written JSON string.
  • Stop writing JSON around expressions. Return one object from a single expression, wrap text fields in JSON.stringify(), or build the body in a Code node.
  • The message comes from n8n, so the request most likely never reached Instantly and your API key is probably fine.

You run a workflow that sends a lead or a personalization line to Instantly, and the node fails with this:

"error": "JSON parameter needs to be valid JSON"

It worked in testing and broke on real data, or it broke the first time you added an expression. Both patterns point to the same place.

Why it happens

n8n resolves your expressions first, then parses the resulting text as JSON. If the parse fails, you get this message before anything is sent. So there is usually no HTTP status from Instantly to read, and checking the API key or campaign ID won't help.

JSON strings use double quotes only. Inside a string, a literal quote, a backslash or a raw line break has to be escaped as \", \\ and \n. An expression placed inside quotes in the body does not do that escaping for you.

Most common causes first:

CauseSymptomFix
Expression inside quotes holds a " or a line breakWorks on clean test data, fails on some itemsReturn an object, or wrap the field in JSON.stringify()
An object or array inserted inside quotesFails on every itemRemove the quotes and stringify
Missing field resolves to nothingFails on items with empty valuesDefault the value or filter those items out
Syntax slips in the hand-written JSONFails on every itemFix commas, quotes, stray characters
Stale or wrong body modeFails after switching Fixed and ExpressionRetype the body in the mode you want

I couldn't find an official n8n statement about a bug specific to the Instantly node. The error has been reported in the n8n community forum for Instantly requests, with no confirmed node bug that I could verify. Treat your own body as the suspect first.

Step-by-step fixes

Fix 1: return an object from one expression

This is the one I'd try first. A body like this works until the data gets messy:

{
  "email": "{{ $json.email }}",
  "personalization": "{{ $json.opening_line }}"
}

If opening_line is She said "hello" or spans two lines (common with AI-written text or text pasted from a CRM), the resolved body is invalid. A name like O"Brien or a company field with a trailing newline does the same.

  1. Open the failing node and find the body field. Set the body content type to JSON (in the HTTP Request node, Body Content Type > JSON with Specify Body set to Using JSON).
  2. Switch the field to Expression mode.
  3. Replace the hand-written text with one expression that returns an object:
{{ {
  email: $json.email,
  personalization: $json.opening_line
} }}
  1. Run the node with a single item that contains a quote and a line break.

n8n serializes the object, so the escaping is handled for you. Field names are illustrative; take the real ones from Instantly's API reference for the endpoint you call.

Fix 2: keep your JSON and stringify only the risky fields

If you want to keep the surrounding braces, wrap each free-text value in JSON.stringify() and remove the quotes you had around it. JSON.stringify adds its own.

{
  "email": "{{ $json.email }}",
  "personalization": {{ JSON.stringify($json.opening_line) }}
}

Leave plain values such as an email address in quotes if you trust them. Anything that comes from people, a CRM or an LLM gets JSON.stringify().

Quotes around stringify

If you keep the quotes and also call JSON.stringify, the result has doubled quotes and is invalid again. The stringified value must stand alone, with no quotes around the expression.

Fix 3: an object or array dropped into a string

If you wrote "lead": "{{ $json.lead }}" and lead is an object or array, the inserted text cannot sit inside those quotes. Remove the quotes and stringify:

"lead": {{ JSON.stringify($json.lead) }}

Or use the object-returning expression from Fix 1, which passes nested structures through untouched.

Fix 4: build the body in a Code node

When the payload is nested (a lead with custom variables, for example), separate building from sending. Add a Code node before the request node:

return $input.all().map(item => ({
  json: {
    body: {
      campaign: item.json.campaign_id,
      email: item.json.email,
      first_name: item.json.first_name,
      custom_variables: {
        opening_line: item.json.opening_line
      }
    }
  }
}));

In the request node, set the JSON body to {{ $json.body }}, or {{ JSON.stringify($json.body) }} if the field insists on a string. You can also open the Code node's output to see exactly what will be sent.

Check the key names against Instantly's current API. According to Instantly's help center, API v1 was deprecated on January 19, 2026, and API v2 is not compatible with v1, so a new API key must be generated for v2 endpoints. The same page says v2 follows strict naming rules for entities and fields (snake_case). If you copied an older workflow, its body may use v1 shapes. That would not cause this exact error, but it will cause the next one. See Instantly's API V2 article.

Fix 5: check the small syntax slips

Look at these when the data looks clean:

  • A trailing comma after the last property.
  • Single quotes around keys or values.
  • Stray text before the opening brace, often a leftover = after switching between Fixed and Expression mode.
  • An expression for a missing field that leaves a gap such as "email": ,.
  • Smart quotes pasted from a document or chat tool.

Copy the resolved body from the node's input or preview and paste it into any JSON validator. The line and column of the first failure usually point at the problem.

Which body approach to use

SituationUse
Fixed body, no dynamic textJSON with plain JSON
A few simple values (IDs, emails)JSON with an object-returning expression
Free text, nested data, AI outputCode node, then pass the object
Flat payload, many fieldsName/value body fields, if your node version offers them

Where the HTTP Request node offers a field-based body option, n8n assembles and escapes the body from name/value pairs, so there is no hand-written JSON to break. For a flat payload I'd pick it.

How to tell which cause you have

  1. Run the node with one item and open the input. Look for quotes, line breaks and backslashes in the fields you insert.
  2. Replace the suspect field with a fixed string such as test. If the error goes away, that field is the culprit.
  3. If it fails even with fixed strings, the problem is in the JSON structure itself (Fix 5) or a stale mode.
  4. If only some items fail, compare a failing item and a passing item side by side. The difference is almost always a character, or an empty field.

Test with a nasty item

Before you run a list of thousands, push one deliberately ugly item through: a quote, a backslash, a line break and an emoji. If that passes, real data usually will too.

Checklist before you run it again

  • The body has no expression inside quotes unless the value is a trusted, simple string.
  • Every free-text field uses an object expression or JSON.stringify().
  • No leftover =, trailing commas or smart quotes.
  • Items with an empty email are filtered out with an IF or Code step.
  • Field names match the current Instantly API v2 docs, and the key is a v2 key.
  • The resolved body validates as JSON when pasted into a validator.

If nothing works

If the resolved body validates and n8n still shows the message, update n8n, then try the generic HTTP Request node against Instantly's API in place of the dedicated node. If only the dedicated node fails, report it to n8n through their community forum or their GitHub issues, with these details:

  • n8n version and whether you run cloud or self-hosted
  • The node name and operation
  • The resolved body with personal data removed
  • The full error output and the time it happened
  • What you already tried
Subject: "JSON parameter needs to be valid JSON" on an Instantly request

n8n version: {version} ({cloud or self-hosted})
Node: {node name}, operation: {operation}
Error: "error": "JSON parameter needs to be valid JSON"
When: {date and time with timezone}

The body is built with: {object expression / JSON.stringify / hand-written JSON}
Resolved body (personal data removed):
{paste here}

Already tried: object-returning expression, JSON.stringify on text fields,
validating the resolved body, swapping to the generic HTTP Request node.
The same body fails / passes with: {describe}

If the request does reach Instantly and comes back with an HTTP error, that is a different problem. Contact Instantly support with the status code and response body, and say which API version and key type you use.

Common questions

Is this an Instantly error or an n8n error?

It's an n8n error. The text appears when n8n fails to parse the JSON body, before it sends anything, so Instantly never sees the request.

Why does it work for some leads and fail for others?

The body is valid until a lead's data contains a quote, a backslash or a line break, or an empty field. Escaping those characters with an object expression or JSON.stringify() fixes the whole class of failures.

Can I just replace the quotes in the text before sending?

You can, but it's fragile; you'd also have to handle backslashes, line breaks and tabs. Letting n8n serialize an object handles all of them.

Do I need a new API key to fix this error?

No, the key isn't involved in this error. But if you're still on an Instantly v1 key, you will need a v2 key for v2 endpoints, per Instantly's help center.

aiinstantlyerror-codes
Share this article
Sohail Hussain

Sohail Hussain

Founder & CEO at Mailneo

Building Mailneo — AI-powered email marketing for growing businesses.

Related Articles

AI & Technology

Apollo MCP "Error POSTing to endpoint: rate limit exceeded"

The error means Apollo's MCP endpoint rejected the client's POST before login completed, so Cursor never shows its Login button. Authenticate locally, retry later (the client does not back off), and in Claude choose the OAuth flow. A 405 on GET is normal for streamable HTTP.

Sohail Hussain|9 min read
AI & Technology

Instantly charged after you cancelled? Refund and billing steps

If Instantly charged you after you cancelled, check whether you have more than one billing service (Outreach, Credits, CRM), cancel each one, remove the saved card, and email support with dates. Reviews say replies often cite final payments, so keep records for a card dispute.

Sohail Hussain|8 min read
AI & Technology

AI Cold Email Personalization That Doesn't Sound Robotic

AI cold emails sound robotic because the model only had a name and a company to work with. Give it a real signal (a hire, a post, a launch), let it draft rather than decide, rewrite the opener by hand, and verify your contact list so bounces don't hurt you.

Sohail Hussain|10 min read
AI & Technology

AI SDR churn in 2026: are Artisan and 11x worth it?

Reddit posts claim Artisan and 11x lose most of their customers and that some buyers sent 20,000 messages with zero meetings. None of it is independently verified. The practical answer: prove your trigger, contact source and objection pattern by hand first, then decide whether automation is worth paying for.

Sohail Hussain|10 min read

Ready to supercharge your email marketing?

Start sending smarter emails with AI-powered campaigns. No credit card required.

Get Started Free