PATCH
/hyax-api/v1/posts/:id/featured-imageReplace featured images
Replaces the post's featured images: the `MediaAttachment` rows with `featuredMedia: true` shown on blog cards and in the editor. Pass `imageUrl` for one image or `imageUrls` for several in display order; the first one's stored URL is written to `post.image` (external images are copied to the CDN). Images that stay in the set keep their ids. `null`, an empty string or an empty array clears them. To change the set without replacing it, use the add and remove endpoints below.
Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.
Request body
| Field | Required | Description |
|---|---|---|
imageUrl | No | One image URL. `null` or an empty string clears the featured images. |
imageUrls | No | Up to 20 image URLs in display order. Use instead of `imageUrl`; `[]` clears. |
Request
curl -X PATCH 'https://platform.hyax.com/hyax-api/v1/posts/clx_example_id/featured-image' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"imageUrls": [
"https://cdn.example.com/new-cover.jpg",
"https://cdn.example.com/second.jpg"
]
}'Response
{
"success": true,
"data": {
"id": "clx…",
"image": "https://cdn.example.com/new-cover.jpg",
"featuredMedia": [
{ "id": "clx…", "type": "Post", "url": "https://cdn.example.com/new-cover.jpg" },
{ "id": "clx…", "type": "Post", "url": "https://cdn.example.com/second.jpg" }
],
"updatedAt": "2025-01-15T12:10:00.000Z"
}
}