---
title: "Get a published version"
method: GET
path: "/v25-10-beta/agentic-logic/rules/{ruleId}/versions/{version}"
tags: ["Agentic Logic"]
---

# Get a published version

`GET /v25-10-beta/agentic-logic/rules/{ruleId}/versions/{version}`

## Request

- Base URL: `https://api.intelligems.io`
- URL: `https://api.intelligems.io/v25-10-beta/agentic-logic/rules/{ruleId}/versions/{version}`
- Auth: API key in header `intelligems-access-token`
- TypeScript: <https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta/docs/v25-10-beta/agentic-logic/rules/:ruleId/versions/:version/get.ts> (a function with typed inputs; its response is checked against the schema)

```http
GET /v25-10-beta/agentic-logic/rules/{ruleId}/versions/{version}
```

Gets one published version of a rule by its publish number.

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.

## Path parameters

- `ruleId` string, uuid, required
- `version` string, required

## Response `200`

OK

- object
  - `detail` object, required: Version list row plus the artifacts it owns.
    - `version` object, required: The version row.
      - `id` string, required: Version row id (uuid).
      - `version` integer, required: Monotonic publish number (1, 2, 3, …). Defines recency for retention.
      - `status` 'active' | 'superseded' | 'failed', required: 'active' = the version the rule serves; 'superseded' = previously active; 'failed' = the publish never promoted it.
      - `notes` string, nullable, required: Publish notes, when provided.
      - `title` string, nullable, required: Display title for the version (e.g. "Built from chat"). Explicit publish-time title when given, defaulted server-side to "Built from chat" for chat-origin drafts, else null.
      - `origin` 'chat' | 'manual', nullable, required: Provenance copied from the draft at publish time: 'chat' = built by the workspace AI chat, 'manual' = human-authored, null for versions published before provenance was recorded.
      - `settings` object, required: The recommendation settings frozen with this version. THE copy serving obeys — the rule row's is the editable draft of it — which is what makes a settings edit take effect at republish rather than instantly.
        - `maxItems` integer, required: Most products the rule may return, 1-10. The engine supplies it to the rule as `context.slotsNeeded` and trims the envelope to it. One bound for every surface, because one rule can serve several. A surface may still show fewer at once: the checkout block's grid paginates the returned list into a carousel, which is presentation and stays with the placement.
        - `excludeOutOfStock` boolean, required: Drop products with no purchasable variant. Applied where the product data already is: inside the template for a builder rule, inside the generated source for a code rule, and again as a floor when the engine hydrates the result — so the setting is true on every surface rather than only the ones that remembered to pass it.
        - `excludeItemsInCart` boolean, required: Drop products the shopper already has in the cart. Runs before the emptiness test, so an envelope this empties falls through to `onEmpty` rather than reporting itself as a result.
        - `excludePdpProduct` boolean, required: Drop the product the shopper is viewing (`request.pageProduct`, PDP only). Applied inside builder templates before the item cap, so the slot backfills, and again by the engine on every rule's result. Turn it off when the viewed product belongs in the result, e.g. a bundle built around it.
        - `onEmpty` 'hide' | 'smart-recs', required: What the slot does when the rule returns zero items: 'hide' the placement or fall back to 'smart-recs'. Errors and timeouts take the same route as a miss — there is no separate error policy — and stay distinct in telemetry.
      - `templateId` string, nullable, required: Template this version was built from, or null for a custom-code version. Frozen at publish time: repointing the rule at another template never rewrites it.
      - `templateVersion` integer, nullable, required: The template's own version at publish time, or null for a custom-code version. Says which template implementation the frozen params were validated against.
      - `templateParams` object, nullable, required: The normalized template parameters frozen with this version, or null for a custom-code version. THE copy serving executes — the rule row's is the editable draft of them — which is why a params edit takes effect at republish rather than instantly, and why two versions of one rule are only distinguishable here.
      - `dependencyLockHash` string, nullable, required: Hash of the resolved dependency lockfile, or null when the version has no locked dependencies.
      - `contentFingerprint` string, nullable, required: SHA-256 identity of the code workspace (source, user tests, generated tests). Equal draft and active-version fingerprints mean the draft has nothing to apply. Null for template rules, and for rows not yet fingerprinted.
      - `shopifyApiVersion` string, nullable, required: The Shopify API version this rule version's queries were validated against at publish time (the app is currently on 2026-07).
      - `publishedAtTs` number, nullable, required: Promotion time, Unix epoch-ms; null for failed versions.
      - `publishedByUserId` string, nullable, required: User who published, or null (system publishes).
      - `publishedByUser` object, nullable, required: Display record for the publisher, resolved at read time, or null when there is no publisher or the account no longer resolves. Readers render this; `publishedByUserId` is an identifier, never a label.
        - `name` string, required
      - `createdAtTs` number, required: Row creation time, Unix epoch-ms.
    - `sourceUrl` string, nullable, required: Presigned URL for the version's source snapshot, or null when the version stores none.
    - `userTestsUrl` string, nullable, required: Presigned URL for the user test suite snapshot, or null when none was saved.
    - `generatedTestsUrl` string, nullable, required: Presigned URL for the generated test suite snapshot, or null when none was saved.
    - `dependencyLock` object, required: Resolved lockfile: package name → exact resolved version. Empty object when the version has no dependencies.
    - `graph` object, nullable, required: The rule's graph artifact: a renderer-agnostic node/edge description of the rule's selection logic, versioned alongside the code. Carries NO geometry — layout is computed client-side. Produced deterministically for template rules and emitted by the authoring agent for custom-code rules, then verified by the graph_consistency gate.
      - `version` 1, required: Graph wire-format version. Currently 1.
      - `nodes` object[], required: Graph nodes, at most RULE_GRAPH_MAX_NODES. Large inputs must be aggregated into node meta, never expanded per item.
        - `id` string, required: Stable node id, unique within the graph. For kind 'branch', MUST equal the attempt() base label (a static string literal in the code). Runtime attempt instances are drill-in data on the node, never nodes of their own.
        - `kind` 'input' | 'branch' | 'generator' | 'filter' | 'sort' | 'limit' | 'exclusions' | 'output' | 'fallback-terminal', required: 'input' | 'branch' | 'generator' | 'filter' | 'sort' | 'limit' | 'exclusions' | 'output' | 'fallback-terminal'. Branch nodes mirror attempt() bases; pipeline kinds describe the flow inside or after a branch, while Exclusions is the platform-owned final filter.
        - `label` string, required: Short card title shown on the node.
        - `summary` string: One plain-language sentence describing what the node does.
        - `branchId` string: Owning branch node id, set ONLY on generator/filter/sort/limit nodes that run inside that branch; absent for shared pipeline nodes and always absent on 'input', 'branch', 'exclusions', 'output' and 'fallback-terminal' nodes — a branch never names itself.
        - `meta` object: Kind-specific structured details (e.g. generator source, aggregate itemCount + sampleItems, limit N). Aggregates belong here — never one node per item.
          - `itemCount` integer: Aggregate count of items the node covers (e.g. a generator drawing from a 1000-product list).
          - `sampleItems` string[]: Up to five representative item names for drill-in display; never the full list.
          - `condition` string: Plain-language matching clause for branch/filter nodes, phrased for a merchant ('in stock right now', 'cart contains a tagged cover-up'). The MATCHING card body.
          - `conditionSubject` 'cart' | 'delivery' | 'shipping' | 'customer' | 'page' | 'order' | 'time': Which request context a branch node's condition chip is about — 'cart' (the default when absent), 'delivery' (request.shipping.delivery: selected option, local pickup, cost, carrier, transit days), 'shipping' (gap, threshold, tiers, state), 'customer' (ordersCount, tags), 'page' (request.pageProduct), 'order' (request.order), 'time' (request.evaluatedAt). Drives the row-header sentence; absent on always-matching branches and on every non-branch node.
          - `sortKey` string: Plain-language sort criterion for sort nodes ('Best sellers'). The SORTED BY card body.
          - `limit` integer: Maximum number of items a limit node lets through. Rendered as 'UP TO n products'.
      - `edges` object[], required: Directed edges between node ids, at most RULE_GRAPH_MAX_EDGES.
        - `from` string, required: Source node id.
        - `to` string, required: Target node id.
        - `kind` 'flow' | 'fallback', required: 'flow' = data/control flow; 'fallback' = taken when the source produced nothing (branch miss or empty output). Fallback edges may only terminate at a branch or the fallback-terminal.

## Other responses

- `429`: Too Many Requests

---

[API](https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta.md) - [All operations](https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta/llms.txt) - [OpenAPI document](https://skmtc.dev/intelligems/apis/intelligems-external-api-v25-10-beta/revisions/7b769b2f90b1?raw)
