About the Draft Posts API
The Draft Posts API allows users to create and manage draft posts. A draft post is an article written by a site collaborator who is given the appropriate roles and permissions.
With the Draft Posts API, you can:
- Create and update draft posts.
- Publish draft posts.
- Update multiple draft posts.
- Delete draft posts.
- Restore deleted draft posts from the trash bin.
With Wix Pricing Plans, exclusive blog content can only be accessed by readers with a subscription. Learn more about creating blog post subscriptions.
Learn more about Wix Blog.
Note: translationId
is only returned in the draftPost
object if the Multilingual app is installed.
Terminology
- Post: A published article on a blog site. It is also referred to as a publication. A blog can have up to 100K posts.
- Draft Post: An article written by a site owner, blog editor, blog writer, or a guest writer that is not yet published.
- Category: A group of similar and related posts. A post can be assigned to a maximum of 10 categories.
- Tag: A way to further sort and organize blog posts. Tags provide the ability to filter blog posts.
Draft Posts: Supported Filters and Sorting
The following table shows field support for filters and sorting for the Draft Post object:
Field | Supported Filters | Sortable |
---|---|---|
id | $eq , $ne , $hasSome , $not | Sortable |
title | $eq , $ne , $contains , $startsWith , $endsWith , $hasSome , $lt , $lte , $gt , $gte , $exists , $in | Sortable |
excerpt | $eq , $ne , $contains , $startsWith , $endsWith , $hasSome , $lt , $lte , $gt , $gte , $exists , $in | Sortable |
featured | $eq , $ne | Sortable |
categoryIds | $hasSome , $hasAll | |
memberId | $eq , $ne , $hasSome | |
hashtags | $hasSome , $hasAll | |
commentingEnabled | $eq , $ne | Sortable |
minutesToRead | $eq , $ne , $lt , $lte , $gt , $gte , $in | |
tagIds | $hasSome , $hasAll | |
pricingPlanIds | $hasSome , $hasAll | |
translationId | $eq , $ne , $contains , $startsWith , $endsWith , $hasSome , $lt , $lte , $gt , $gte , $exists , $in | |
language | $eq , $ne , $contains , $startsWith , $endsWith , $hasSome , $lt , $lte , $gt , $gte , $exists , $in | |
status | $eq , $ne , $contains , $startsWith , $endsWith , $hasSome , $lt , $lte , $gt , $gte , $exists , $in | |
hasUnpublishedChanges | $eq , $ne | |
editedDate | $lt , $lte , $gt , $gte | Sortable |
scheduledPublishDate | $lt , $lte , $gt , $gte | Sortable |
Related content: API Query Language, Query Draft Posts
Blog Submodule Docs
Retrieves a list of up to 100 draft posts per request.
List Draft Posts runs with these defaults, which you can override:
editedDate
is sorted in descending order.paging.limit
is50
.paging.offset
is0
.
Permission Scopes
For app development, you must have one of the following permission scopes:Creates a draft post.
A draft post's memberId is required for 3rd-party apps.
Permission Scopes
For app development, you must have one of the following permission scopes:Creates multiple draft posts.
Permission Scopes
For app development, you must have one of the following permission scopes:Updates multiple draft posts.
Permission Scopes
For app development, you must have one of the following permission scopes:Retrieves a list of up to 100 deleted draft posts.
List Draft Posts runs with these defaults, which you can override:
editedDate
is sorted in descending order. In this case,editedDate
implies the date the post was deleted.paging.limit
is50
.paging.offset
is0
.
Permission Scopes
For app development, you must have one of the following permission scopes:Gets a draft post by the provided ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Moves a draft post to the trash bin.
A published post can also be deleted by the post ID
.
To permanently delete a post bypassing the trash bin, set the permanent
field value to true
. The post can't be restored after this.
Permission Scopes
For app development, you must have one of the following permission scopes:Updates a draft post.
Permission Scopes
For app development, you must have one of the following permission scopes:Gets a deleted draft post from the trash bin by the provided ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Permanently deletes a draft post that is currently in the trash bin.
Permission Scopes
For app development, you must have one of the following permission scopes:Deletes multiple draft posts.
Permission Scopes
For app development, you must have one of the following permission scopes:Restores a deleted draft post from the trash bin by the provided ID.
Permission Scopes
For app development, you must have one of the following permission scopes:Retrieves a list of up to 100 draft posts, given the provided paging, filtering, and sorting.
Query Draft Posts runs with these defaults, which you can override:
editedDate
is sorted inDESC
order.paging.limit
is50
.paging.offset
is0
.
For field support for filters and sorting, see Field Support for Filtering and Sorting.
To learn about working with Query endpoints, see API Query Language, Sorting and Paging, and Field Projection.
Permission Scopes
For app development, you must have one of the following permission scopes:Publishes a specified draft post by ID. This creates a new post entity with the data from the draft post. If the specified draft post was already published, the published post will be updated with the latest values from the draft post entity.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a draft post is created.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a draft post is updated.
Permission Scopes
For app development, you must have one of the following permission scopes:Triggered when a draft post is deleted.