---
notionId: "8910b7f23a62426e82ff46a6599300cf"
product: "developer"
cluster: "apis"
intent: "developer.api-blocklists"
docSlug: "api-blocklists"
task: "Blocklists in the API"
title: "Blocklists in the API | VirtualPBX"
meta_description: "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"
answer: "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."
audience: "user"
updated: "2022-12-06"
legacy: ["blocklists"]
headings: [{"depth":2,"text":"Blocklists","id":"blocklists"},{"depth":3,"text":"Create List","id":"create-list"},{"depth":3,"text":"API","id":"api"},{"depth":3,"text":"Payload","id":"payload"},{"depth":3,"text":"CURL Example","id":"curl-example"},{"depth":3,"text":"List Lists","id":"list-lists"},{"depth":3,"text":"API","id":"api-1"},{"depth":3,"text":"Get List","id":"get-list"},{"depth":3,"text":"API","id":"api-2"},{"depth":3,"text":"Update List","id":"update-list"},{"depth":3,"text":"API","id":"api-3"},{"depth":3,"text":"Payload","id":"payload-1"},{"depth":3,"text":"Delete List","id":"delete-list"},{"depth":3,"text":"API","id":"api-4"},{"depth":3,"text":"Payload","id":"payload-2"}]
lint: []
---

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

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists</code></pre>

### Payload

<pre tabindex="0"><code class="language-json">{
  &quot;data&quot;: {
    &quot;name&quot;: &quot;Main Blacklist&quot;,
    &quot;numbers&quot;: {
      &quot;+14154846048&quot;: {}
    }
  }
}</code></pre>

### CURL Example

<pre tabindex="0"><code class="language-javascript">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 '{
  &quot;data&quot;: {
    &quot;name&quot;: &quot;Main Blacklist&quot;,
    &quot;numbers&quot;: {
        &quot;+14154846048&quot;: {
        }
    }
  }
}'</code></pre>

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

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists</code></pre>

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

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists/{{blacklist_id}}</code></pre>

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

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists</code></pre>

### Payload

<pre tabindex="0"><code class="language-json">{
    &quot;data&quot;: {
        &quot;name&quot;: &quot;Main Blacklist&quot;,
        &quot;numbers&quot;: {
            &quot;+12109077509&quot;: {},
            &quot;+13152151224&quot;: {},
            &quot;+18322413415&quot;: {}
        }
    }
}</code></pre>

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

<pre tabindex="0"><code class="language-javascript">https://public-api.virtualpbx.com:8443/v2/accounts/{{account_id}}/blacklists/{{blacklist_id}}</code></pre>

### Payload

<pre tabindex="0"><code class="language-javascript">{
  &quot;data&quot;: {
    &quot;name&quot;: &quot;Main Blacklist&quot;,
    &quot;numbers&quot;: {
      &quot;+14154846048&quot;: {}
    }
  }
}</code></pre>
