Blacklist
API services for managing blocked caller numbers. A block can be global (for all the Maskyoo numbers in the account) or bound to a specific Maskyoo number (a block that applies only when the caller dials that Maskyoo number).
The system automatically normalizes the format of the phone number that is sent.
get_blacklist
Return records from the blacklist. Without parameters the whole list is returned. On success code 200 is returned together with a result field that contains the records.
Endpoint: /api/?service=get_blacklist
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
caller_number | string | NO | Filter by number (matched by the number suffix). |
maskyoo | string | NO | Filter by the binding to a specific Maskyoo number. It takes effect only when caller_number is not empty. When caller_number is sent without maskyoo, both the global block and the Maskyoo-bound blocks that match that number are returned. |
format | string | NO | json / xml. |
Error code
| Code | Description |
|---|---|
2001 | No results |
add_number_to_blacklist
Add a number to the blacklist.
Endpoint: /api/?service=add_number_to_blacklist
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
caller_number | string | YES | The number to block. |
maskyoo | string | NO | When sent, the block applies only to the Maskyoo + caller combination. |
note | string | NO | A note (truncated to 149 characters). |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
2021 | caller_number is missing, or is left empty after non-numeric characters are stripped |
2022 | The number is already in the blacklist |
2023 | The insert failed |
Example – global block
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
-X POST "https://[MASKYOO_URL]/api/?service=add_number_to_blacklist" \
-d "caller_number=972544224422" \
-d "note=Spam" \
-d "format=json"
Example – block in the context of a specific Maskyoo number
curl -H "Authorization: Bearer YOUR_TOKEN_HERE" \
-X POST "https://[MASKYOO_URL]/api/?service=add_number_to_blacklist" \
-d "caller_number=972544224422" \
-d "maskyoo=972776670000" \
-d "note=blocked at this line only" \
-d "format=json"
remove_number_from_blacklist
Remove a number from the blacklist. If it was added in combination with a Maskyoo number, the maskyoo parameter must be sent here as well.
Endpoint: /api/?service=remove_number_from_blacklist
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
caller_number | string | YES | The number to remove. |
maskyoo | string | NO | Required if the number was added in combination with a Maskyoo number. |
format | string | NO | json / xml. |
Error codes
| Code | Description |
|---|---|
2011 | caller_number is empty / not numeric |
2012 | The number was not found in the list |
2013 | The removal failed |
Releasing a Maskyoo number and the blacklist
When release_maskyoo is called (and also restore_maskyoo), the system usually removes the Maskyoo-level blocks that are bound to that number, but in some configurations those blocks may remain — it is therefore recommended to verify through these blacklist services. Global blocks (with no binding to a Maskyoo number) always remain.
System impact
Adding a number to the blacklist through the API blocks the caller immediately:
- PBX — an incoming call from a blocked number is rejected at the PBX level; no full CDR is produced
- Global versus specific block — without
maskyoothe block applies to all the numbers in the account; withmaskyooit applies only to that caller + Maskyoo combination - Automatic normalization — the system normalizes the phone number format before saving; a duplicate attempt returns
2022 - CRM integration — it is common to feed spammers identified in CRM systems into the API automatically, blocking them across all company numbers
- Releasing a Maskyoo number — releasing a number removes the blocks that are specific to it; global blocks are kept