---
title: "Publish a rule"
method: POST
path: "/v25-10-beta/agentic-logic/rules/{ruleId}/publish"
tags: ["Agentic Logic"]
---

# Publish a rule

`POST /v25-10-beta/agentic-logic/rules/{ruleId}/publish`

## Request

- Base URL: `https://api.intelligems.io`
- URL: `https://api.intelligems.io/v25-10-beta/agentic-logic/rules/{ruleId}/publish`
- 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/publish/post.ts> (a function with typed inputs; its response is checked against the schema)

**Success status:** 202 Accepted.

```http
POST /v25-10-beta/agentic-logic/rules/{ruleId}/publish
```

Starts an asynchronous publish job for the rule's current draft (code rules) or
template configuration (builder rules).

- `notes` (string, optional) — Notes stamped on the resulting version.
- `title` (string, optional, up to 255 characters) — Display title stamped on
  the resulting version. When omitted, a draft that came from the AI chat gets
  "Built from chat" and any other draft gets no title.
- `idempotencyKey` (string, optional) — Client-supplied key. Repeating a publish
  for the same rule and key returns the existing job handle instead of starting
  another job.
- `autoAssist` (boolean, optional) — Whether a failed job starts AI repair.
  Defaults to `true`. Send `false` to leave a failed job failed (see below).
  It is frozen into this job only; it is not stored on the rule.

The endpoint answers `202 Accepted` with `{ "publishJobId": "..." }`. Publishing
runs a gate pipeline (static checks, tests, budget and safety gates,
deployment) that takes seconds to minutes; poll the publish job until `status`
is `succeeded`, `failed`, or `cancelled`. A successful publish makes the new
version active immediately. A first publish moves a `draft` rule to `active`; a
publish never resumes a `paused` rule.

- When a code rule's draft has no validation scenarios, the checks run one
  default scenario: an `onsite` request in USD from the US, with the rule's id
  as the placement.
- A failed publish of a code rule opens an AI repair run, unless one is already
  running. The repair loop rewrites the draft and re-runs the checks; when they
  pass, it publishes the rewritten source, unless the rewrite changed what the
  rule does. Follow it through `activeRepairRun` on
  [Get a rule](#get-a-rule); the failed job itself stays `failed`.

With `autoAssist: false`, a failed job opens no repair run, so the platform
never rewrites the rule's source or republishes it on its own. It does not stop
a repair run that is already running; [cancel](#cancel-a-check-run) does. A
successful publish is unaffected.

A repeated `idempotencyKey` returns the job it first started, with the
`autoAssist` value that job was started with. The `autoAssist` sent on the
repeat is ignored.

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

## Request body

- object: Start an async publish job for the rule's current draft. Returns the job handle to poll.
  - `notes` string: Publish notes to stamp on the resulting version.
  - `title` string: Display title to stamp on the resulting version. When omitted, chat-origin drafts default to "Built from chat"; manual drafts get no title.
  - `idempotencyKey` string: Client-supplied idempotency key. A repeated publish for the same rule and key returns the existing job handle instead of starting another job.
  - `autoAssist` boolean: Whether a failed job starts AI repair. Defaults to true. False leaves a failed job failed: this job opens no repair loop, so it never leads the platform to rewrite or republish the rule's source. A repair loop already running for the rule is not stopped. A successful publish is unaffected. A replay of an existing idempotencyKey returns that job as it was started, whatever this says.

## Response `202`

Accepted

- object
  - `publishJobId` string, required

## 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)
