Added the following field to the api/contacts?action=search body parameter:

exclude_folders - If a list of folder identifiers or at least a single folder identifier is given, those folders will not be searched for contacts.