← Documentation home
PATCH/hyax-api/v1/posts/:id/featured-image

Update featured image

Replaces the post's featured image (the `MediaAttachment` with `featuredMedia: true` shown on blog cards and in the editor). Also mirrors the URL to `post.image` for the GET response. Pass `null` or an empty string to clear.

Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.

Request body

FieldRequiredDescription
imageUrlYesImage URL. Pass `null` or an empty string to clear the featured image.

Request examples

Same request in cURL, Node.js (fetch), and PHP (ext-curl).

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 '{
    "imageUrl": "https://cdn.example.com/new-cover.jpg"
  }'

Example response

Shape varies by data; values are illustrative.

{
  "success": true,
  "data": {
    "id": "clx…",
    "image": "https://cdn.example.com/new-cover.jpg",
    "featuredMedia": [
      { "id": "clx…", "type": "Image", "url": "https://cdn.example.com/new-cover.jpg" }
    ],
    "updatedAt": "2025-01-15T12:10:00.000Z"
  }
}