AuthorityWriter / Docs
Integration 1 · WordPress

WordPress publishing API

Install the AuthorityWriter Publisher plugin on your WordPress website, generate a secret key, and publish or update posts from AuthorityWriter.

Base URL: https://your-wordpress-site.example

Setup

  1. Download and install the AuthorityWriter Publisher plugin.
  2. Activate the plugin in WordPress.
  3. Open WordPress Admin → Settings → AuthorityWriter.
  4. Generate or copy the secret API key.
  5. Save the WordPress site URL and key in AuthorityWriter Website Settings.

Keep the key private. Send it only through the HTTPS header shown below.

Authentication

Every request requires this header:

X-AuthorityWriter-Key: aw_live_your_secret_key

Missing keys return 401. Incorrect keys return 403.

GET

Connection ping

/wp-json/authoritywriter/v1/ping

Use this endpoint to verify the plugin, WordPress site, and API key before publishing.

curl -X GET "https://your-wordpress-site.example/wp-json/authoritywriter/v1/ping" \
  -H "X-AuthorityWriter-Key: aw_live_your_secret_key" \
  -H "Accept: application/json"
{
  "status": "success",
  "site_name": "Example Website",
  "site_url": "https://your-wordpress-site.example",
  "wp_version": "6.6.1"
}
POST

Publish or update a post

/wp-json/authoritywriter/v1/publish-post

Creates a post or updates an existing post with the same slug. Use draft while testing.

curl -X POST "https://your-wordpress-site.example/wp-json/authoritywriter/v1/publish-post" \
  -H "X-AuthorityWriter-Key: aw_live_your_secret_key" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "How to Choose Running Shoes for Flat Feet",
    "content": "<p>Helpful article HTML goes here.</p>",
    "slug": "running-shoes-for-flat-feet",
    "status": "draft",
    "focus_keyword": "running shoes for flat feet",
    "meta_description": "Learn how to choose comfortable running shoes for flat feet.",
    "featured_image": "https://cdn.example.com/shoes.jpg",
    "featured_image_alt": "Running shoes selected for flat feet",
    "category": "Running Gear",
    "sub_category": "Buying Guides",
    "categories": [12, 18],
    "json_ld_schema": "{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\"}"
  }'

Fields

FieldTypeRequiredDetails
titlestringYesPost title.
contentstringYesHTML; sanitized by WordPress.
slugstringNoDefaults from title; same slug updates the post.
statusenumNodraft, publish, or pending. Default: draft.
focus_keywordstringNoSaved for Yoast and Rank Math.
meta_descriptionstringNoSaved for Yoast and Rank Math.
featured_imageURL/data URLNoImported into the Media Library.
featured_image_altstringNoAccessible image alt text.
json_ld_schemaJSON stringNoStored and printed as JSON-LD.
category/sub_categorystringNoCategory names.
categoriesinteger[]NoWordPress IDs; takes precedence over names.

Response fields

categories contains the final assigned WordPress category names. featured_image_result reports featured-image import success or warning. inline_images_result.imported lists each in-article source URL, local Media Library URL, and attachment ID. inline_images_result.warnings lists non-fatal inline-image import failures.

Success response

{
  "status": "success",
  "post_id": 428,
  "post_url": "https://your-wordpress-site.example/running-shoes-for-flat-feet/",
  "post_status": "draft",
  "categories": ["Running Gear", "Buying Guides"],
  "featured_image_result": "attached (media id 991)",
  "inline_images_result": {
    "imported": [
      {
        "source_url": "https://authoritywriter.com/storage/article-images/inline.jpg",
        "local_url": "https://your-wordpress-site.example/wp-content/uploads/2026/09/aw-inline-428-1234.jpg",
        "attachment_id": 992
      }
    ],
    "warnings": []
  }
}

Category mapping

Send either category names or existing WordPress category IDs.

"category": "Running Gear",
"sub_category": "Buying Guides",
"categories": [12, 18]

Use either names or IDs according to your workflow; do not rely on both for conflicting taxonomies.

The featured_image request field accepts an HTTPS image URL or supported base64 data URL. The plugin imports it into the WordPress Media Library, sets it as the featured image, and saves featured_image_alt.

In-article images are also uploaded first: Before the final post update, the plugin finds each remote <img src="..."> inside content, downloads it, validates the actual image type, imports it into the WordPress Media Library, preserves its alt text, and rewrites the HTML src to the new local WordPress attachment URL. The image stays in its original section and position.

Original HTML:
<img src="https://authoritywriter.com/storage/article-images/inline.jpg" alt="Stability features">

After WordPress import:
<img src="https://your-wordpress-site.example/wp-content/uploads/2026/09/aw-inline-428-1234.jpg" alt="Stability features">

The success response includes inline_images_result.imported with the source URL, local URL, and attachment ID. Failed inline images are listed in inline_images_result.warnings; the post is still returned with a warning.

Security: Use HTTPS image URLs from trusted hosts. Image download failures do not remove the article; check the warning fields and WordPress logs.

Errors

{
  "code": "bad_request",
  "message": "Title and Content are required fields",
  "data": { "status": 400 }
}

400 missing fields · 401 missing key · 403 incorrect key · 500 WordPress insert/update failure.