Update AIRule

LLM-friendly URL
POST
https://api.luzmo.com/0.1.0/airule
API call form
Examples

Updating a rule covers both editing it and publishing it.

Sending name and/or content saves a new version: Luzmo appends an AIRuleVersion and moves latest_version_id to it. Sending exactly the name and body that are already stored writes nothing, so repeating a save is safe. Saving never touches the published version, so the Agents keep applying the text you published until you publish the new version. Versions are immutable and are never overwritten or removed by an edit.

Sending published_version_id changes what the Agents apply. Point it at any version of the same rule to publish that version, which also records published_at and copies the version name into published_name ; publishing the version that is already published leaves both untouched. A rule has at most one published version, so publishing another version replaces the previous one, and publishing an older version is a rollback that leaves has_unpublished_changes on true . Send null to unpublish: every version is kept, but the rule becomes a draft again and its linked Agents stop applying it.

Publishing always refers to a version that already exists, so saving and publishing in one step is two calls: save the new text, then publish the latest_version_id that call returns.

Updating and publishing both require the Organization Editor right, i.e. the Owners and Designers of the organization. Any member of the organization can read the rule, but not change it.

Request parametersResponse schema
Expand all Reset
id *UUIDrequired

The unique identifier of the entity

properties *OBJECTrequired

Properties to update. Sending name and/or content edits the draft; sending published_version_id publishes or unpublishes the rule. Every other attribute of the rule is read-only and is rejected with a 400.

Publishing always refers to a version that already exists, so saving and publishing is two calls: first save the new content, then publish the latest_version_id returned by that call. If you do send content and published_version_id together, the version you name is published and the content you send is written as a newer, unpublished version.

name STRING
content STRING
published_version_id UUID
Can be executed by:
Organization Editor
Can be associated to:
latest_version
published_version
versions
linked_agents
created_by
Did this page help you?
Yes No
Language
Shell
Node
Java
.NET
Python
PHP
Install
npm install @luzmo/nodejs-sdk
Example Response
200
400
500
{
  "id": "c1f4a0c2-6c9e-4f6b-9a5a-3f0d2b8f1e77",
  "name": "Discount policy",
  "status": "published",
  "has_unpublished_changes": true,
  "latest_version_id": "2e7c8a10-4b3d-4a2f-9c1e-7d6b5a4f3e2d",
  "published_version_id": "9b1d2f34-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
  "published_name": "Discount policy",
  "published_at": "2026-09-18T09:12:44.512Z",
  "organization_id": "0f2b8a6d-3c4e-4d5a-8b7c-1e2f3a4b5c6d",
  "user_id": "5ec6950f-d7bb-4554-8f6a-10ea8b68c254",
  "created_at": "2026-09-18T09:04:11.204Z",
  "updated_at": "2026-09-18T09:31:02.880Z"
}