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

# Routing

> Configure and manage ticket routing rules for teams

Routing in the Thena platform determines how tickets are distributed among teams and their members. It ensures efficient workload distribution and optimal resource utilization through configurable rules and intelligent assignment strategies.

<Note>
  Routing rules can be configured at both team and member levels, with support for multiple assignment strategies and load balancing mechanisms.
</Note>

## Routing concepts

### Assignment strategies

<CardGroup cols={2}>
  <Card title="Automatic routing" icon="robot">
    • Round robin distribution <br />
    • Load-based balancing <br />
    • Priority-based routing <br />
    • Skill-based matching
  </Card>

  <Card title="Manual routing" icon="hand">
    • Team queue assignment <br />
    • Direct agent assignment <br />
    • Escalation paths <br />
    • Fallback rules
  </Card>
</CardGroup>

### Routing criteria

<AccordionGroup>
  <Accordion title="Ticket properties" icon="ticket">
    * Priority levels
    * Ticket type
    * Customer tier
    * Source channel
    * Custom fields
  </Accordion>

  <Accordion title="Team factors" icon="users">
    * Team capacity
    * Working hours
    * Member availability
    * Skill requirements
    * Current workload
  </Accordion>

  <Accordion title="Business rules" icon="briefcase">
    * SLA requirements
    * Customer preferences
    * Business hours
    * Territory rules
    * Language support
  </Accordion>
</AccordionGroup>

## Routing configuration

### Basic setup

<Steps>
  <Step title="Define routing rules">
    * Set assignment strategy
    * Configure conditions
    * Specify priorities
    * Set load limits
  </Step>

  <Step title="Configure teams">
    * Set team capacity
    * Define working hours
    * Configure availability
    * Set up escalations
  </Step>

  <Step title="Member settings">
    * Set individual capacity
    * Configure skills
    * Define availability
    * Set workload limits
  </Step>
</Steps>

### Advanced settings

<CardGroup cols={2}>
  <Card title="Load balancing" icon="scale-balanced">
    • Workload distribution <br />
    • Capacity management <br />
    • Priority weighting <br />
    • Queue monitoring
  </Card>

  <Card title="Escalation rules" icon="arrow-up">
    • Time-based escalation <br />
    • Priority escalation <br />
    • Team escalation <br />
    • Manager notifications
  </Card>
</CardGroup>

## API endpoints

### Sample routing rule

```json theme={null}
{
  "teamId": "team-123",
  "strategy": "ROUND_ROBIN",
  "conditions": {
    "priority": ["HIGH", "URGENT"],
    "ticketType": ["INCIDENT", "PROBLEM"],
    "customerTier": ["PREMIUM"]
  },
  "loadBalancing": {
    "enabled": true,
    "maxTicketsPerAgent": 10,
    "considerPriority": true
  }
}
```

<Note>
  When creating a routing rule, the system will add additional fields in the response such as `uid`, `createdAt`, `updatedAt`, and `isActive`.
</Note>

### Available operations

<Accordion title="Routing management" icon="route">
  ```bash theme={null}
  # Get team routing
  GET /v1/teams/{teamId}/routing

  # Create routing rule
  POST /v1/teams/{teamId}/routing
  Content-Type: application/json

  # Update routing rule
  PATCH /v1/teams/{teamId}/routing/{ruleId}
  Content-Type: application/json

  # Delete routing rule
  DELETE /v1/teams/{teamId}/routing/{ruleId}
  ```

  <Note>
    All endpoints require authentication and appropriate team admin permissions.
  </Note>

  For detailed API specifications, see <a href="/api-reference/platform/teams/create-a-team-routing-rule" target="_blank">Routing Management</a>
</Accordion>

<Accordion title="Assignment operations" icon="user-check">
  ```bash theme={null}
  # Get current assignments
  GET /v1/teams/{teamId}/assignments

  # Assign ticket
  POST /v1/teams/{teamId}/assignments
  Content-Type: application/json

  # Reassign ticket
  PATCH /v1/teams/{teamId}/assignments/{ticketId}
  Content-Type: application/json
  ```

  #### Assignment request

  ```json theme={null}
  {
    "ticketId": "ticket-123",
    "assigneeId": "user-456",
    "priority": "HIGH",
    "notifyAssignee": true
  }
  ```

  For detailed API specifications, see <a href="/api-reference/platform/teams/update-team-routing" target="_blank">Assignment Operations</a>
</Accordion>

## Best practices

<Steps>
  <Step title="Rule design">
    * Start with simple rules
    * Test thoroughly
    * Monitor effectiveness
    * Iterate based on data
  </Step>

  <Step title="Load management">
    * Set realistic limits
    * Consider priorities
    * Monitor queue health
    * Adjust dynamically
  </Step>

  <Step title="Escalation handling">
    * Define clear paths
    * Set appropriate timers
    * Configure notifications
    * Document procedures
  </Step>
</Steps>

## Related resources

<CardGroup cols={2}>
  <Card title="Teams overview" icon="users" href="/platform/core-concepts/teams/overview">
    Learn about team management
  </Card>

  <Card title="Members" icon="user" href="/platform/core-concepts/teams/members">
    Manage team members
  </Card>

  <Card title="Tickets" icon="ticket" href="/platform/core-concepts/tickets/overview">
    Understand ticket lifecycle
  </Card>

  <Card title="SLA" icon="stopwatch" href="/platform/core-concepts/tickets/sla">
    Configure SLA policies
  </Card>
</CardGroup>
