# Rule Object

Represents a reusable behavior rule that can be attached to assistants, users, threads, and other entities.

## Properties

**`id`** string

Unique identifier with `rule_` prefix.

**`name`** string

Human-readable name for the rule (1-255 characters).

**`description`** string

Optional description explaining the rule's purpose.

**`content`** string

The actual rule content or instructions (1-50,000 characters). Recommended to keep below 10,000 characters for optimal performance.

**`content_preview`** string

First 200 characters of the content for quick preview.

**`category`** string

Rule category. Values: `communication`, `behavior`, `safety`, `compliance`, `custom`.

**`rule_type`** string

Type of rule. Values: `instruction`, `guideline`, `constraint`, `policy`.

**`scope`** string

Visibility scope. Values: `organization`, `team`, `personal`.

**`organization_id`** string

Organization ID with `org_` prefix.

**`created_by`** string

User ID of the creator with `usr_` prefix.

**`is_public`** boolean

Whether the rule is publicly visible to other organizations.

**`is_active`** boolean

Whether the rule is currently active.

**`version`** integer

Version number, increments automatically on updates.

**`metadata`** object

Custom key-value pairs for organizing rules.

**`created_at`** string

ISO 8601 timestamp when the rule was created.

**`updated_at`** string

ISO 8601 timestamp when the rule was last updated.

## Example


```json
{
  "id": "rule_abc123",
  "name": "Customer Support Guidelines",
  "description": "Rules for handling customer support interactions",
  "content": "Always be polite and professional. Respond within 24 hours to customer inquiries. Verify customer identity before discussing account details.",
  "content_preview": "Always be polite and professional. Respond within 24 hours to customer inquiries. Verify customer identity before discussing account details.",
  "category": "communication",
  "rule_type": "guideline",
  "scope": "organization",
  "organization_id": "org_xyz789",
  "created_by": "usr_456",
  "is_public": false,
  "is_active": true,
  "version": 1,
  "metadata": {
    "department": "support",
    "priority": "high"
  },
  "created_at": "2025-11-23T10:00:00Z",
  "updated_at": "2025-11-23T10:00:00Z"
}
```