Associate AIRule

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

Link a rule to an Agent , using the role linked_agents . From then on, that Agent applies the published text of the rule.

An Agent reads the version the rule points at with published_version_id at the moment it runs, so unpublished edits never reach it: saving a draft on a published rule changes nothing for the Agent until you publish that version, and a rule that is not published contributes nothing at all, even while it is linked. You can link a draft rule up front and publish it later.

The same link can be created from the other side with Associate Agent , using the role linked_rules ; see Creating and using Agents through the API for an end-to-end example.

The call is checked on both ends: you need the Organization Member right on the rule, and the right to modify the Agent you are linking it to.

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 Member
&
Entity Modifier
(For: linked_agents)
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": false,
  "latest_version_id": "2e7c8a10-4b3d-4a2f-9c1e-7d6b5a4f3e2d",
  "published_version_id": "2e7c8a10-4b3d-4a2f-9c1e-7d6b5a4f3e2d",
  "published_name": "Discount policy",
  "published_at": "2026-09-18T09:33:47.019Z",
  "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:33:47.019Z"
}