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
id UUID

Unique identifier for the AIRule.

name STRING

Name of the rule. It always reflects the name of the most recent version ( latest_version_id ), so renaming a rule that is published does not change the name the Agents see. Use published_name for that. Between 1 and 120 characters.

status STRING

Whether the rule has a published version. This attribute is derived from published_version_id and cannot be written: it is draft as long as published_version_id is null , and published once a version is published. You can filter and order on it.

has_unpublished_changes BOOLEAN

Whether the rule is published while its most recent version is not the published one. This attribute is derived from published_version_id and latest_version_id and cannot be written: it is true only when the rule is published and published_version_id differs from latest_version_id . It is false for every draft. You can filter and order on it.

latest_version_id UUID

Unique identifier of the most recent AIRuleVersion of this rule, i.e. the draft that is being edited. It moves to a new version every time the name or the content of the rule changes.

published_version_id UUID

Unique identifier of the AIRuleVersion that Agents use, or null when the rule is not published. This is the only publication attribute you can write: see Update AIRule .

published_name STRING

Name the rule had when its current version was published, or null when the rule is not published. It stays put while the draft is renamed, so it is the name to show and to search on for published rules.

published_at DATETIME

Moment the current version was published, or null when the rule is not published. Publishing a version that is already published leaves it untouched.

organization_id UUID

Unique identifier of the organization that owns the rule. Rules are never visible outside their organization.

user_id UUID

Unique identifier of the user that created the rule. It does not restrict who may edit the rule: see the access rights of each call.

created_at DATETIME

A ISO date time string format

updated_at DATETIME

A ISO date time string format

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"
}