Create an instruction

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_module a policy_id is required for
    dispatch, and the supplied module_id is resolved and validated
    against the policy's actual product module (a mismatch is
    rejected with 400).
  • module_type: collection_module is reserved for upcoming
    collection-module support and is currently rejected with 400
    only the product_module executor is registered today.

Validation:

  • execution_datetime must be at least 15 minutes in the future
  • execution_datetime must fall on a 30-minute boundary — minutes
    00 or 30, with 00.000 seconds/milliseconds
  • module_type must reference a module type whose executor adapter
    is registered (only product_module today; other types are
    rejected with 400 so 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

Body Params
string
enum
required

The module type the instruction executes against. product_module instructions are policy-derived (the module is resolved from the policy). collection_module is reserved for upcoming collection-module support — creating a collection_module instruction is currently rejected with 400.

Allowed:
uuid
required

The id of the module the instruction executes against. For product_module it is validated against the policy's actual product module.

uuid

Optional. The policy to associate the instruction with. Required for product-module dispatch.

uuid

Optional. The claim to associate the instruction with.

string
required

The module function to invoke at execution_datetime.

module
object
required

Free-form payload that will be passed to the function as instruction_data.

date-time
required

ISO 8601 datetime string (numeric timestamps are rejected). Must be at least 15 minutes in the future and on a 30-minute boundary (minutes 00 or 30). If no timezone offset is supplied, the value is interpreted as UTC; explicit offsets (Z, +02:00) are honoured and converted to UTC — the 30-minute boundary is evaluated on the UTC instant.

string | null

Optional human-readable description.

boolean
Defaults to false

When true, the instruction is hidden from standard listings. Requires instructions:read_hidden to view.

boolean
Defaults to false

When true, the instruction can be triggered manually via the /trigger endpoint before execution_datetime.

Responses

400

Validation 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.

403

Missing instructions:create permission.

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json