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

# Routing Rules

> Manage routing rules (Platform only)

<Warning>
  Advanced routing with UI control, prioritization, and fine-grained ACL is only available in [Humancheck Platform](/platform/overview).

  Open Source uses simple config-based routing defined in `humancheck.yaml`. See [Configuration: Routing Rules](/configuration/routing-rules) for details.
</Warning>

## Platform Routing Features

Platform provides advanced routing capabilities:

* **UI-Based Management**: Create and manage rules via the dashboard at [platform.humancheck.dev](https://platform.humancheck.dev)
* **Prioritization**: Set rule evaluation order for fine-tuned control
* **Fine-Grained ACL**: Control access and permissions per rule
* **Team/User Assignment**: Assign reviews to specific teams or users
* **Organization Scoping**: Rules scoped to organizations for multi-tenancy

<Tip>
  You can also create and manage routing rules via the UI at [platform.humancheck.dev](https://platform.humancheck.dev). The dashboard provides visual rule builder, prioritization controls, and fine-grained ACL settings.
</Tip>

## Create Routing Rule

```
POST /routing-rules
```

### Request Body

```json theme={null}
{
  "name": "High-value payments to finance team",
  "organization_id": 1,
  "priority": 100,
  "conditions": {
    "task_type": {"operator": "=", "value": "payment"},
    "metadata.amount": {"operator": ">", "value": 10000}
  },
  "assign_to_user_id": null,
  "assign_to_team_id": 5,
  "is_active": true
}
```

### Response

```json theme={null}
{
  "id": 1,
  "name": "High-value payments to finance team",
  "organization_id": 1,
  "priority": 100,
  "conditions": {
    "task_type": {"operator": "=", "value": "payment"},
    "metadata.amount": {"operator": ">", "value": 10000}
  },
  "assign_to_user_id": null,
  "assign_to_team_id": 5,
  "is_active": true,
  "created_at": "2024-01-01T12:00:00Z"
}
```

## Example

```python theme={null}
import httpx

async with httpx.AsyncClient() as client:
    response = await client.post(
        "https://api.humancheck.dev/routing-rules",
        headers={
            "Authorization": "Bearer your-api-key-here",
            "Content-Type": "application/json"
        },
        json={
            "name": "High-value payments to finance team",
            "organization_id": 1,
            "priority": 100,
            "conditions": {
                "task_type": {"operator": "=", "value": "payment"},
                "metadata.amount": {"operator": ">", "value": 10000}
            },
            "assign_to_team_id": 5,
            "is_active": True
        }
    )
    rule = response.json()
```
