Method Parameters

Query Parameters

(default) Formats the output as HTML for display. Shortcodes are parsed, paragraph tags are added, etc..

edit:

Formats the output for editing. Shortcodes are left unparsed, significant whitespace is kept, etc..

http_envelope

(bool)

false:

(default)

true:

Some environments (like in-browser JavaScript or Flash) block or divert responses with a non-200 HTTP status code. Setting this parameter will force the HTTP status code to always be 200. The JSON response is wrapped in an "envelope" containing the "real" HTTP status code and headers.

pretty

(bool)

false:

(default)

true:

Output pretty JSON

meta

(string)

Optional. Loads data from the endpoints found in the 'meta' part of the response. Comma-separated list. Example: meta=site,likes

True or false if the post be publicized to external services. An array of services if we only want to publicize to a select few. Defaults to true.

publicize_message

(string)

Custom message to be publicized to external services.

status

(string)

publish:

(default) Publish the post.

private:

Privately publish the post.

draft:

Save the post as a draft.

future:

Schedule the post (alias for publish; you must also set a future date).

pending:

Mark the post as pending editorial approval.

trash:

Set the post as trashed.

sticky

(bool)

false:

(default) Post is not marked as sticky.

true:

Stick the post to the front page.

password

(string)

The plaintext password protecting the post, or, more likely, the empty string if the post is not password protected.

parent

(int)

The post ID of the new post's parent.

terms

(object)

Mapping of taxonomy to comma-separated list or array of term names

terms_by_id

(object)

Mapping of taxonomy to comma-separated list or array of term IDs

categories

(array|string)

Comma-separated list or array of category names

categories_by_id

(array|string)

Comma-separated list or array of category IDs

tags

(array|string)

Comma-separated list or array of tag names

tags_by_id

(array|string)

Comma-separated list or array of tag IDs

format

(string)

default:

(default) Use default post format

standard:

Standard

aside:

Aside

chat:

Chat

gallery:

Gallery

link:

Link

image:

Image

quote:

Quote

status:

Status

video:

Video

audio:

Audio

discussion

(object)

A hash containing one or more of the following boolean values, which default to the blog's discussion preferences: `comments_open`, `pings_open`

likes_enabled

(bool)

Should the post be open to likes?

menu_order

(int)

(Pages only) the order pages should appear in. Use 0 to maintain alphabetical order.

page_template

(string)

(Pages Only) The page template this page should use.

sharing_enabled

(bool)

Should sharing buttons show on this post?

featured_image

(string)

The post ID of an existing attachment to set as the featured image. Pass an empty string to delete the existing image.

media

(media)

An array of files to attach to the post. To upload media, the entire request should be multipart/form-data encoded. Multiple media items will be displayed in a gallery. Accepts jpg, jpeg, png, gif, pdf, doc, ppt, odt, pptx, docx, pps, ppsx, xls, xlsx, key. Audio and Video may also be available. See allowed_file_types in the options resposne of the site endpoint.

An array of URLs for images to attach to a post. Sideloads the media in for a post.

metadata

(array)

Array of metadata objects containing the following properties: `key` (metadata key), `id` (meta ID), `previous_value` (if set, the action will only occur for the provided previous value), `value` (the new value to set the meta to), `operation` (the operation to perform: `update` or `add`; defaults to `update`). All unprotected meta keys are available by default for read requests. Both unprotected and protected meta keys are available for authenticated requests with proper capabilities. Protected meta keys can be made available with the rest_api_allowed_public_metadata filter.

Response Parameters

Parameter

Type

Description

ID

(int)

The post ID.

site_ID

(int)

The site ID.

author

(object)

The author of the post.

date

(iso 8601 datetime)

The post's creation time.

modified

(iso 8601 datetime)

The post's most recent update time.

title

(html)

context dependent.

URL

(url)

The full permalink URL to the post.

short_URL

(url)

The wp.me short URL.

content

(html)

context dependent.

excerpt

(html)

context dependent.

slug

(string)

The name (slug) for the post, used in URLs.

guid

(string)

The GUID for the post.

status

(string)

publish:

The post is published.

draft:

The post is saved as a draft.

pending:

The post is pending editorial approval.

private:

The post is published privately

future:

The post is scheduled for future publishing.

trash:

The post is in the trash.

auto-draft:

The post is a placeholder for a new post.

sticky

(bool)

Is the post sticky?

password

(string)

The plaintext password protecting the post, or, more likely, the empty string if the post is not password protected.

parent

(object|false)

A reference to the post's parent, if it has one.

type

(string)

The post's post_type. Post types besides post, page and revision need to be whitelisted using the rest_api_allowed_post_types filter.

discussion

(object)

Hash of discussion options for the post

likes_enabled

(bool)

Is the post open to likes?

sharing_enabled

(bool)

Should sharing buttons show on this post?

like_count

(int)

The number of likes for this post.

i_like

(bool)

Does the current user like this post?

is_reblogged

(bool)

Did the current user reblog this post?

is_following

(bool)

Is the current user following this blog?

global_ID

(string)

A unique WordPress.com-wide representation of a post.

featured_image

(url)

The URL to the featured image for this post if it has one.

post_thumbnail

(object)

The attachment object for the featured image if it has one.

format

(string)

standard:

Standard

aside:

Aside

chat:

Chat

gallery:

Gallery

link:

Link

image:

Image

quote:

Quote

status:

Status

video:

Video

audio:

Audio

geo

(object|false)

menu_order

(int)

(Pages Only) The order pages should appear in.

page_template

(string)

(Pages Only) The page template this page is using.

publicize_URLs

(array)

Array of Twitter and Facebook URLs published by this post.

terms

(object)

Hash of taxonomy names mapping to a hash of terms keyed by term name.

tags

(object)

Hash of tags (keyed by tag name) applied to the post.

categories

(object)

Hash of categories (keyed by category name) applied to the post.

attachments

(object)

Hash of post attachments (keyed by attachment ID). Returns the most recent 20 attachments. Use the `/sites/$site/media` endpoint to query the attachments beyond the default of 20 that are returned here.

attachment_count

(int)

The total number of attachments for this post. Use the `/sites/$site/media` endpoint to query the attachments beyond the default of 20 that are returned here.

metadata

(array)

Array of post metadata keys and values. All unprotected meta keys are available by default for read requests. Both unprotected and protected meta keys are available for authenticated requests with access. Protected meta keys can be made available with the rest_api_allowed_public_metadata filter.

meta

(object)

API result meta data

capabilities

(object)

List of post-specific permissions for the user; publish_post, edit_post, delete_post

revisions

(array)

List of post revision IDs. Only available for posts retrieved with context=edit.