{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/writavo-com/json-schema/writavo-com-article-schema.json",
  "title": "Article",
  "description": "An article. `content` is **markdown**, not HTML, in both directions: what you send is\nwhat is stored, and it is rendered at publish time. Send markdown.\n\nWhere the article came from is `source` (see `ArticleSource`): returned on\n`GET /articles/{id}` to a secret key only, never to a publishable key, never in a list and\nnever in a webhook payload, because it is private provenance, not content.\n\nSeveral pipeline columns are deliberately absent from this schema rather than exposed as\nread only, because they describe the engine's internal working rather than your content:\nthe image job handle and image ladder stage (vendor\njob state that changes shape when we change provider), the raw quality critique (an\nunstable model output), the source page's SEO score (a number about someone else's page),\nthe dispatcher's priority ordering knob, and the rewrite attempt counter. Exposing any of\nthem would freeze an internal detail into a contract we have promised not to break.\n\n`quality_score` **is** exposed, read only, because it is a stable, meaningful number\nabout your own article.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/writavo-com-openapi.json#/components/schemas/Article",
  "type": "object",
  "required": [
    "id",
    "status"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "readOnly": true
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/ArticleStatus"
        }
      ],
      "readOnly": true,
      "description": "Read only here. Change it with the lifecycle endpoints."
    },
    "article_kind": {
      "type": "string",
      "enum": [
        "article",
        "news",
        "page"
      ],
      "description": "`article` is a post; `news` a news story written by a news recipe (NewsArticle markup, the\nGoogle News sitemap); `page` a page such as About or Contact: served at the blog's root like\na post, but with no byline or date, never in the blog's listings or RSS feed, and never\nrewritten by the AI pipeline. Pages and posts share one URL space.\n"
    },
    "title": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 300
    },
    "slug": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200,
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "The URL segment on your blog. Unique within the Site; a collision is\n`409 SLUG_CONFLICT`. May be null on a draft, and is required to publish.\n"
    },
    "external_id": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 255,
      "pattern": "^[!-~]+$",
      "description": "Your own stable id for this article in the system it came from, such as the\nprimary key in your old CMS. Printable ASCII, no spaces. Unique within the Site: a\nsecond article with the same value is `409 CONFLICT`. Null for anything written in\nWritavo. Filter on it with `GET /articles?external_id=`.\n"
    },
    "body_format": {
      "type": "string",
      "enum": [
        "markdown",
        "json"
      ],
      "readOnly": true,
      "description": "`json` when the article was last saved from the dashboard's rich editor: `body_json` is\nthen its document and `content` that document's exact markdown. `markdown` otherwise.\nWriting `content` through this API makes it `markdown` again.\n"
    },
    "body_json": {
      "type": [
        "object",
        "null"
      ],
      "readOnly": true,
      "description": "The rich editor's document (ProseMirror JSON: doc, paragraph, heading, lists, table,\nimage, codeBlock, embed, markdownRaw, and the bold / italic / strike / code / link marks)\nwhen `body_format` is `json`, else null. Not in the list default. `content` always holds\nthe same body as markdown, so a reader that only knows markdown loses nothing.\n"
    },
    "content": {
      "type": [
        "string",
        "null"
      ],
      "description": "The body, in markdown. Not returned in the list default projection; ask for it by\nname or fetch the article individually.\n\n**Embeds.** A line on its own of the form `::embed{url=\"https://...\"}` renders as an\nembedded YouTube or Vimeo player, or a link card for a post on X, on your blog and in\n`content_html`. Any other URL renders as a plain link. Raw HTML (an `<iframe>`) is\nnever rendered, so use this line instead.\n"
    },
    "excerpt": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 1000
    },
    "featured_image_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "featured_image_alt": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 500,
      "description": "Alt text for `featured_image_url`: what the image shows, for screen readers and image\nsearch. Rendered as the hero image's `alt` and as `og:image:alt` on your blog. Null\nwhen none has been written, and your blog then uses the article title.\n"
    },
    "seo_title": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    },
    "seo_description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 400
    },
    "seo_keywords": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "faqs": {
      "type": [
        "array",
        "null"
      ],
      "description": "Question and answer pairs, rendered as FAQ structured data on your blog.",
      "items": {
        "type": "object",
        "required": [
          "question",
          "answer"
        ],
        "properties": {
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          }
        }
      }
    },
    "key_takeaways": {
      "type": [
        "array",
        "null"
      ],
      "description": "Short summary bullets rendered above the body.",
      "items": {
        "type": "string"
      }
    },
    "howto_steps": {
      "type": [
        "object",
        "null"
      ],
      "description": "A how-to: its own title and summary, and the ordered steps. Rendered on the blog and as\nHowTo structured data. `name` and `description` are \"\" when the how-to has none. On a\nwrite, a bare array of steps is also accepted and stored in this shape.\n",
      "properties": {
        "name": {
          "type": "string",
          "description": "The how-to's own title."
        },
        "description": {
          "type": "string",
          "description": "A short summary of the how-to."
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "image_url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    },
    "comparison": {
      "type": [
        "object",
        "null"
      ],
      "description": "A comparison table, rendered as a table in the body.",
      "properties": {
        "title": {
          "type": "string",
          "description": "The table's own heading. \"\" when it has none."
        },
        "headers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "rows": {
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "category_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The PRIMARY category, shown on the article and used for its breadcrumb. Always one of `category_ids`."
    },
    "category_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Every category the article is filed under, the primary first (at most 20). Not in the list\ndefault projection; ask for it with `fields`.\n"
    },
    "author_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "format_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The article format. See `GET /formats`."
    },
    "tag_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "description": "Every tag on this article. On `PATCH` this is a full replacement, not a merge: send\nthe complete set you want, and send `[]` to clear.\n"
    },
    "quality_score": {
      "type": [
        "number",
        "null"
      ],
      "readOnly": true,
      "description": "The engine's quality rating out of 100 for an article it wrote. Null for anything\nwritten by hand.\n"
    },
    "published_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "When the article was **first** made public. Set by the first publish and never\nchanged after, including across an unpublish and republish, because it is your blog's\nordering key. An imported article's first publish may supply its original date.\n"
    },
    "scheduled_publish_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "Set through `POST /articles/{id}/schedule`."
    },
    "scheduled_unpublish_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "When a published article comes down on its own. Set through `POST /articles/{id}/schedule-unpublish`; cleared by any unpublish."
    },
    "content_updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true,
      "description": "When what a reader sees last changed: the title, slug, body, excerpt, images, SEO\nfields, structured blocks, category or author. Unlike `updated_at` it ignores internal\nbookkeeping, so it is the honest value for `dateModified` and a sitemap `lastmod`.\n"
    },
    "original_published_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the article was ORIGINALLY published in the system it was imported from. Record it\non create or update and the article's **first** publish, from any path (the dashboard,\n`POST /articles/{id}/publish`, an MCP client, a schedule or the pipeline), sets\n`published_at` to this date instead of now. Has no effect once `published_at` is set.\nNever shown on your blog on its own. Not in the list default (ask for it with `fields`),\nand never returned to a publishable key.\n\n**Setting or correcting it by hand:** `PATCH /articles/{id}` with a secret key that has\n`articles:write`, at any time; only its value at the moment of the first publish counts.\nSend `null` to clear it (the first publish then uses the time of publishing). There is no\nfield for it in the dashboard; the dashboard shows it next to the Publish button, and\npublishing from there uses it. Stored to the millisecond: finer digits are dropped.\n"
    },
    "original_content_updated_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the imported article's content last changed at its source. Needs\n`original_published_at` and may not be earlier than it. While the article has never been\npublished, `content_updated_at` follows it (or `original_published_at` when it is null),\nso the first publish keeps the source's `lastmod`; an edit made in Writavo before then\nmoves `content_updated_at` to the edit time as usual. Never returned to a publishable key.\n"
    },
    "canonical_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 2048,
      "description": "The canonical URL override, an absolute http(s) URL. Set it when this article's primary\ncopy lives at another address (a syndicated post). Null means the article's own URL.\nAn article whose canonical points anywhere else is left out of your sitemap.\n"
    },
    "noindex": {
      "type": "boolean",
      "description": "`true` asks search engines not to index the page (`robots: noindex`) and leaves it out\nof your sitemap. The page stays reachable, listed on your blog and in your RSS feed.\n"
    },
    "og_title": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200,
      "description": "The social-share title (`og:title`). Null means `seo_title`, then `title`."
    },
    "og_description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 400,
      "description": "The social-share description. Null means `seo_description`, then `excerpt`."
    },
    "og_image_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 2048,
      "description": "The social-share image, an absolute http(s) URL. Null means `featured_image_url`."
    },
    "og_image_alt": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 500,
      "description": "Alt text for `og_image_url`. Null means `featured_image_alt`, then the title."
    },
    "custom_fields": {
      "type": "object",
      "additionalProperties": true,
      "description": "The values of the Site's custom article fields (the content type of kind `article_fields`,\n`GET /content-types/article`), keyed by field API id. Not in the list default projection.\n"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "source": {
      "readOnly": true,
      "description": "Secret keys only, on `GET /articles/{id}`: where the article came from, or null when it\nhas no source. Absent for a publishable key, in lists and in webhook payloads.\n",
      "oneOf": [
        {
          "$ref": "#/$defs/ArticleSource"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "ArticleSource": {
      "type": "object",
      "description": "Private provenance: the page an article was written from and how that page was used.\n`usage` is derived from `originality_pct` (the share of the article's 5-word phrases not\nfound in the source text): `inspiration` at 85% or more, `rewrite` below, `unmeasured`\nwhen there is no figure. `originality_method` says whether Writavo measured it against the\nstored source text or kept a figure reported by another system on import.\n",
      "properties": {
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "title": {
          "type": [
            "string",
            "null"
          ]
        },
        "origin": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "competitor",
            "feed",
            "import",
            null
          ],
          "description": "competitor = found by the pipeline; feed = a news feed item; import = recorded with an imported article."
        },
        "usage": {
          "type": "string",
          "enum": [
            "inspiration",
            "rewrite",
            "unmeasured"
          ]
        },
        "originality_pct": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 100
        },
        "originality_method": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "measured",
            "reported",
            null
          ]
        },
        "competitor": {
          "type": [
            "object",
            "null"
          ],
          "properties": {
            "name": {
              "type": [
                "string",
                "null"
              ]
            },
            "domain": {
              "type": "string"
            }
          }
        },
        "metrics": {
          "type": [
            "object",
            "null"
          ],
          "description": "The source page's SEO strength when it was chosen.",
          "properties": {
            "seo_score": {
              "type": [
                "number",
                "null"
              ]
            },
            "organic_traffic": {
              "type": [
                "integer",
                "null"
              ]
            },
            "backlinks": {
              "type": [
                "integer",
                "null"
              ]
            },
            "referring_domains": {
              "type": [
                "integer",
                "null"
              ]
            },
            "ranking_keywords": {
              "type": [
                "integer",
                "null"
              ]
            },
            "top10_keywords": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "target_keywords": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "has_source_text": {
          "type": "boolean",
          "description": "Whether the source page's text is stored (kept permanently), so originality can be re-measured."
        }
      }
    },
    "ArticleStatus": {
      "type": "string",
      "description": "Thirteen values in two groups.\n\n**Yours, set through the lifecycle endpoints:** `draft` (private; every article starts here and\nthe AI never touches it), `scheduled` (a cron publishes it at `scheduled_publish_at`) and\n`published` (public on your blog).\n\n**The pipeline's, read only** (a `PATCH` naming one is `422 VALIDATION_FAILED`):\n\n- `discovered`, `scored`, `skipped` - a source found and triaged.\n- `scraped` - source fetched.\n- `generated` - awaiting quality review.\n- `needs_improvement` - failed review, queued for a rewrite.\n- `needs_images` - images in progress.\n- `queued` - waiting for its publishing slot.\n- `rejected`, `failed` - abandoned, or errored past retry.\n\nMore pipeline values may appear within v1; handle unknown ones gracefully.\n",
      "enum": [
        "discovered",
        "scored",
        "skipped",
        "scraped",
        "generated",
        "needs_improvement",
        "needs_images",
        "queued",
        "published",
        "rejected",
        "failed",
        "draft",
        "scheduled"
      ]
    }
  }
}