Approve & run
POST/api/send-plans/:sendPlan/ai-approval
Approve the plan as summarised and run it: hold the source stock (unless hold is false), queue every network draft for the destinations kept in, create the draft supplier POs for the supplier orders kept in, and record the approval (who, when, the numbers approved, what was left out). Nothing is submitted to Amazon, Walmart or TikTok.
send-plans:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body: fingerprint (required, from GET ai-approval), excluded_destination_ids (int[]), excluded_supplier_keys ("supplier_id:destination_warehouse_id"[]), hold (bool, default true), narrative (the text the approver read).
Responses: 201 with the run state (status running | done | partial, drafts as SendPlanDraft resources, purchase_orders, po_error); 409 when the plan changed since the summary (review again); 403 without integrations.update (drafts), warehouse_transfers.create (hold) or purchase_orders.create (when supplier orders are included) — nothing is created; 422 for scenarios, send runs, a plan still calculating, or when everything is switched off. Needs send_planner.draft; API tokens: send-plans:write.
Request
Responses
- 201
- 401
- 403
- 404
- 422
- 429
Created
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.