# 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
        }
      }
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.iadvize.dev/use-cases/visitor-experience/check-availability-before-escalating-to-iadvize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
