Schedules a module function to execute at a future datetime against the module identified by module_type + module_id. This is the only create surface — there is no policy-nested create route.
This surface takes module_type and module_id directly. policy_id and claim_id are optional here.
- For
module_type: product_moduleapolicy_idis required for
dispatch, and the suppliedmodule_idis resolved and validated
against the policy's actual product module (a mismatch is
rejected with400). module_type: collection_moduleis reserved for upcoming
collection-module support and is currently rejected with400—
only theproduct_moduleexecutor is registered today.
Validation:
execution_datetimemust be at least 15 minutes in the futureexecution_datetimemust fall on a 30-minute boundary — minutes
00or30, with00.000seconds/millisecondsmodule_typemust reference a module type whose executor adapter
is registered (onlyproduct_moduletoday; other types are
rejected with400so no un-dispatchable rows are persisted).
Idempotency: if a pending instruction with identical (module_id, policy_id, claim_id, function_name, execution_datetime, module) already exists, the existing instruction is returned with HTTP 200 and no new row is created (jsonb key order is normalised).
Permission: instructions:create
400Validation error. Examples: execution_datetime is less than 15 minutes in the future, not on a 30-minute boundary, schema validation failed, module_id mismatches the policy's product module (product_module), or module_type references a module type whose executor adapter is not registered (e.g. collection_module). Note: an exact-duplicate pending instruction is not an error — it returns 200 with the existing row.
403Missing instructions:create permission.