← Documentation home
POST
/hyax-api/v1/admin/tasks/mass-unpublishMass unpublish posts
Set multiple posts to draft by ID. Skips already-draft and archived posts. Defaults to dry run.
Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.
Request body
| Field | Required | Description |
|---|---|---|
| dryRun | No | Boolean, default `true` |
| postIds | Yes | Array of post IDs |
Request examples
Same request in cURL, Node.js (fetch), and PHP (ext-curl).
curl -X POST 'https://platform.hyax.com/hyax-api/v1/admin/tasks/mass-unpublish' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"dryRun": true,
"postIds": [
"post_1",
"post_2"
]
}'Example response
Shape varies by data; values are illustrative.
{
"success": true,
"data": {
"dryRun": true,
"total": 2,
"updated": 2,
"skipped": 0,
"errors": [],
"items": []
}
}