Skip to main content

Create Routing Rule

POST /routing-rules

Request Body

{
  "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

{
  "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

import httpx

async with httpx.AsyncClient() as client:
    response = await client.post(
        "https://api.humancheck.dev/reviews",
        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()