דלג לתוכן הראשי

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

ParameterTypeRequiredDescription
caller_numberstringNOFilter by number (matched by the number suffix).
maskyoostringNOFilter 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.
formatstringNOjson / xml.

Error code

CodeDescription
2001No results

add_number_to_blacklist

Add a number to the blacklist.

Endpoint: /api/?service=add_number_to_blacklist

Parameters

ParameterTypeRequiredDescription
caller_numberstringYESThe number to block.
maskyoostringNOWhen sent, the block applies only to the Maskyoo + caller combination.
notestringNOA note (truncated to 149 characters).
formatstringNOjson / xml.

Error codes

CodeDescription
2021caller_number is missing, or is left empty after non-numeric characters are stripped
2022The number is already in the blacklist
2023The 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

ParameterTypeRequiredDescription
caller_numberstringYESThe number to remove.
maskyoostringNORequired if the number was added in combination with a Maskyoo number.
formatstringNOjson / xml.

Error codes

CodeDescription
2011caller_number is empty / not numeric
2012The number was not found in the list
2013The 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 maskyoo the block applies to all the numbers in the account; with maskyoo it 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

See also