Create AIRule

LLM-friendly URL
POST
https://api.luzmo.com/0.1.0/airule

Rules are the written instructions your AI Agents follow. A rule is owned by an organization, and it carries its text in versions rather than on the rule itself.

Creating a rule requires both a name and a content : Luzmo stores that text as the first AIRuleVersion of the rule and points latest_version_id at it. The rule starts as a draft ( status: "draft" ), which means no Agent applies it yet; publish a version to make it active. The content you send is not returned on the rule, and the rule is only created if its first version is accepted, so a name or body outside the allowed length leaves nothing behind.

Creating a rule requires the Organization Editor right, i.e. the Owners and Designers of the organization.

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": "draft",
  "has_unpublished_changes": false,
  "latest_version_id": "9b1d2f34-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
  "published_version_id": null,
  "published_name": null,
  "published_at": null,
  "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:04:11.204Z"
}