# Queues and routing API

> Queues, queue rules, routing statuses, team routing settings, work sessions, work items and live metrics.

Source: https://developer.kustomer.com/api/queues-and-routing

Server: `https://api.kustomerapp.com/v1` · 37 operations

This category describes endpoints related to Kustomer Queues and Routing.

Queues and routing provide a way for you to organize and collect conversations and route them to your agents in Kustomer.

To learn more, see [Queues and Routing](https://help.kustomer.com/queues-routing-overview-ry92_wFOX) in the Kustomer Help Center.

## Metrics

Queue metrics report how long the most recent customer waited in each queue before an agent took the conversation. Use them to show customers an expected wait or to watch queue health from your own tools.

- [Queue metrics](https://developer.kustomer.com/api/queues-and-routing/queue-metrics.md): `GET /v1/chat/queues/metrics/{ids}`

## Queue Rules

Queue rules decide which queue a new conversation goes to. They are an ordered list of conditions on the conversation, its customer and its latest message; the first enabled rule that matches picks the queue.

- [Get queue rules](https://developer.kustomer.com/api/queues-and-routing/get-queue-rules.md): `GET /v1/routing/queue-rules`
- [Create queue rule](https://developer.kustomer.com/api/queues-and-routing/create-queue-rule.md): `POST /v1/routing/queue-rules`
- [Get queue rule](https://developer.kustomer.com/api/queues-and-routing/get-queue-rule.md): `GET /v1/routing/queue-rules/{id}`
- [Update queue rule](https://developer.kustomer.com/api/queues-and-routing/update-queue-rule.md): `PUT /v1/routing/queue-rules/{id}`
- [Delete queue rule](https://developer.kustomer.com/api/queues-and-routing/delete-queue-rule.md): `DELETE /v1/routing/queue-rules/{id}`
- [Get queue criteria](https://developer.kustomer.com/api/queues-and-routing/get-queue-criteria.md): `GET /v1/routing/queue-rules-criteria`
- [Update queue rule order](https://developer.kustomer.com/api/queues-and-routing/update-queue-rule-order.md): `PUT /v1/routing/queue-rules/order`

## Queues

A queue is a named line of waiting work, such as "Billing" or "VIP Support", that routing uses to decide which agents can take a conversation and in what order. Each queue sets the priority and size of the work that enters it.

- [Get queues](https://developer.kustomer.com/api/queues-and-routing/get-queues.md): `GET /v1/routing/queues`
- [Create queue](https://developer.kustomer.com/api/queues-and-routing/create-queue.md): `POST /v1/routing/queues`
- [Get queue](https://developer.kustomer.com/api/queues-and-routing/get-queue.md): `GET /v1/routing/queues/{id}`
- [Update queue by ID](https://developer.kustomer.com/api/queues-and-routing/update-queue-by-id.md): `PUT /v1/routing/queues/{id}`

## Routing User Statuses

A routing user status is one of the states an agent can be in for routing, such as "Available", "Lunch" or "Training". Admins define the list; each status has a type that decides whether routing sends the agent new work.

- [Get routing user statuses](https://developer.kustomer.com/api/queues-and-routing/get-routing-user-statuses.md): `GET /v1/routing/statuses`
- [Create routing user status](https://developer.kustomer.com/api/queues-and-routing/create-routing-user-status.md): `POST /v1/routing/statuses`
- [Get routing user status](https://developer.kustomer.com/api/queues-and-routing/get-routing-user-status.md): `GET /v1/routing/statuses/{id}`
- [Update routing user status](https://developer.kustomer.com/api/queues-and-routing/update-routing-user-status.md): `PUT /v1/routing/statuses/{id}`

## Team Routing Settings

Team routing settings decide how routing treats the agents on one team. They set which queues the team works, how much work each agent can hold at once, and whether routing is turned on for the team.

- [Get all team routing settings](https://developer.kustomer.com/api/queues-and-routing/get-all-team-routing-settings.md): `GET /v1/routing/settings`
- [Get current user's team routing settings](https://developer.kustomer.com/api/queues-and-routing/get-current-users-team-routing-settings.md): `GET /v1/routing/users/current/settings`
- [Get team routing settings](https://developer.kustomer.com/api/queues-and-routing/get-team-routing-settings.md): `GET /v1/routing/settings/{id}`
- [Update team routing settings](https://developer.kustomer.com/api/queues-and-routing/update-team-routing-settings.md): `PUT /v1/routing/settings/{id}`

## Work Items

A work item is routing's record of one conversation that needs an agent. It tracks which queue the conversation waits in, which agent it was offered to and accepted by, and how long each stage took.

- [Get work items](https://developer.kustomer.com/api/queues-and-routing/get-work-items.md): `GET /v1/routing/work-items`
- [Create work item](https://developer.kustomer.com/api/queues-and-routing/create-work-item.md): `POST /v1/routing/work-items`
- [Get next work item in a queue](https://developer.kustomer.com/api/queues-and-routing/get-next-work-item-in-a-queue.md): `GET /v1/routing/queues/{id}/work-items/next`
- [Get work item](https://developer.kustomer.com/api/queues-and-routing/get-work-item.md): `GET /v1/routing/work-items/{id}`
- [Update work item](https://developer.kustomer.com/api/queues-and-routing/update-work-item.md): `PUT /v1/routing/work-items/{id}`
- [Get work items by conversation](https://developer.kustomer.com/api/queues-and-routing/get-work-items-by-conversation.md): `GET /v1/routing/conversations/{id}/work-items`
- [Get work items in a queue](https://developer.kustomer.com/api/queues-and-routing/get-work-items-in-a-queue.md): `GET /v1/routing/queues/{id}/work-items`

## Work Sessions

A work session is one agent's shift in routing, from the moment they first set a routing status until they go offline. It tracks their status, how much capacity they have left, the work items they hold, and how long they spent in each status.

- [Get work sessions](https://developer.kustomer.com/api/queues-and-routing/get-work-sessions.md): `GET /v1/routing/work-sessions`
- [Get work sessions by queue ID](https://developer.kustomer.com/api/queues-and-routing/get-work-sessions-by-queue-id.md): `GET /v1/routing/queues/{id}/work-sessions`
- [Get work sessions by user ID](https://developer.kustomer.com/api/queues-and-routing/get-work-sessions-by-user-id.md): `GET /v1/routing/users/{id}/work-sessions`

## Work Sessions (by Session ID)

A work session is one agent's shift in routing, from the moment they first set a routing status until they go offline. It tracks their status, how much capacity they have left, the work items they hold, and how long they spent in each status.

- [Get work items By work session](https://developer.kustomer.com/api/queues-and-routing/get-work-items-by-work-session.md): `GET /v1/routing/work-sessions/{id}/work-items`
- [Get work session by ID](https://developer.kustomer.com/api/queues-and-routing/get-work-session-by-id.md): `GET /v1/routing/work-sessions/{id}`
- [Update work session by ID](https://developer.kustomer.com/api/queues-and-routing/update-work-session-by-id.md): `PUT /v1/routing/work-sessions/{id}`

## Work Sessions (Current)

A work session is one agent's shift in routing, from the moment they first set a routing status until they go offline. It tracks their status, how much capacity they have left, the work items they hold, and how long they spent in each status.

- [Get current work session](https://developer.kustomer.com/api/queues-and-routing/get-current-work-session.md): `GET /v1/routing/work-sessions/current`
- [Update current work session](https://developer.kustomer.com/api/queues-and-routing/update-current-work-session.md): `PUT /v1/routing/work-sessions/current`
- [Get current work session by user ID](https://developer.kustomer.com/api/queues-and-routing/get-current-work-session-by-user-id.md): `GET /v1/routing/users/{id}/work-sessions/current`
- [Get work items in current work session](https://developer.kustomer.com/api/queues-and-routing/get-work-items-in-current-work-session.md): `GET /v1/routing/work-sessions/current/work-items`
