← All documentation
Networks

WordPress

Publish blog posts to a self-hosted WordPress site (not wordpress.com).

Connect

Credential-based — no OAuth. The customer creates an Application Password (WP admin → Users → Profile → Application Passwords) and connects:

curl -X POST https://api.herald.leiritech.com/v1/accounts/wordpress \
  -H "Authorization: Bearer hld_…" -H "Content-Type: application/json" \
  -d '{"site_url":"https://blog.example.com","username":"admin","app_password":"xxxx xxxx xxxx xxxx"}'
{ "id":"…","network":"wordpress","display_name":"My Blog","status":"active" }

Herald validates the site + credential (/wp-json/wp/v2/users/me) and stores it encrypted. 422 if the site/REST API is unreachable or the credentials are wrong.

Publish

WordPress posts have a title (required) and an HTML body (text):

curl -X POST https://api.herald.leiritech.com/v1/posts \
  -H "Authorization: Bearer hld_…" -H "Content-Type: application/json" \
  -d '{"targets":["<wp-uuid>"],"title":"My Post","text":"<p>Hello world</p>","media_ids":["b1c2…"],"mode":"now"}'
{ "id":"…","status":"published","title":"My Post",
  "targets":[{"network":"wordpress","status":"published","permalink":"https://blog.example.com/?p=123"}] }

Rules & gotchas

  • title is required for WordPress targets (a post to a mixed set that includes WP must include a title).
  • text is the post body and accepts HTML.
  • The first image in media_ids becomes the post's featured image (best-effort — a featured-image failure won't fail the post).
  • REST API must be enabled and reachable over HTTPS.