I’m using AI nodes to generate somne text to [post to my LinkedIn, I’ve tested the credential yusing the http request GET so I know that works.
When trying to create the post for the AI generated text, I constantly get errors such as:
400 - “{"status":400,"code":"ILLEGAL_ARGUMENT","message":"Request body could not be converted to data map"}”
Full message
422 - “{"message":"ERROR :: /## Audit Log Ingestion Lag\n\nImagine you’re trying to catch a thief who just left a store :: unrecognized field found but not allowed\nERROR :: /author :: field is required but not found and has no default value\nERROR :: /commentary :: field is required but not found and has no default value\nERROR :: /visibility :: field is required but not found and has no default value\nERROR :: /distribution :: field is required but not found and has no default value\nERROR :: /lifecycleState :: field is required but not found and has no default value\n","status":422}”
Please share your workflow
Unable to copy the nodes, doesn't seem to copy the text (Edge on Windows 11)
Al nodes work OK, it's just the LinkedIn posting via HTTP request that's not posting
Share the output returned by the last node
422 - “{"message":"ERROR :: /## Audit Log Ingestion Lag\n\nImagine you’re trying to catch a thief who just left a store :: unrecognized field found but not allowed\nERROR :: /author :: field is required but not found and has no default value\nERROR :: /commentary :: field is required but not found and has no default value\nERROR :: /visibility :: field is required but not found and has no default value\nERROR :: /distribution :: field is required but not found and has no default value\nERROR :: /lifecycleState :: field is required but not found and has no default value\n","status":422}”
Both errors point to the same two root causes, and they are fixable:
The 400 “Request body could not be converted to data map” means the JSON body itself is invalid — your AI text is being injected raw, so its quotes, newlines and characters like : and # break the JSON. Fix: set the HTTP Request body to JSON mode and wrap the text with JSON.stringify so it gets escaped, e.g. the commentary value becomes ={{ JSON.stringify($json.text) }} (drop the outer quotes in the template). That alone kills the “converted to data map” error.
The 422 “field is required” list (author, commentary, visibility, distribution, lifecycleState) means you are posting to the newer /rest/posts endpoint but sending a partial body. That endpoint requires ALL of these. A minimal working body:
And two headers people usually miss: LinkedIn-Version: 202401 (use a current YYYYMM) and X-Restli-Protocol-Version: 2.0.0. Without the version header LinkedIn silently rejects the schema.
One more gotcha specific to the /rest/posts commentary field: it uses LinkedIn’s “Little Text” format, so literal (, ), <, >, @, #, * and a few others must be escaped with a backslash or the request 422s. If your AI text contains markdown headers (##) or parentheses, strip or escape them before sending. Your example text had ## and :: in it, which is almost certainly what tipped it over.
If you paste the exact node config (endpoint URL + which fields you send) I can point at the specific missing piece.
We have taken a look at this issue and are unable to confirm that this is a bug, For now we have closed the internal ticket but if it starts to look like it is a bug our moderation team will flag this again.
Also worth noting: the 4000 character limit applies to the text field. If you’re using AI to generate content, add a length check before sending — otherwise the API will just reject the request silently.