Need help with your APIs? I offer API discovery, governance & evangelism services. Explore services →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

WordPress Posts API

Manage WordPress posts

WordPress Posts API is one of 17 APIs that WordPress publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

This API exposes 14 JSON Schema definitions.

Tagged areas include Posts. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, an API reference, authentication docs, a getting-started guide, and 14 JSON Schemas.

This API exposes 5 operations across 2 paths, and defines 4 schemas. It is described by OpenAPI 3.0.3, at version v2.

Requests are made against a single base URL, https://{site}/wp-json.

5 operations 2 paths 4 schemas 1 DELETE2 GET1 POST1 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.0.3
API Version
v2
Base URL
https://{site}/wp-json
Authentication
API Key, HTTP Basic, HTTP Basic
Resource Areas
1

Authentication & Security 3

WordPress Posts API declares 3 security schemes for authenticating requests. An API key is passed in the cookie as wordpress_logged_in (cookieAuth). It accepts HTTP basic authentication (basicAuth). It accepts HTTP basic authentication (applicationPassword). By default, every request must be authenticated.

  • cookieAuth — WordPress cookie authentication with nonce (X-WP-Nonce header required)
  • basicAuth — HTTP Basic Authentication using Application Passwords (WordPress 5.6+)
  • applicationPassword — Application Passwords - generate per-application passwords from user profile in WordPress admin

Paths & Operations 5

Across 2 paths, the API surfaces 5 operations — 1 DELETE, 2 GET, 1 POST, 1 PUT. Each is listed below with its method, path, parameters, and response codes.

Posts 5

Manage WordPress posts

GET
/wp/v2/posts
WordPress List Posts
listPosts 10 params → 200401
POST
/wp/v2/posts
WordPress Create Post
createPost body → 201400401
GET
/wp/v2/posts/{id}
WordPress Get Post
getPost 2 params → 200404
PUT
/wp/v2/posts/{id}
WordPress Update Post
updatePost 1 param body → 200404401
DELETE
/wp/v2/posts/{id}
WordPress Delete Post
deletePost 2 params → 200404

Schemas 4

The contract defines 4 schemas that model the data the API accepts and returns. The most detailed are Post (20 properties), PostInput (8 properties), ErrorResponse (3 properties), RenderedContent (2 properties). Each schema is shown below with its type and property counts.

Post
object
A WordPress post object
20 properties
PostInput
object
Input schema for creating or updating a post
8 properties
RenderedContent
object
A rendered content object containing raw and rendered versions
2 properties
ErrorResponse
object
A WordPress REST API error response
3 properties

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

wordpress-posts-api-openapi.yml Raw ↑

Other APIs WordPress publishes across the network.

WordPress Block Editor API
WordPress AI API
WordPress Block Types API
WordPress Blocks API
WordPress Categories API
WordPress Comments API
WordPress Media API
WordPress Pages API
WordPress Plugins API
WordPress Post Types API
WordPress Search API