Discussions

Ask a Question
Back to all

avatar iv api help

Hi, I'm trying to make an automated video with the avatar iv api + n8n. I have a paid api pro subscription. Double checked api key, voice id and image key. But every time I test it I get an error message.

This is the endpoint im calling - https://api.heygen.com/v2/video/av4/generate

My JSON payload -

{
"caption": false,
"image_key": "image/93295637ade240a1a79e51c02000d2be/original.png",
"video_title": "Boomit AI Content Lab",

"script": “This is a test we are doing for Boomit A.I Content Lab. Let’s hope it works!",
"voice_id": "9e58c080d5854726ae54ac714e017c11",

"dimension": {
"width": 720,
"height": 1280
},

"background": {
"type": "color",
"value": "#FFFFFF"
},

"custom_motion_prompt": "presenter explaining a fintech product with natural upper body and hand gestures, confident and dynamic",
"enhance_custom_motion_prompt": true
}

Error -

{
"errorMessage": "JSON parameter needs to be valid JSON",
"errorDetails": {},
"n8nDetails": {
"nodeName": "Generate Video",
"nodeType": "n8n-nodes-base.httpRequest",
"nodeVersion": 4.3,
"itemIndex": 0,
"time": "10/12/2025, 6:08:35 p.m.",
"n8nVersion": "1.120.4 (Cloud)",
"binaryDataMode": "filesystem",
"stackTrace": [
"NodeOperationError: JSON parameter needs to be valid JSON",
" at ExecuteContext.execute (/usr/local/lib/nodemodules/n8n/node_modules/.pnpm/n8n-nodes-base@file+packages+nodes-base@[email protected]asn1.js@5_afd197edb2c1f848eae21a96a97fab23/node_modules/n8n-nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts:441:15)",
" at WorkflowExecute.executeNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core
@[email protected]@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1093:31)",
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core
@[email protected]@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1274:22)",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core
@[email protected]@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:1708:38",
" at processTicksAndRejections (node:internal/process/task_queues:105:5)",
" at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/n8n-core@file+packages+core
@[email protected]_@[email protected]_08b575bec2313d5d8a4cc75358971443/node_modules/n8n-core/src/execution-engine/workflow-execute.ts:2324:11"
]
}
}

Please help me out. Thank you