Agentic Logic

Evaluate a scenario

POST /v25-10-beta/agentic-logic/rules/{ruleId}/evaluate-scenario

Runs one scenario against the rule's saved draft (code rules) or current template configuration (builder rules), under the rule's current settings. nothing is persisted.

  • scenario (object, required) — The full scenario. request.placementId defaults to the rule's own id.
  • A code rule with no saved draft source answers 404.

The response is the admin's scenario preview (result, exclusions, coverage, hydratedItems, onEmpty, evaluated), plus logs for code rules:

  • logs — What the rule's logger calls wrote during this run, in call order, as { level, message, details?, invocationId?, timestamp }. Logs are returned when the rule completes, when it returns a malformed envelope (errorClass: "invalid_envelope"), when it throws, and when it exceeds the budget. They are [] when the rule logged nothing. A failed run whose output exceeds 256KB keeps only its earliest and latest entries, and the response then carries logsTruncated: true. A failure on the platform side, such as a failed SDK read, is rethrown by the sandbox runner without its output, so it returns an error result with no logs key. That includes a throw after the rule caught a failed SDK read; a budget overrun after one still returns its logs. Plain console.log output is not included. Builder rules have no logs key.
  • timestamp is ISO-8601 UTC host wall-clock time at the moment logger was called, with millisecond precision. Subtract two entries' timestamps to get the elapsed time between those calls, for example around a branch or a read.

A code rule's preview runs under a fixed 10000ms budget (AGENTIC_LOGIC_RUNTIME_BUDGET_MAX_MS), whatever budget its placements assign. The budget is wall-clock time for the whole evaluate call, SDK reads included. A run that exceeds it returns an error result with errorClass: "timeout" whose warning contains Rule exceeded runtime ceiling of 10000ms. Its logs hold the entries written before the timeout.

Use the intelligems-access-token header. The token selects the organization; do not send orgId. The organization must have Agentic Logic enabled.

Rate Limit: 50 requests per 30s window, refilling 25 tokens every 30s.

post/v25-10-beta/agentic-logic/rules/{ruleId}/evaluate-scenario

Request

Path parameters

ruleIdstring uuid required

Request body

Response

OK

onEmpty'hide' | 'smart-recs'
logsTruncatedtrue

True when the failed run wrote more than 256KB of output, so logs holds only its earliest and latest entries. Absent when logs is complete.

Changes

No recorded changes to this operation across all 1 revision of this API.