← Documentation home
POST
/hyax-api/v1/postsCreate 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
| Field | Required | Description |
|---|---|---|
| title | Yes | |
| content | No | Required unless AI flags are set |
| description | No | |
| status | No | `DRAFT` (default) | `SCHEDULED` | `PUBLISHED` | `ARCHIVED` |
| tags | No | String array |
| imageUrl | No | Featured image URL |
| publishDate | No | ISO date string |
| categoryIds | No | String array of category IDs |
| slug | No | Auto-generated from title if omitted |
| authorId | No | Must be team member; defaults to team creator |
| model | No | AI model (default `gpt-5`) |
| generateContent | No | Boolean — AI mode |
| generateDescription | No | Boolean — AI mode |
| generateTags | No | Boolean — AI mode |
| generateImage | No | Boolean — AI mode |
| useToneTraining | No | Boolean — AI mode |
| toneAuthorId | No | Author 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"
}
}