> For the complete documentation index, see [llms.txt](https://docs.iadvize.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.iadvize.dev/use-cases/visitor-experience/check-availability-before-escalating-to-iadvize.md).

# Check availability before escalating to iAdvize

## Introduction

The purpose of this guide is to explain how you can ensure that there is availability behind an iAdvize distribution rule.

A distribution rule is what defines the strategy for distributing conversations to bots or operators based, for instance, on their availability.

This can be useful, for example, when you want to transfer your visitors to iAdvize from a solution / technology external to iAdvize (IVR, third-party chat tool, form, ...).

## Check availability

The [`RoutingRule`](https://graphql.iadvize.dev/types/RoutingRule) object contains an [`availability`](https://graphql.iadvize.dev/types/RoutingRuleAvailability) property which lets you know the availability of a specific `RoutingRule` at the precise moment you execute the request.

You can check availability for different channels (chat, call, video and thirdParties).

### GraphQL example

The following GraphQL query finds out the availability on the chat channel of the rule `YOUR_ROUTING_RULE_ID` (replace with your own rule UUID for which you want to check availability).

It returns a Boolean indicating whether or not there is availability for each channel you've consulted (here, only the Chat channel).

{% hint style="info" %}
If your are logged in into your iAdvize account, [you can click here to test the request](https://ha.iadvize.com/apollo?explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4QEcYIE4CeABAMICGANhQBQAkeEMKAlkgOYBKMFCAkmOiIBVIbwAiAQgCURYAB0kRIgyatO3BNWYCi9Ri3Zce-GfMVKiZAG5lmFMgCM7zFMTMWLUABZkUshR4ezADOAII2do48AYEAvjFK8eZJsSAANCA2eMxRCMEYIO5EciAqBurGYCWCJQCaAPJCHAD6HI0AKrwAcgDirUIAMgCizeIlCqmxQA)
{% endhint %}

#### Request

```graphql
query Call($routingRuleId: UUID!) {
  routingRule(id: $routingRuleId) {
    availability {
      chat {
        isAvailable
      }
    }
  }
}
```

#### Variables

```json
{
  "routingRuleId": "YOUR_ROUTING_RULE_ID" // Replace with your own routing rule UUID
}
```

#### Response (example)

```json
{
  "data": {
    "routingRule": {
      "availability": {
        "chat": {
          "isAvailable": false
        }
      }
    }
  }
}
```
