Get List of Blocked WhatsApp User Numbers

GET Method

The Get List of Blocked WhatsApp User Numbers API allows you to get the list of blocked WhatsApp user numbers that have been blocked for a particular business number.

Prerequisites

  1. Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID. A prerequisite for using Kaleyra WhatsApp APIs is to have an active WhatsApp plan on Kaleyra platform.
  2. To set up a WhatsApp account on Kaleyra platform, see Manual Signup and Embedded Signup.
  3. An active WhatsApp plan for Business API that includes:
    • A WhatsApp business number.
    • An associated profile with the business number.
    • A WhatsApp verified and approved profile.

Base URL

https://<api_domain>/v2/<SID>

📘

Note:

If you are using WhatsApp V1 version, use https://<api_domain>/v1/<SID> endpoint.

API Domain and Value

api_domainValue
IN podapi.in.kaleyra.io
SG Podapi.ap.kaleyra.io
EU Podapi.eu.kaleyra.io
NA podapi.na.kaleyra.ai

API request to Get List of Blocked WhatsApp User Numbers

To get list of blocked WhatsApp user numbers, use: https://<api_domain>/v2/<sid>/whatsapp/<phone_number>/block_users
endpoint with the following request method.

Request Format

The following is the request format to get the list of blocked WhatsApp user numbers:

curl --location --request GET 'https://<api_domain>/v2/<sid>/whatsapp/<phone_number>/block_users?limit=<limit>&before=<before>&after=<after>' \
-H 'api-key: <api-key>'

Sample Request Format

The following is the sample request format to get the list of blocked WhatsApp user numbers:

curl --location --request GET 'https://<api_domain>/v2/HXAP16XXXXXX97IN/whatsapp/+9194070XXXXX/block_users?limit=10&before=NDMyNzQyXXXXXXX&after=MTANTEOTQ1MXXXXXXXXXX' \
-H 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3'

URL Parameters and Headers

The following is the list of parameters and headers to get the list of blocked WhatsApp user numbers:

Parameter / Headers

Data Type

Description

Example

Mandatory?

sid

String

Account SID (Security Identifier).

HXAP16XXXXXX97IN

Yes

phone_number

String

Indicates the WhatsApp Business phone number for which you want to get the list of blocked users.

+9194070XXXXX

Yes

limit

Integer

Maximum number of blocked users to fetch in the response. The default value is set to 25.

10

Optional

before

String

This is the cursor that points to the start of the page of data that has been returned.

NDMyNzQyXXXXXXXX

Optional

after

String

This is the cursor that points to the end of the page of data that has been returned.

MTANTEOTQ1MXXXXXXXXXX

Optional

api-key

String

API key generated from Kaleyra account.

Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3

Yes

Sample Success Response

If all the passed user mobile number are added to the blocklist, the following success message is returned with the status 200 Accepted:

{
    "code": "WA200",
    "message": "Request Processed Successfully",
    "data": [   {
            "messaging_product": "whatsapp",
            "wa_id": "919408XXXXXX"
        },
        {
            "messaging_product": "whatsapp",
            "wa_id": "918074XXXXXX"
        }
    ],
    "paging": {
        "cursors": {
            "before": "NDMyNzQyXXXXXXXX",
            "after": "MTANTEOTQ1MXXXXXXXXXX"
        }
    }
}

Response Parameters

The following is the list of parameters shown in the API response:

ParameterData TypeDescriptionExample
codeStringThe response code for the request sent.WA200
messageStringThe message that corresponds to the response code returned by the API.Request Processed Successfully.
dataObjectThis array shows the details of the returned blocked phone numbers.See the specific table for details.
pagingObjectThis object shows the pagination of the data.See the specific table for details.

Data object Parameters

The following is the list of parameters for Data object in the API response.

ParameterData TypeDescriptionExample
messaging_productStringThe platform being used for messaging.The only value returned is whatsapp.
wa_idStringThe phone number of the blocked user.919408XXXXXX

Paging object Parameters

The data returned in the response object would be used for navigating between the previous and the next page.

The following is the list of parameters for paging object in the API response.

ParameterData TypeDescriptionExample
cursorsStringIndicates the pagination details to be used in the API, if required.See the specific table for details.

Cursors object Parameters

The following is the list of parameters for cursors object in the API response.

ParameterData TypeDescriptionExample
beforeStringThis is the cursor that points to the start of the page of data that has been returned.NDMyNzQyXXXXXXXX
afterStringThis is the cursor that points to the end of the page of data that has been returned.MTANTEOTQ1MXXXXXXXXXX

Sample Failure Responses

The following are the failure responses:

WhatsApp Phone Number Check

401 Unauthorized Phone Number Status
{
    "code": "WA401",
    "message": "The phone number you're using not active",
    "data": {},
    "error": {
        "phone_number": "The phone number you're using not active"
    }
}
401 Unauthorized Phone number
{
    "code": "WA401",
    "message": "Phone number is not present or does not belong to the account.",
    "data": {},
    "error": {
        "phone_number": "Phone number is not present or does not belong to the account."
    }
}

API Key and SID validations

401 Unauthorized
{
    "code": "RBC001",
    "message": "Incorrect SID or API key.",
    "data": [],
    "error": {
        "error": "Incorrect SID or API key."
    }
}

Payload Validations

400 Incorrect payload
{
    "code": "WA400",
    "message": "Refer to correct payload format",
    "data": {},
    "error": {
        "payload": "Incorrect payload format"
    }
}

Internal Server Errors

500 Internal Server Error
{
    "code": "WA500",
    "message": "Please try again later",
    "data": {},
    "error": {
        "error": "Internal server error"
    }
}

For more information on the Block Users Error Codes, see Block Users Error Codes page.





© 2025 Kaleyra Inc. All rights reserved.
Trademarks, logos and service marks displayed on this site are registered and unregistered trademarks of Kaleyra Inc.