> Documentation index: https://docs.zernio.com/llms.txt. Every page is also Markdown: add .md to its URL.

# Publishing articles

List, create, schedule, update and delete WordPress articles through the Blogs API, and the article fields they accept.

## Publish articles

WordPress uses the same article endpoints as Shopify. The differences are the single-blog model, WordPress author IDs and tag/media handling described below.

### List the site blog

Always start with [List blogs](/blogs/list-blogs):

```bash
curl "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/blogs" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

A self-hosted account returns exactly one blog with `id: "1"`:

```json
{
  "platform": "wordpress",
  "blogs": [
    {
      "id": "1",
      "platform": "wordpress",
      "title": "Example Press",
      "handle": "example.com"
    }
  ],
  "nextCursor": null
}
```

The value `"1"` is scoped to the connected account. It does not claim that the WordPress database's internal blog ID is 1.

A WordPress.com account uses its numeric WordPress.com site ID instead. Code that supports both connection types should use `blogs[0].id` from this response.

Fetch the same site metadata with [Get a blog](/blogs/get-blog):

```bash
curl "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/blogs/1" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

### Create a draft

Call [Create a blog article](/blogs/create-blog-article) with a title. New WordPress articles default to draft, so this minimal request does not publish:

```bash
curl -X POST "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/blogs/1/articles" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Autumn collection preview",
    "bodyHtml": "<p>The first pieces land next month.</p>",
    "handle": "autumn-collection-preview",
    "excerpt": "An early look at what is arriving this September.",
    "tags": ["autumn", "new arrivals"],
    "author": "42",
    "image": {
      "url": "https://cdn.example.com/autumn.jpg",
      "altText": "Wool coats on a rail"
    },
    "isPublished": false
  }'
```

**Tags.** WordPress resolves existing tags by name case-insensitively and creates a missing tag on the site. You can send up to 100 non-empty tag names.

Creating a missing term depends on the connected user's WordPress permissions.

**Author.** `author` is the numeric ID of a WordPress user who can author the post, encoded as a JSON string. It is not a login, email or display name.

Assigning another user as author can require a higher WordPress role.

**Featured image.** For `image.url`, WordPress downloads the file into that site's media library and sets the resulting attachment as the featured image.

The URL must be publicly reachable and return a JPEG, PNG, WebP or GIF no larger than 10 MB. `altText` becomes the attachment's alternative text.

Omitting `image` during a later PATCH preserves the existing featured image. This API has no featured-image removal sentinel.

Response (`201`):

```json
{
  "platform": "wordpress",
  "article": {
    "id": "1842",
    "blogId": "1",
    "platform": "wordpress",
    "title": "Autumn collection preview",
    "bodyHtml": "<p>The first pieces land next month.</p>",
    "handle": "autumn-collection-preview",
    "tags": ["autumn", "new arrivals"],
    "author": "42",
    "excerpt": "An early look at what is arriving this September.",
    "image": {
      "url": "https://example.com/wp-content/uploads/2026/09/autumn.jpg",
      "altText": "Wool coats on a rail"
    },
    "status": "draft",
    "isPublished": false,
    "publishDate": null,
    "publishedAt": null,
    "createdAt": null,
    "updatedAt": "2026-09-16T09:30:00Z"
  }
}
```

`bodyHtml` is raw article HTML. Zernio does not provide a visual editor or transform Markdown into HTML.

### Publish now

Set `isPublished: true` without a future `publishDate`:

```json
{
  "title": "Autumn collection preview",
  "bodyHtml": "<p>The first pieces are now available.</p>",
  "isPublished": true
}
```

The response reports `status: "publish"`, `isPublished: true` and the WordPress publication time in `publishedAt`.

### Schedule on WordPress

Send a future ISO 8601 `publishDate` to schedule publication natively:

```json
{
  "title": "Autumn collection preview",
  "bodyHtml": "<p>The first pieces land next month.</p>",
  "publishDate": "2027-01-01T12:00:00+01:00"
}
```

The response reports `status: "future"`, `isPublished: false` and the scheduled instant in `publishDate`.

WordPress, not Zernio's queue, publishes the article. The site must run WordPress scheduled jobs correctly. Zernio does not add a second scheduler or force publication after the requested time.

<Callout type="warn">
`isPublished: false` explicitly requests a draft and wins when it is sent alongside a future `publishDate`. Omit `isPublished` when scheduling.
</Callout>

You cannot write WordPress's raw `status` field through this API.

### List and get articles

[List blog articles](/blogs/list-blog-articles) includes every `publish`, `future`, `draft`, `pending` and `private` article visible to the connected user.

It is cursor-paginated. Pass `limit` from 1 to 50, then reuse the opaque `nextCursor` exactly as returned.

```bash
curl "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/blogs/1/articles?limit=20" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

```json
{
  "platform": "wordpress",
  "articles": [
    {
      "id": "1842",
      "blogId": "1",
      "platform": "wordpress",
      "title": "Autumn collection preview",
      "status": "draft",
      "isPublished": false,
      "publishDate": null
    }
  ],
  "nextCursor": "wp:2"
}
```

Get one article with [Get a blog article](/blogs/get-blog-article):

```bash
curl "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/blogs/1/articles/1842" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

Article IDs are WordPress post IDs represented as strings. Read them from list/create responses rather than constructing them.

### Update an article

[Update a blog article](/blogs/update-blog-article) is a partial update. Omitted fields keep their current value:

```bash
curl -X PATCH "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/blogs/1/articles/1842" \
  -H "Authorization: Bearer $ZERNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Autumn collection is here",
    "tags": ["autumn", "available now"],
    "isPublished": true
  }'
```

- `tags` replaces the full tag list; an empty array clears it.
- Empty `bodyHtml` and `excerpt` strings clear those fields.
- Sending `isPublished: false` moves a published or scheduled article back to draft.
- Omitting both `isPublished` and `publishDate` preserves its current WordPress status and publication date.

### Delete an article

[Delete a blog article](/blogs/delete-blog-article) permanently deletes the article on WordPress:

```bash
curl -X DELETE "https://zernio.com/api/v1/accounts/66b2e19d8c3f5a7e9d0b1c2d/blogs/1/articles/1842" \
  -H "Authorization: Bearer $ZERNIO_API_KEY"
```

A successful delete returns `204` with no response body. Zernio stores no copy to restore.

WordPress retains the article's media attachments and tags so other content can keep using them.

## Supported operations

| Operation | Endpoint |
|-----------|----------|
| [List blogs](/blogs/list-blogs) | `GET /v1/accounts/{accountId}/blogs` |
| [Get a blog](/blogs/get-blog) | `GET /v1/accounts/{accountId}/blogs/{blogId}` |
| [List articles](/blogs/list-blog-articles) | `GET /v1/accounts/{accountId}/blogs/{blogId}/articles` |
| [Create an article](/blogs/create-blog-article) | `POST /v1/accounts/{accountId}/blogs/{blogId}/articles` |
| [Get an article](/blogs/get-blog-article) | `GET /v1/accounts/{accountId}/blogs/{blogId}/articles/{articleId}` |
| [Update an article](/blogs/update-blog-article) | `PATCH /v1/accounts/{accountId}/blogs/{blogId}/articles/{articleId}` |
| [Delete an article](/blogs/delete-blog-article) | `DELETE /v1/accounts/{accountId}/blogs/{blogId}/articles/{articleId}` |

## Article fields

There is no `platformSpecificData` for WordPress because a WordPress site is not a `POST /v1/posts` target.

| Field | Type | Behavior |
|-------|------|----------|
| `title` | string | Required on create. |
| `bodyHtml` | string | Raw article HTML. |
| `handle` | string | WordPress post slug. Generated from the title when omitted. |
| `excerpt` | string | Short summary stored in the WordPress excerpt field. |
| `tags` | `string[]` | Tag names. The complete list replaces existing tags; missing names are created. |
| `author` | string | Numeric WordPress user ID encoded as a string. |
| `image` | `{url, altText?}` | Public image downloaded into the site's media library and set as the featured image. |
| `isPublished` | boolean | `false` creates or restores a draft; `true` publishes now unless a future date schedules it. |
| `publishDate` | datetime | ISO 8601 with offset or `Z`; a future value schedules publication on WordPress. |

Responses also include WordPress's normalized `status`: `publish`, `future`, `draft`, `pending` or `private`. This field is read-only.

`isPublished` is true only for `publish`. `publishDate` reports a scheduled future time when applicable.

**SEO.** The shared Blogs API also exposes `seo` for Shopify. WordPress rejects `seo` explicitly, because core WordPress has no portable SEO-write contract and plugin fields differ.

Zernio does not silently discard it. Use a plugin's own API outside Zernio if you need Yoast, Rank Math or another plugin's metadata.