create_coupons_promotion_bulk
Bulk create coupons for a promotion in one API call, eliminating the need to create them one by one.
Instructions
๐ก WRITE ยท creates data ยท POST /v2/promotions/{id}/coupons-bulk
Bulk create coupons in a promotion. The endpoint response is an array with the created coupon resources.
Behavior: creates a record or triggers an action in the live school. Not idempotent: a repeated call can duplicate the effect. Auth (admin API token + Lw-Client id) is injected server-side, never by the model; calls are throttled to stay under LearnWorlds' 30-per-10s cap and retried on 429/5xx.
Parameters: the whole JSON payload goes in the single body argument, forwarded verbatim (the spec leaves body optional, but this endpoint expects one).
Returns: HTTP <status> followed by the LearnWorlds JSON response body. A non-2xx reply surfaces as a tool error with that status and the API error payload โ 401 bad/expired token, 403 not permitted, 404 no such record, 422 rejected input.
Use when: only when the user asked to create this. Check with a ๐ข read tool that the target exists and the record is not already there. Related Promotions tools: get_promotion, create_coupon_promotion, create_promotion, get_coupon_usage, get_promotions.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "create_coupons_promotion_bulk"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Promotion id | |
| body | No |