Skip to main content
Returns all organization rules, ordered by most recently updated first. Rules are applied by the AI agent as behavioral guidelines for all conversations in the organization.
This endpoint requires admin privileges.
Authorization
string
required
Bearer token obtained from the authenticate endpoint. The authenticated user must be an admin.

Response

organization_rules
array
List of organization rule objects.
curl -X GET https://api.trellis.sh/v1/organization-rules \
  -H "Authorization: Bearer YOUR_TOKEN"
import requests

response = requests.get(
    "https://api.trellis.sh/v1/organization-rules",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
)

rules = response.json()["organization_rules"]
const response = await fetch("https://api.trellis.sh/v1/organization-rules", {
  headers: { Authorization: "Bearer YOUR_TOKEN" },
});

const { organization_rules } = await response.json();
{
  "organization_rules": [
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "organization_id": "org_01HX...",
      "content": "Always cite the data source when presenting figures",
      "created_by": "member_01HX...",
      "last_updated_by": "member_01HX...",
      "last_updated_by_name": "Jane Smith",
      "created_at": "2025-02-10T08:00:00+00:00",
      "updated_at": "2025-02-10T08:00:00+00:00"
    }
  ]
}
{
  "detail": "Missing Authorization header"
}
{
  "detail": "Admin privileges required"
}