read_content to read, write_content to change (it includes read_content). The same scopes cover pages and article categories.
The article
Empty values read as
"" and [], never null. List articles leaves out content, the largest field; Get an article has it.
Categories
category_ids is always in the answer, in ID order. Add join=categories to a list or a read and each article also has categories, with each category’s id, name and slug:
category_ids itself is only in the answer with join=categories.
- Sending
category_idsreplaces the article’s whole list;[]empties it. Leave it out to keep the list. - An ID that is not an article category of the store answers
422with the rulearticle_categoryoncategory_ids, and nothing changes. filter=category_id||$eq||<id>(or$in) lists the articles of a category.- Deleting a category leaves its articles: it only leaves their
category_ids.
tags work the same way: sending them replaces the whole list.
HTML content
content is cleaned before it is saved, and the answer holds the cleaned HTML, which may differ from what you sent. Read it from the answer rather than keeping your own copy. Content that cleaning leaves empty is refused (422, rule required).
- The limit is 51,200 bytes, counted as you send it, before cleaning, so you can check it beforehand (
422, rulemax). A whole body over 64 KiB answers413 body_too_large. - Kept: text formatting, headings, lists, tables, quotes and code blocks; links to
https,mailto:,tel:andsms:;httpsimages; YouTube and Vimeo player iframes; thedirattribute; and the classes the merchant’s dashboard editor writes (alignment, direction, indent, size, font). - Removed:
scriptandstylewith their content; every other element and attribute, keeping its text (forms, other iframes,on*handlers,styleattributes, other classes); relative URLs,data:images and other URL schemes. - Links get
nofollowandnoreferrerin theirrel, and links to full URLs open in a new tab.
422, rule text).
description and meta_description are not HTML: send plain text. A < in them is refused (rule text), not cleaned.
Slugs
The slug is the article’s name in its blog URL: lettersa-z and A-Z, digits and dashes, up to 255 characters.
- Create an article without
slugand one is made from the title: its English letters and digits, in lower case, with dashes between words. A title with none of them, an Arabic one for example, getsarticle. When the slug is taken, a random suffix is added (article-3fa9c1). - A
slugyou send must not be another article’s:409 slug_taken. - Changing the title later does not change the slug. Send
slugto change it.
AI content check
The article’s text (title, description, meta description, tags and content) goes through the AI content check the merchant’s dashboard uses, on create and on every update that changes it. When the check flags it, the article is still saved as sent, published or not, withis_need_review: true, for a human review.
is_need_reviewis read only. A later update whose check passes does not set it back tofalse.- A check that fails or takes over 15 seconds counts as flagged.
- Each store allows 20 checks a minute, and each app 200 a minute across its stores, shared with products and pages. Over that, the text is flagged without a check.
filter=is_need_review||$eq||true.
Deleting
Delete an article deletes it for good, as the merchant’s dashboard does; its categories stay. To take an article off the blog and keep it, setpublished: false.