---
title: "Create routing"
method: PUT
path: "/ccaas/1/routing"
tags: ["customer-engagement", "conversations", "conversation-routing"]
---

# Create routing

`PUT /ccaas/1/routing`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/ccaas/1/routing`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.infobip.com/auth/1/oauth2/token`
  - API key in header `Authorization`
  - API key in header `Authorization`
  - HTTP basic

Create routing method creates a new routing setup if it does not exist or replaces the existing setup. As rules inside routing are stored, executed, and retrieved in the provided order with this method, that order cannot be changed. Every expression within routing can be constructed with at least one or more available operators. The result of the expression will be a success (TRUE) only if all results of operations are TRUE. The query will be executed, one expression after another, in the order they are submitted until new a inbound message first matches the expression. Then the message will be assigned to the matched queue.

The order of rules inside routing is essential for proper routing, as rules match in the provided order. The first rule matching the message will be used.
<a href="https://www.infobip.com/docs/conversations/supervisor-guide#queues-and-routing" target="_blank">More info</a>

## Request body

- E89661b226e518f36a162935afcdf1132c95b0e63e9c86c5ef5f31c5a8d865a2CreateRuleApiRequest[]
  - `priority` 'URGENT' | 'HIGH' | 'NORMAL' | 'LOW': Conversation priority.
  - `expression` object, required: Query for logical validation of new messages. See [Routing](https://www.infobip.com/docs/conversations/supervisor-guide#queues-and-routing) for more info.
  - `queueId` string, required: Queue Id is a destination queue where the new message will be assigned to.
  - `enabled` boolean: Enabled is a boolean value (TRUE, FALSE), so the rule is engaged or avoided in the routing process. If not provided will be set to default.
  - `name` string: Rule name, light description of expression logic.
  - `routeOnlyDuringWorkingHours` boolean: When set to true, it indicates that the route should only be processed during designated working hours. [Set up working hours](https://www.infobip.com/docs/api/customer-engagement/conversations-api/create-working-hours)

## Response `200`

OK

- E89661b226e518f36a162935afcdf1132c95b0e63e9c86c5ef5f31c5a8d865a2StatusCodeResponse
  - `statusCode` 'SUCCESS' | 'ERROR'
  - `message` string

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `500`: Internal Server Error

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
