# Routing Queues

## List routing queues

> Retrieve list of routing queues

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[{"description":"Manage routing queues","name":"routing_queue"}],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"parameters":{"queryLimit":{"description":"Limits the number of results to return","in":"query","name":"limit","schema":{"default":10,"maximum":100,"minimum":1,"type":"integer"}},"queryCursor":{"description":"Pagination token that keeps of track of the current position in the list","in":"query","name":"pageToken","schema":{"maxLength":8000,"type":"string"}},"queryDirection":{"description":"Order in which to retrieve the results","in":"query","name":"reverse","schema":{"default":false,"type":"boolean"}}},"schemas":{"RoutingQueueList":{"type":"object","additionalProperties":false,"required":["results"],"properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/RoutingQueue"}}}},"RoutingQueue":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","priority","teams"],"properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"priority":{"type":"integer","minimum":0,"maximum":100},"teams":{"type":"array","items":{"$ref":"#/components/schemas/RoutingQueueTeam"}},"queuedItems":{"properties":{"email":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"messaging":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"voice":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"RoutingQueueTeam":{"type":"object","additionalProperties":false,"required":["type","ids"],"properties":{"type":{"type":"string","description":"Type of the team","enum":["primary","secondary"]},"ids":{"type":"array","description":"List of Team IDs","items":{"type":"string","format":"uuid"}}}},"QueueItem":{"required":["rootItemId","capacityType","QueuedAt"],"properties":{"rootItemId":{"type":"string","format":"uuid"},"capacityType":{"type":"string"},"QueuedAt":{"type":"string","format":"date-time"}}},"pagination":{"properties":{"nextPageToken":{"description":"The token that can be passed as pageToken in URL to retrieve the next set of results. If missing, no more results to display.","type":"string"},"total":{"description":"The total number of results across all pages.","type":"integer"}},"type":"object"}}},"paths":{"/workspaces/{workspaceId}/inbox/routing-queues":{"get":{"description":"Retrieve list of routing queues","operationId":"listRoutingQueues","parameters":[{"$ref":"#/components/parameters/queryLimit"},{"$ref":"#/components/parameters/queryCursor"},{"$ref":"#/components/parameters/queryDirection"}],"responses":{"200":{"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RoutingQueueList"},{"$ref":"#/components/schemas/pagination"}]}}},"description":"OK"}},"summary":"List routing queues","tags":["routing_queue"]}}}}
```

## Create a routing queue

> Create a new routing queue

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[{"description":"Manage routing queues","name":"routing_queue"}],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"CreateRoutingQueue":{"type":"object","additionalProperties":false,"required":["name","priority","teams"],"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"priority":{"type":"integer","minimum":0,"maximum":100},"teams":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/RoutingQueueTeam"}}}},"RoutingQueueTeam":{"type":"object","additionalProperties":false,"required":["type","ids"],"properties":{"type":{"type":"string","description":"Type of the team","enum":["primary","secondary"]},"ids":{"type":"array","description":"List of Team IDs","items":{"type":"string","format":"uuid"}}}},"RoutingQueue":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","priority","teams"],"properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"priority":{"type":"integer","minimum":0,"maximum":100},"teams":{"type":"array","items":{"$ref":"#/components/schemas/RoutingQueueTeam"}},"queuedItems":{"properties":{"email":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"messaging":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"voice":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"QueueItem":{"required":["rootItemId","capacityType","QueuedAt"],"properties":{"rootItemId":{"type":"string","format":"uuid"},"capacityType":{"type":"string"},"QueuedAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":5},"details":{"type":"object","additionalProperties":true},"message":{"type":"string","minLength":5}}},"ValidationError":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":5},"message":{"type":"string","minLength":5},"details":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"paths":{"/workspaces/{workspaceId}/inbox/routing-queues":{"post":{"description":"Create a new routing queue","operationId":"createRoutingQueue","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoutingQueue"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingQueue"}}},"description":"created"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Workspace not found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Invalid request"}},"summary":"Create a routing queue","tags":["routing_queue"]}}}}
```

## Get routing queue

> Retrieves Routing queue.

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[{"description":"Manage routing queues","name":"routing_queue"}],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"RoutingQueue":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","priority","teams"],"properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"priority":{"type":"integer","minimum":0,"maximum":100},"teams":{"type":"array","items":{"$ref":"#/components/schemas/RoutingQueueTeam"}},"queuedItems":{"properties":{"email":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"messaging":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"voice":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"RoutingQueueTeam":{"type":"object","additionalProperties":false,"required":["type","ids"],"properties":{"type":{"type":"string","description":"Type of the team","enum":["primary","secondary"]},"ids":{"type":"array","description":"List of Team IDs","items":{"type":"string","format":"uuid"}}}},"QueueItem":{"required":["rootItemId","capacityType","QueuedAt"],"properties":{"rootItemId":{"type":"string","format":"uuid"},"capacityType":{"type":"string"},"QueuedAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":5},"details":{"type":"object","additionalProperties":true},"message":{"type":"string","minLength":5}}}}},"paths":{"/workspaces/{workspaceId}/inbox/routing-queues/{routingQueueId}":{"get":{"description":"Retrieves Routing queue.","operationId":"getRoutingQueue","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingQueue"}}},"description":"ok"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Workspace or queue not found."}},"summary":"Get routing queue","tags":["routing_queue"]}}}}
```

## Update a Routing queue

> Modify the details of a specific routing queue.

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[{"description":"Manage routing queues","name":"routing_queue"}],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"UpdateRoutingQueue":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"priority":{"type":"integer","minimum":0,"maximum":100},"teams":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/RoutingQueueTeam"}}}},"RoutingQueueTeam":{"type":"object","additionalProperties":false,"required":["type","ids"],"properties":{"type":{"type":"string","description":"Type of the team","enum":["primary","secondary"]},"ids":{"type":"array","description":"List of Team IDs","items":{"type":"string","format":"uuid"}}}},"RoutingQueue":{"type":"object","additionalProperties":false,"required":["id","workspaceId","name","description","priority","teams"],"properties":{"id":{"type":"string","format":"uuid"},"workspaceId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string"},"priority":{"type":"integer","minimum":0,"maximum":100},"teams":{"type":"array","items":{"$ref":"#/components/schemas/RoutingQueueTeam"}},"queuedItems":{"properties":{"email":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"messaging":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}},"voice":{"type":"array","items":{"$ref":"#/components/schemas/QueueItem"}}}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"QueueItem":{"required":["rootItemId","capacityType","QueuedAt"],"properties":{"rootItemId":{"type":"string","format":"uuid"},"capacityType":{"type":"string"},"QueuedAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":5},"details":{"type":"object","additionalProperties":true},"message":{"type":"string","minLength":5}}},"ValidationError":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":5},"message":{"type":"string","minLength":5},"details":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"paths":{"/workspaces/{workspaceId}/inbox/routing-queues/{routingQueueId}":{"patch":{"description":"Modify the details of a specific routing queue.","operationId":"updateRoutingQueue","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoutingQueue"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoutingQueue"}}},"description":"Updated"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Workspace or queue found"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}},"description":"Invalid queue"}},"summary":"Update a Routing queue","tags":["routing_queue"]}}}}
```

## Delete a Routing queue

> Delete a Routing queue. Items on the queue will be un-queued, then queue will be deleted.

```json
{"openapi":"3.0.3","info":{"title":"Collaboration","version":"v1"},"tags":[{"description":"Manage routing queues","name":"routing_queue"}],"security":[{"user":[]},{"accessKey":[]}],"components":{"securitySchemes":{"user":{"description":"Provide the token that is returned upon login","scheme":"bearer","type":"http","bearerFormat":"jwt"},"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"Error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","minLength":5},"details":{"type":"object","additionalProperties":true},"message":{"type":"string","minLength":5}}}}},"paths":{"/workspaces/{workspaceId}/inbox/routing-queues/{routingQueueId}":{"delete":{"description":"Delete a Routing queue. Items on the queue will be un-queued, then queue will be deleted.","operationId":"deleteRoutingQueue","responses":{"204":{"description":"Deleted"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"description":"Workspace or queue not found"}},"summary":"Delete a Routing queue","tags":["routing_queue"]}}}}
```
