Set article cover image
set_article_cover_imageReplaces the cover (main) image of a generated article with an image stored on the website's media host: either downloaded from a public URL (image_url) or uploaded from the user's machine (upload_id, see create_image_upload). Pass alt_text to describe the new image at the same time (recommended). Pass locale to change the cover of a translation only. Free. Editing an article that is already published (or published in draft) marks it Out of Sync until it is synced with sync_article_to_cms or published again. Inline images inside the body are part of the markdown: host them with upload_article_image and edit the body with update_article_content. Pass website_id when the account has several websites (see get_account).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locale | No | Translation locale (e.g. "fr") to target instead of the default-language article. | |
| alt_text | No | Alt text of the cover image (max 200 characters): what the image shows, for search engines and screen readers. Shared by every locale of the article and sent to the CMS with the image. | |
| image_url | No | Public http(s) URL of the image to download (JPEG, PNG, WebP, GIF or AVIF, 4 MB max). For a file on the user's machine, pass upload_id instead. | |
| upload_id | No | upload_id returned by create_image_upload, once the file has been sent to its upload_url. Alternative to image_url for files on the user's machine (10 MB max). | |
| article_id | Yes | Article id from list_articles. | |
| website_id | No | Website id from get_account. Optional when the account has a single website. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locale | Yes | ||
| article | Yes | ||
| main_image_url | Yes | Hosted URL of the new cover. |