> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trellis.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# List Organization Rules

> List all rules for the organization

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.

<Note>
  This endpoint requires admin privileges.
</Note>

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from the authenticate endpoint. The authenticated user must be an admin.
</ParamField>

## Response

<ResponseField name="organization_rules" type="array">
  List of organization rule objects.

  <Expandable title="Rule object">
    <ResponseField name="id" type="string">
      Unique rule ID (UUID).
    </ResponseField>

    <ResponseField name="organization_id" type="string">
      Organization this rule belongs to.
    </ResponseField>

    <ResponseField name="content" type="string">
      The rule content.
    </ResponseField>

    <ResponseField name="created_by" type="string">
      Member ID of the admin who created this rule.
    </ResponseField>

    <ResponseField name="last_updated_by" type="string">
      Member ID of the admin who last updated this rule.
    </ResponseField>

    <ResponseField name="last_updated_by_name" type="string">
      Display name of the admin who last updated this rule.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 timestamp when the rule was created.
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      ISO 8601 timestamp when the rule was last updated.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X GET https://api.trellis.sh/v1/organization-rules \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests

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

  rules = response.json()["organization_rules"]
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const response = await fetch("https://api.trellis.sh/v1/organization-rules", {
    headers: { Authorization: "Bearer YOUR_TOKEN" },
  });

  const { organization_rules } = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "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"
      }
    ]
  }
  ```

  ```json 401 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Missing Authorization header"
  }
  ```

  ```json 403 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Admin privileges required"
  }
  ```
</ResponseExample>
