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

Update post

Send only changed fields. Slug must be unique within the team (409 if taken).

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

Request body

FieldRequiredDescription
titleNo
contentNo
descriptionNo
statusNo`DRAFT` | `SCHEDULED` | `PUBLISHED` | `ARCHIVED`
tagsNoString array
imageUrlNoMapped to `image`
publishDateNoISO date
categoryIdsNoString array
slugNoMust be unique in team
authorIdNoMust be team member

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' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Updated Post Title",
    "content": "<p>Updated body HTML</p>",
    "description": "Updated meta description",
    "status": "PUBLISHED",
    "tags": [
      "updated",
      "featured"
    ],
    "imageUrl": "https://cdn.example.com/new-cover.jpg",
    "publishDate": "2025-02-01T10:00:00.000Z",
    "categoryIds": [
      "clx_cat_tech"
    ],
    "slug": "updated-post-title",
    "authorId": "usr_456"
  }'

Example response

Shape varies by data; values are illustrative.

{
  "success": true,
  "data": {
    "id": "clx…",
    "title": "Hello world",
    "slug": "hello-world",
    "status": "PUBLISHED",
    "publishedAt": "2025-01-15T12:00:00.000Z",
    "authorId": "usr…",
    "updatedAt": "2025-01-15T12:10:00.000Z"
  }
}