← Documentation home
POST/hyax-api/v1/posts

Create post

Direct mode requires `title` + `content`. AI mode: set `generateContent`, `generateDescription`, `generateTags`, or `generateImage` to `true` and poll the job URL.

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

Request body

FieldRequiredDescription
titleYes
contentNoRequired unless AI flags are set
descriptionNo
statusNo`DRAFT` (default) | `SCHEDULED` | `PUBLISHED` | `ARCHIVED`
tagsNoString array
imageUrlNoFeatured image URL
publishDateNoISO date string
categoryIdsNoString array of category IDs
slugNoAuto-generated from title if omitted
authorIdNoMust be team member; defaults to team creator
modelNoAI model (default `gpt-5`)
generateContentNoBoolean — AI mode
generateDescriptionNoBoolean — AI mode
generateTagsNoBoolean — AI mode
generateImageNoBoolean — AI mode
useToneTrainingNoBoolean — AI mode
toneAuthorIdNoAuthor ID for tone training

Request examples

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

curl -X POST 'https://platform.hyax.com/hyax-api/v1/posts' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Why AI Agents Are the Future",
    "content": "<h1>Introduction</h1><p>AI agents are transforming how we work...</p>",
    "description": "A deep dive into AI agents and their impact on productivity.",
    "status": "DRAFT",
    "tags": [
      "ai",
      "agents",
      "productivity"
    ],
    "imageUrl": "https://cdn.example.com/cover.jpg",
    "publishDate": "2025-02-01T10:00:00.000Z",
    "categoryIds": [
      "clx_cat_tech"
    ],
    "slug": "why-ai-agents-are-the-future",
    "authorId": "usr_123",
    "model": "gpt-5",
    "generateContent": false,
    "generateDescription": false,
    "generateTags": false,
    "generateImage": false,
    "useToneTraining": false,
    "toneAuthorId": "usr_123"
  }'

Example response

Shape varies by data; values are illustrative.

{
  "success": true,
  "mode": "direct",
  "data": {
    "id": "clx…",
    "title": "API-created post",
    "slug": "api-created-post",
    "status": "DRAFT",
    "publishedAt": null,
    "authorId": "usr…",
    "createdAt": "2025-01-15T12:00:00.000Z"
  }
}