Article: Create and Publish Blog Posts with Rich Content and Images
This article demonstrates how to create and immediately publish blog posts using Wix Blog REST API, including handling external images, rich content formatting, and proper media management workflow.
IMPORTANT: When calling the Blog API as a 3rd-party app (not as the site owner), draftPost.memberId is required. The API will reject requests with "Missing post owner information" if omitted.
Query site members to get a valid member ID using List Members:
Use the id field from the response as draftPost.memberId when creating the blog post. This member will be the post author.
Note: The member ID must belong to an existing site member or collaborator. If the members query returns no results, you may need to create a member first or use the site owner's member ID.
Identify external image URLs from user input for cover images and embedded content images.
Import each external image using Import File. This converts external URLs to Wix Media IDs required for blog posts.
The response will include a file.id field. Use this ID in blog post creation. Images with operationStatus: "PENDING" can be used immediately.
Store the returned file IDs for use in blog post creation.
Create blog post using Create Draft Post for single posts, or Bulk Create Draft Posts for multiple posts.
Structure rich content using Ricos JSON format. Reference Ricos documentation for complete node structure. Common node types:
PARAGRAPH for text contentHEADING for section headersIMAGE for embedded images (requires Wix Media ID)ORDERED_LIST and BULLETED_LIST for listsBLOCKQUOTE for quoted textLIST_ITEM for individual list itemsCRITICAL: All TEXT nodes MUST be wrapped in PARAGRAPH nodes within their parent containers.
Correct Ricos structure example:
Correct BLOCKQUOTE structure:
Correct LIST_ITEM structure:
For embedded images in rich content, use IMAGE nodes with Wix Media IDs:
Set publish: true to immediately publish the post rather than saving as draft.
Resolve category IDs using List Categories if user provides category names.
Resolve tag IDs using Query Tags if user provides tag labels.
Include resolved IDs in categoryIds and tagIds arrays in the draft post object.
memberId is mandatory - use the List Members API if needed to get member IDwix:image://v1/ prefix) for both cover images and embedded imageswidth and height properties in the image object"operationStatus": "PENDING" from import can be used immediately in blog postspublish: true in the request to publish immediately rather than save as draftdraftPosts arrayfieldsets: ['URL'] to get post URLs in the responsedisplayName values during image import for better organization| Error | Cause | Solution |
|---|---|---|
| "Missing post owner information" | memberId not provided | Add draftPost.memberId - see Part 0 for how to get one |
| "memberIds ... do not exist" | Invalid member ID | Query members first using List Members API to get valid IDs |
| "Expected a paragraph node but found TEXT" | Invalid Ricos structure | Wrap TEXT nodes in PARAGRAPH nodes (see structure rules above) |
| Image not displaying | Using external URL directly | Import image via Media Manager first, then use the returned file ID |