Set an article’s hero image
set_article_heroSet the image at the top of an article, and its alt text (what it shows, for a reader who cannot see it), as a save does: an uploaded image’s media id (upload_image, upload_image_from_url, or media_catalog), or null to take it off; or, for a data story, a chart the site draws as the hero (its figures shown as a table under it). One or the other: a picture replaces a chart. Audited with the key and the tool. Dry run by default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Its alt text. Left out, the alt text it has is kept while the image stays the same, and none is set for a new one. A chart’s goes in `chart.alt`. | |
| chart | No | A data story’s chart, drawn by the site as the hero: three images (1600×900, and 4:3 and 1:1 for search engines), stored as uploads under the article’s licence (CC BY 4.0, credited to Verified Handles), with the figures shown as a table under it. Saving the same spec again keeps its images; a corrected figure draws new ones. | |
| article | Yes | The article: its id (list_articles), its address ("/news/<slug>", "/guides/<slug>" or the full URL), or its slug alone. | |
| dry_run | No | true (the default): write nothing — show the change and the exact request it would send. false: make the change. | |
| summary | No | Why, in a few plain words, kept with the revision in the article’s history. Never an internal tracking ID. | |
| media_id | No | The image’s media id, or null for none. Not with `chart`. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | A dry run: what to do next to make the change, in words. | |
| result | No | A real run: the route’s own answer, where the tool adds facts of its own beside it. | |
| confirm | No | A dry run of a change that needs it: the exact target to send back as `confirm` with dry_run: false. | |
| dry_run | No | true: a dry run, which wrote nothing. Absent from a real run. | |
| replayed | No | A real run with an idempotency_key already used for this change: the first call’s answer, given back; nothing was written now. | |
| would_send | No | A dry run: the exact request the real run would send (`method`, `path`, any `headers` such as an Idempotency-Key, and its `body`, `form` or `query`), or the requests, in order. | |
| may_edit_live | No | A dry run of a live edit: whether this key’s account may edit this entry live. | |
| refused_because | No | A dry run the real run would be refused for: why, in words. |