Update the configuration of an entity attachment (priority, character limit, or active status).

## Path parameters

**`rule_id`** string required

The rule ID

**`entity_type`** string required

Entity type: `assistant`, `user`, `model`, `vector_store`, `organization`

**`entity_id`** string required

The entity ID

## Body parameters

**`priority`** integer optional

Priority for rule application (1-100)

**`character_limit`** integer optional

Character limit for this attachment (100-50000)

**`is_active`** boolean optional

Whether the attachment is active

**`include_rule_details`** boolean optional

Include full rule details in the response.

## Returns

Returns the updated attachment object.


```bash
curl -X PUT "https://api.aitronos.com/v1/rules/rule_a1b2c3d4/attachments/assistant/asst_abc123" \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "priority": 90,
    "is_active": true
  }'
```


```python Python SDK
from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")

attachment = client.rule_attachments.update_attachment(
    "rule_abc123", "assistant", "asst_abc123", priority=90, is_active=True
)
print(f"Updated priority to {attachment.data.priority}")
```


```python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

response = requests.put(
    "https://api.aitronos.com/v1/rules/rule_a1b2c3d4/attachments/assistant/asst_abc123",
    headers={
        "X-API-Key": api_key,
        "Content-Type": "application/json"
    },
    json={
        "priority": 90,
        "is_active": True
    }
)

attachment = response.json()
print(f"Updated priority to {attachment['data']['priority']}")
```


```javascript
const apiKey = process.env.FREDDY_API_KEY;

const response = await fetch(
  'https://api.aitronos.com/v1/rules/rule_a1b2c3d4/attachments/assistant/asst_abc123',
  {
    method: 'PUT',
    headers: {
      'X-API-Key': apiKey,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      priority: 90,
      is_active: true
    })
  }
);

const attachment = await response.json();
console.log(`Updated priority to ${attachment.data.priority}`);
```

**Response** `200 OK`


```json
{
  "success": true,
  "data": {
    "rule_id": "rule_a1b2c3d4",
    "entity_type": "assistant",
    "entity_id": "asst_abc123",
    "priority": 90,
    "character_limit": 1000,
    "is_active": true,
    "created_at": "2025-01-17T12:00:00Z",
    "updated_at": "2025-01-17T13:30:00Z"
  }
}
```

## Related Resources

- [Create Rule](/docs/api-reference/rules/create)
- [List Rules](/docs/api-reference/rules/list)