Reference

willo_content_write

Create a CMS item (no item_id: needs title and body_md) or update one (item_id from willo_content, plus the fields to change).

  • Act
  • May need approval
  • Secret scan
Generated from Willo's codeOpen in ClaudeOpen in ChatGPT
On this page

Write CMS content. Writes a DRAFT item in Willo's CMS — never the live site; the owner is told a draft is waiting. Publishing is willo_content_publish. No card. slug sets a draft's web address; a published item's address is changed by a person (Content tab or Willo's chat). For many items, send items (up to 100, all creates or all updates) instead of the single-item arguments, with dry_run: true first to check them without writing.

Access

  • Token: read + act, and editor access or higher on the business.
  • Approval: Only when Willo's chat would stop for the same action. The description says when; otherwise the call runs at once.
  • Secret scan: refused if the new content holds a value shaped like an API key or token.

Parameters

ParameterTypeRequiredDescription
item_idinteger ≥ 1noThe item to update. Omit to create.
titlestringnoTitle (required to create).
slugstringnoUpdate only: the item's address segment (lowercase letters, numbers, hyphens; unique in the collection). Accepted on a draft; refused on a published or scheduled item, whose address a person changes.
body_mdstringnoBody as markdown (required to create). To change part of a body, use body_edits; send body_md only to rewrite it. Pictures follow the copy: after saving a post, ONE willo_images call (featured + body images), then ONE willo_content_write setting fields.image/imageAlt and inserting body images with body_edits under their ## headings. Body images from 600 words: ~1 per 2-3 sections, at most 3, never before the first paragraph. Stock only for real named places, people at work or real objects AI renders badly; AI otherwise. The owner's Assets only when they chose them. Image addresses: Assets, site files, or https images copied in (3 per item); stock-site and made-up ones are refused.
body_editsobject[]noUpdate only. Change part of the body without resending all of it: a list of 1 to 20 {find, replace} edits, applied in order to the item's current body (its unpublished edits when it has any, else the published text). Each find is exact text, including capitals, punctuation and markdown, and must appear exactly once in the body as it stands after the earlier edits; a Windows line break (\r\n) counts as \n, and the saved body uses \n. Each find and replace is at most 20,000 characters. If any edit matches no text or more than one place, nothing is saved and the reply names that edit, how many matches it found and the text around each, so you can make the find longer. replace: "" deletes the text. To insert, find a nearby anchor and replace it with itself plus the new text, e.g. find ## Choosing stones\n, replace ## Choosing stones\n\n![Stacked sauna stones](https://…)\n. Text you don't target is kept exactly as it is, including changes someone made in the editor since you last read it. Send body_edits or body_md, not both.
descriptionstringnoMeta description for search results and link previews: one or two sentences about the item, 120-160 characters.
authorstringnoAuthor name.
tagsstring[]noTags.
seo_keywordsstring[]noKeywords the item should rank for: the main keyword first, then up to four related ones (questions are fine). At most 5, each at most 80 characters. The content score checks the main keyword in the search title, search description, opening paragraph and a section heading. Kept with the item, never written into the page. Replaces the whole list; an empty list clears it.
fieldsobjectnoCollection-specific fields (see willo_content's item read). For a blog post: image (featured image: an Assets URL from willo_images or willo_assets, a site file path, or an https image Willo copies in), imageAlt (what it shows, one plain sentence, at most 125 characters, no 'Image of'; body images' alt likewise) and seo ({title, description, canonical, noindex, ogImage}), each overriding the page's default. A reference field takes the slug of an item in its target collection, or a list of slugs when it holds several; publish any draft it points at first.
collectionstringnoCollection name (default blog).
itemsobject[]noBulk: up to 100 items (2 MB in all) in ONE call, instead of the single-item arguments. Every entry with item_id updates that item; every entry without creates a draft (title and body_md required). One call is all creates or all updates. Every entry is checked first: if any fails, nothing is written and the result lists each failure by its index. Otherwise all of them are written in one transaction, counted as ONE change against the business's per-minute limit, and the owner gets one notice for the whole batch.
dry_runbooleannoWith items: check every entry and report, write nothing.