← Documentation home
POST/hyax-api/v1/admin/tasks/mass-assign-plan

Mass assign membership plan

Assign a subscription plan to multiple posts by IDs or listPosts-style filter. Defaults to dry run.

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

Request body

FieldRequiredDescription
dryRunNoBoolean, default `true`
subscriptionPlanIdYesMembership plan ID to assign
postIdsNoArray of post IDs (use this or `filter`)
filterNoOptional listPosts filter: `onlyWithoutPlan`, `onlyWithPlan`, `status`, `search`, `postType`, `limit` (max 1000)

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-assign-plan' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "dryRun": true,
    "subscriptionPlanId": "plan_abc123",
    "filter": {
      "onlyWithoutPlan": true,
      "limit": 50
    }
  }'

Example response

Shape varies by data; values are illustrative.

{
  "success": true,
  "data": {
    "dryRun": true,
    "total": 12,
    "updated": 10,
    "skipped": 2,
    "errors": [],
    "items": []
  }
}