---
title: "Evaluate Rules for an Information Block"
method: POST
path: "/extensions/roboledger/{graph_id}/operations/evaluate-rules"
tags: ["RoboLedger: Information Blocks"]
---

# Evaluate Rules for an Information Block

`POST /extensions/roboledger/{graph_id}/operations/evaluate-rules`

## Request

- Base URL: `https://api.robosystems.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.robosystems.ai/extensions/roboledger/{graph_id}/operations/evaluate-rules`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer

Runs every rule targeting the given structure (plus element- and association-scoped rules for the structure's atoms), binds $Variable references to in-scope facts via qname lookup, writes one VerificationResult row per rule, and returns the results plus a status-keyed summary. Decoding mode, 6 patterns (EqualTo, RollUp, RollForward, SumEquals, Exists, CoExists).

**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.

## Path parameters

- `graph_id` string, required

## Headers

- `Idempotency-Key` string, nullable

## Request body

- EvaluateRulesRequest: Request body for the `evaluate-rules` operation. Runs every rule scoped to `structure_id` (plus element/association- scoped rules for the structure's atoms), binds `$Variable` references to facts via qname lookup, and writes one :class:`VerificationResult` row per rule. Optional `period_start` / `period_end` narrow the fact-binding window; without them the engine uses the most recent `in_scope` fact for each element regardless of period.
  - `structure_id` string, required: Structure to evaluate rules for. Resolves all rules scoped to this structure plus rules attached to its elements and associations.
  - `fact_set_id` string, nullable: Optional FactSet id to stamp on each VerificationResult row. Allows results to be scoped to a specific period run once write paths populate the FactSet table on every run.
  - `period_start` string, date, nullable: Lower bound on the fact period window (inclusive).
  - `period_end` string, date, nullable: Upper bound on the fact period window (inclusive).

## Response `200`

Successful Response

- OperationEnvelopeEvaluateRulesResponse
  - `operation` string, required: Kebab-case operation name
  - `operationId` string, required: op_-prefixed ULID for audit and SSE correlation
  - `status` 'completed' | 'pending' | 'failed', required: Operation lifecycle state
  - `result` EvaluateRulesResponse: Response for the `evaluate-rules` operation. `results` is the full list of :class:`VerificationResultLite` rows written by this evaluation run. `summary` gives counts keyed by status for quick display without iterating the list.
    - `structure_id` string, required
    - `results` VerificationResultLite[], required
      - `id` string, required
      - `rule_id` string, required
      - `structure_id` string, nullable
      - `fact_set_id` string, nullable
      - `status` string, required: 'pass' | 'fail' | 'error' | 'skipped'. Enum closure enforced by the `public.verification_results` CHECK constraint.
      - `message` string, nullable
      - `period_start` string, date, nullable
      - `period_end` string, date, nullable
      - `evaluated_at` string, date-time, nullable
    - `summary` object: Status counts keyed by outcome string: `{'pass': N, 'fail': N, 'error': N, 'skipped': N}`.
  - `at` string, required: ISO-8601 UTC timestamp
  - `createdBy` string, nullable: User ID that initiated the operation
  - `idempotentReplay` boolean: True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions.

## Other responses

- `400`: Invalid request
- `401`: Authentication required
- `403`: Access denied
- `404`: Resource not found
- `409`: Idempotency-Key conflict — key reused with different body
- `422`: Validation error
- `429`: Rate limit exceeded
- `500`: Internal server error

---

[API](https://skmtc.dev/robosystems/apis/robosystems-api.md) · [All operations](https://skmtc.dev/robosystems/apis/robosystems-api/llms.txt) · [OpenAPI document](https://skmtc.dev/robosystems/apis/robosystems-api/revisions/28ffd375c457?raw)
