Trying to post a Blog article to my blog via the Wix Blog API

Question:
I am trying to automate blog posts via API but it is not working.

Product:
Wix Editor with Velo Dev Mode

What are you trying to achieve:
I have a Wix site with a blog section, and I am tryin to automate blog posts to it. I am using n8n for this. I have created two files in my backend: a blog.web.js file that contains a function for posting the article and a http-functions.js file to expose the function as a HTTP endpoint. From n8n, I send a HTTP POST request with a JSON payload that contains the article and a cover image in base64 format. The script works by uploading the image to the Media Manager and then receives a link to the image and adds it to the article before posting. Image upload works however the actual posting of the article fails.

What have you already tried:
I have used the following API docs to build the script:
/draft-posts/introduction
/methods-for-http-functions

I have enabled logging in my Wix dashboard during testing and I can see the image upload however the posting fails with a “BAD_REQUEST” error.

Additional information:
Here are the full logs with timestamps from my Wix dashboard with the last message shown first. As you can see the script works up until the actual blog post. The cover image gets uploaded successfully, but then when it tries to post the blog article it fails. I am also attaching a link to the JSON object I am sending in the body of the POST request, which I believe is in the right format/schema. I have also attached a video walkthrough of the

INFO 14:54:33.142

Received result from blog.web.js: {
"status": 500,
"body": {
"success": false,
"error": {
"message": "Operation failed: message: Expected an object\ndetails:\n applicationError:\n description: Bad Request\n code: BAD_REQUEST\n data: {}",
"code": "BLOG_OPERATION_ERROR",
"details": {
"applicationError": {
"description": "Bad Request",
"code": "BAD_REQUEST",
"data": {}
}
}
}
},
"headers": {}
}
backend/http-functions.js

ERROR 14:54:33.135

Error in post_postBlogArticle: message: Expected an object
details:
applicationError:
description: Bad Request
code: BAD_REQUEST
data: {} Error: message: Expected an object
details:
applicationError:
description: Bad Request
code: BAD_REQUEST
data: {}
at buildError (/dynamic-modules/edm_root/b98f5974-98fa-4e37-81ae-122ca7b30752/node_modules/@wix/motion-edm-autogen-transformations/src/lib/transformations/transformError/index.ts:44:17)
at buildApplicationError (/dynamic-modules/edm_root/b98f5974-98fa-4e37-81ae-122ca7b30752/node_modules/@wix/motion-edm-autogen-transformations/src/lib/transformations/transformError/index.ts:136:12)
at transformError (/dynamic-modules/edm_root/b98f5974-98fa-4e37-81ae-122ca7b30752/node_modules/@wix/motion-edm-autogen-transformations/src/lib/transformations/transformError/index.ts:217:14)
at transformError (/dynamic-modules/edm_root/b98f5974-98fa-4e37-81ae-122ca7b30752/node_modules/@wix/metro-runtime/src/transformation-handler.ts:122:32)
at /dynamic-modules/edm_root/b98f5974-98fa-4e37-81ae-122ca7b30752/node_modules/@wix/wix-blog-backend/src/blog-v3-draft.universal.ts:3267:44
at Generator.throw (<anonymous>)
at rejected (/dynamic-modules/edm_root/b98f5974-98fa-4e37-81ae-122ca7b30752/node_modules/@wix/wix-blog-backend/build/cjs/src/blog-v3-draft.universal.js:25:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
backend/blog.web.js

INFO 14:54:32.861

Calling draftPosts.createDraftPost with options: {"publish":true}
backend/blog.web.js

INFO 14:54:32.858

Final draftPostData prepared for API: {
"title": "Unlock Your Creative Potential: A Beginner's Guide to Midjourney AI",
"richContent": {
"nodes": "38 nodes"
},
"coverMedia": "Present",
"seoData": {
"title": "Unlock Your Creative Potential: A Beginner's Guide to Midjourney AI",
"description": "Midjourney has quickly become a favorite for generating amazing AI art. In this guide, we'll walk you through the basics, from signing up to crafting detailed p",
"tags": [
"Midjourney",
"AI Art",
"Digital Art",
"AI Tools"
]
},
"hashtags": [
"Midjourney",
"AI Art",
"Digital Art",
"AI Tools"
],
"slug": "unlock-your-creative-potential-a-beginners-guide-to-midjourney-ai",
"language": "en",
"commentingEnabled": true
}
backend/blog.web.js

INFO 14:54:32.852

Pause complete.
backend/blog.web.js

INFO 14:54:30.849

Pausing for 2000ms after media upload...
backend/blog.web.js

INFO 14:54:30.846

Updated coverMedia.wixMedia with upload results: {
"fileUrl": "wix:image://v1/3134c4_123c1935f9304d759ee7803ed3aae3b8~mv2.png/blog-cover-1743861267836.png#originWidth=1024&originHeight=680",
"width": 1024,
"height": 680
}
backend/blog.web.js

INFO 14:54:30.843

Cover image upload successful: {
"fileName": "3134c4_123c1935f9304d759ee7803ed3aae3b8~mv2.png",
"mediaType": "image",
"isPrivate": false,
"sizeInBytes": 660381,
"mimeType": "image/png",
"iconUrl": "wix:image://v1/3134c4_123c1935f9304d759ee7803ed3aae3b8~mv2.png/blog-cover-1743861267836.png#originWidth=1024&originHeight=680",
"fileUrl": "wix:image://v1/3134c4_123c1935f9304d759ee7803ed3aae3b8~mv2.png/blog-cover-1743861267836.png#originWidth=1024&originHeight=680",
"parentFolderId": "0f5412db3a1747f4bcd35fc241bc5199",
"originalFileName": "blog-cover-1743861267836.png",
"hash": "22b5ced77299215b686429aaf31c3347",
"labels": [
"permanent makeup",
"regard",
"eye make-up",
"make-up",
"face make up",
"retouching",
"beauty portrait",
"brow makeup",
"portrait photography",
"natural sustainable cosmetics product",
"eye make up",
"makeup/cosmetics",
"cosmetic products",
"easy retouch",
"beauty fashion",
"make up",
"dermal filler",
"visage",
"hair and makeup styling",
"cosmetic product"
],
"width": 1024,
"height": 680,
"_createdDate": "2025-04-05T13:54:30.000Z",
"_updatedDate": "2025-04-05T13:54:30.000Z"
}
backend/blog.web.js

INFO 14:54:27.836

Uploading cover image: blog-cover-1743861267836.png, MIME: image/png
backend/blog.web.js

INFO  14:54:27.835

Base64 cover media detected. Starting upload process...
backend/blog.web.js

INFO 14:54:27.834

Input validation passed.
backend/blog.web.js

INFO 14:54:27.740

Forwarding request to blog.web.js/postBlogArticle...
backend/http-functions.js

draftPost.json file sent in in payload of HTTP POST request

Video walkthrough of a test