# Verify RCS capability of recipients
---

Not all mobile devices support RCS messaging. Even supported devices might have RCS disabled.

Before sending an RCS message to an end user, you can check whether their phone number can receive RCS messages. If it cannot receive RCS messages, you can use a different channel to communicate with the end user.

This tutorial explains how to use API to identify which of the phone numbers in a list can receive RCS messages from the specified sender.

## Products and channels [#products-channels]

- [RCS](https://www.infobip.com/docs/rcs)

## Prerequisites [#prerequisites]

- Infobip account with **RCS** enabled.

    If you do not have an account, [create a free trial account](https://www.infobip.com/docs/essentials/getting-started/create-an-account) and select **RCS** channel on the welcome screen.

- Infobip API key with the following scope:

    ```rcs:message:send```

    For information about creating an API key with the required scope, refer to [API authorization](https://www.infobip.com/docs/essentials/api-essentials/api-authorization).
- **An HTTP client**. This tutorial uses curl. Alternatively, you can choose the official [Infobip SDK](https://www.infobip.com/docs/sdk) for the required programming language.
- **RCS agent or sender must be configured and launched** on the mobile network/carrier in which you want to check the RCS capability of destination phone numbers.

    If the agent/sender is not launched on the network, the capability check request always returns a negative status for the destination phone numbers.

    To launch the sender or to configure a custom RCS sender, contact your Infobip account manager.
- **Capability checker** must be enabled on your Infobip account. For more information, contact your Infobip account manager.
- **A destination** phone number for which you want to check RCS support.

## Process overview [#process-overview]

Create an API request to check the capability of a list of phone numbers to receive RCS messages. Use one of the following endpoints:

- [Check RCS capability](https://www.infobip.com/docs/api/channels/rcs/rcs-capability-check/capability-check-rcs-destinations-query): You can check a maximum of 500 phone numbers in a single request. Refer to the detailed [implementation steps](#check-synchronous).
- [Check RCS capability (asynchronous)](https://www.infobip.com/docs/api/channels/rcs/rcs-capability-check/capability-check-rcs-destinations-notify): This request runs asynchronously. You can check a maximum of 10,000 phone numbers in a single request. Refer to the detailed [implementation steps](#check-asynchronous).

The response shows the capability statuses of each phone number individually.

## Implementation steps [#implementation-steps]

### Check RCS capability [#check-synchronous]

1. Create an API request to send check the capability of RCS messaging.

    ```curl showLineNumbers copy
    curl -X POST https://api.infobip.com/rcs/2/capability-check/query  
    -H 'Authorization: App {YOUR_API_KEY}'  
    -H 'Content-Type: application/json' 

    {
        "sender": "{YOUR_SENDER}",
        "phoneNumbers": [
        "{YOUR_DESTINATION_NUMBER1}",
        "{YOUR_DESTINATION_NUMBER2}"
        ]
    }
    ```

2. Receive the results through the API response.

    The response has a 200 status and contains the message ID and message status.

    The message status is as follows:

    - **ENABLED**: The device has RCS capability and RCS is enabled in the device.
    - **UNREACHABLE**: The device does not have RCS capability.

    ```curl showLineNumbers copy
    curl -X POST https://api.infobip.com/rcs/2/capability-check/query

    -H 'Authorization: App {YOUR_API_KEY}'\
    -H 'Content-Type: application/json' \

    {

        "capabilityCheckResults": [

        {
            "messageId": "749992b8-cacc-4a01-b366-4f10281f5c5c",
            "phoneNumber": "{YOUR_DESTINATION_NUMBER1}",
            "code": "ENABLED"
        },

        {
            "messageId": "2520f340-738d-415b-a9de-d772b43a513d",
            "phoneNumber": "YOUR_DESTINATION_NUMBER2",
            "code": "UNREACHABLE"
        }

        ]
    }
    ```

### Check RCS capability asynchronously [#check-asynchronous]

1. Create a subscription and notification profile through one of the following ways:
   - Use the Subscriptions Management API.
   - Use [**Infobip web interface**](https://portal.infobip.com/login). On the left-hand menu, go to **Developer tools** > **Subscription management**. For more information, refer to [Subscriptions](https://www.infobip.com/docs/cpaas-x/subscriptions-management) documentation.

2. Create an API request to send check the capability of RCS messaging.

    ```curl showLineNumbers copy
    curl -X POST https://api.infobip.com/rcs/2/capability-check/notify  
    -H 'Authorization: App {YOUR_API_KEY}'  
    -H 'Content-Type: application/json'  
   
    {
        "sender": "{YOUR_SENDER}",
        "phoneNumbers": [
        "{YOUR_DESTINATION_NUMBER1}",
        "{YOUR_DESTINATION_NUMBER2}"
        ],
     
        "notifyUrl": "The_URL_of_your_callback_server",
        "notifyContentType": "application/json"
    }
    ```

3. Receive the results through the API response.

    ```curl showLineNumbers copy
    curl -X POST https://api.infobip.com/rcs/2/capability-check/notify
    -H 'Authorization: App {YOUR_API_KEY}'\
    -H 'Content-Type: application/json' \
    
    {
        "bulkId": "822d0d0e-fd95-445c-b8d9-65e174cc00c5",
        "capabilityCheckRequestStates": [
        {
            "messageId": "26854ca9-4fb8-4173-8e2c-bcf11166cbde",
            "phoneNumber": "{YOUR_DESTINATION_NUMBER1}",
            "status": "PENDING_ENROUTE"
        },

        {
            "messageId": "2775dec6-e49a-4dfa-9459-064964817a7f",
             "phoneNumber": "{YOUR_DESTINATION_NUMBER2}",
             "status": "PENDING_ENROUTE"
        }
        ]
    }
    ```

4. Receive the capability check result on your webhook:

    ```POST: https://{yourDomain}/your/webhook/path```

    On your URL, you should receive a response that has a 200 status and contains a bulkId, message ID, phoneNumber, and message status.

    The message status is as follows:

    - ENABLED – The device has RCS capability and RCS is enabled in the device.
    - UNREACHABLE – The device does not have RCS capability.

    ```curl showLineNumbers copy
    {
        "capabilityCheckResult": {
        "bulkId": "822d0d0e-fd95-445c-b8d9-65e174cc00c5",
        "messageId": "26854ca9-4fb8-4173-8e2c-bcf11166cbde",
        "phoneNumber": "{YOUR_DESTINATION_NUMBER1}",
        "code": "UNREACHABLE"
        }
    }
    {
        "capabilityCheckResult": {
        "bulkId": "822d0d0e-fd95-445c-b8d9-65e174cc00c5",
        "messageId": "2775dec6-e49a-4dfa-9459-064964817a7f",
        "phoneNumber": "{YOUR_DESTINATION_NUMBER2}",
        "code": "ENABLED"
        }
     }
    ```

## Additional resources [#additional-resources]

- RCS API reference documentation.
- [RCS](https://www.infobip.com/docs/rcs) documentation.
- Subscriptions Management API.
- [Subscriptions](https://www.infobip.com/docs/cpaas-x/subscriptions-management#availability) management documentation for the Infobip web interface.
- R[esponse status and error codes](https://www.infobip.com/docs/essentials/api-essentials/response-status-and-error-codes) documentation.
- [Infobip SDK](https://www.infobip.com/docs/sdk) documentation.