List all entities attached to a rule, ordered by priority.

## Path parameters

**`rule_id`** string required

The rule ID

## Query parameters

**`entity_type`** string optional

Filter by entity type: `assistant`, `user`, `model`, `vector_store`, `organization`

**`is_active`** boolean optional

Filter by active status

## Returns

Returns a list of attachment objects ordered by priority (highest first).


```bash
curl "https://api.aitronos.com/v1/rules/rule_a1b2c3d4/attachments?entity_type=assistant" \
  -H "X-API-Key: $FREDDY_API_KEY"
```


```python Python SDK
from aitronos import Aitronos

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

result = client.rule_attachments.list_rule_attachments("rule_abc123", entity_type="assistant")
print(f"Found {len(result.data)} attachments")
```


```python
import os
import requests

api_key = os.environ["FREDDY_API_KEY"]

response = requests.get(
    "https://api.aitronos.com/v1/rules/rule_a1b2c3d4/attachments",
    headers={"X-API-Key": api_key},
    params={"entity_type": "assistant"}
)

attachments = response.json()
print(f"Found {len(attachments['data'])} attachments")
```


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

const response = await fetch(
  'https://api.aitronos.com/v1/rules/rule_a1b2c3d4/attachments?entity_type=assistant',
  {
    headers: {
      'X-API-Key': apiKey
    }
  }
);

const attachments = await response.json();
console.log(`Found ${attachments.data.length} attachments`);
```

**Response** `200 OK`


```json
{
  "success": true,
  "data": [
    {
      "rule_id": "rule_a1b2c3d4",
      "entity_type": "assistant",
      "entity_id": "asst_abc123",
      "priority": 80,
      "character_limit": 1000,
      "is_active": true,
      "created_at": "2025-01-17T12:00:00Z",
      "updated_at": "2025-01-17T12:00:00Z"
    },
    {
      "rule_id": "rule_a1b2c3d4",
      "entity_type": "assistant",
      "entity_id": "asst_def456",
      "priority": 60,
      "character_limit": 2000,
      "is_active": true,
      "created_at": "2025-01-16T10:00:00Z",
      "updated_at": "2025-01-16T10:00:00Z"
    }
  ]
}
```

## Related Resources

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