Help Center / Developer / APIs / Blocklists

APIs

Blocklists in the API

A blocklist is a map of caller-id numbers the Dash API can apply to an account so those callers never reach the phone system. The same API can block callers who hide or restrict their caller id. Create a list, read the lists on the account, and update the numbers in a list with the blocklist requests. Apply the finished list where the account should refuse those calls.

On this page

Blocklists

A blocklist is a map of caller id numbers that can be then apply to the account to block these callers to call the system. You may also configure a blocklist to block callers that block or restrict their caller id.

Create List

You may create a blocklist before you add numbers to the list or you can include an initial list with the payload shown below.

API

Method: PUT

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists

Payload

{
  "data": {
    "name": "Main Blacklist",
    "numbers": {
      "+14154846048": {}
    }
  }
}

CURL Example

curl --location -g --request PUT 'https://public-api.virtualpbx.com:8443/v2/accounts/{ACCOUNT_ID}/blacklists' \
--header 'X-Auth-Token: {AUTH_TOKEN}' \
--header 'Content-Type: application/json' \
--data-raw '{
  "data": {
    "name": "Main Blacklist",
    "numbers": {
        "+14154846048": {
        }
    }
  }
}'

List Lists

You may create a blocklist before you add numbers to the list or you can include an initial list with the payload shown below.

API

Method: GET

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists

Get List

You may create a blocklist before you add numbers to the list or you can include an initial list with the payload shown below.

API

Method: GET

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists/{{blacklist_id}}

Update List

You may create a blocklist before you add numbers to the list or you can include an initial list with the payload shown below.

API

Method: POST

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists

Payload

{
    "data": {
        "name": "Main Blacklist",
        "numbers": {
            "+12109077509": {},
            "+13152151224": {},
            "+18322413415": {}
        }
    }
}

Delete List

You may create a blocklist before you add numbers to the list or you can include an initial list with the payload shown below.

API

Method: DELETE

https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists/{{blacklist_id}}

Payload

{
  "data": {
    "name": "Main Blacklist",
    "numbers": {
      "+14154846048": {}
    }
  }
}