# Run a specific BoxTrapper action for a message

This function performs a specified action on messages in the BoxTrapper queue.

Important:

When you disable the Receive Mail role, the system disables this function.

Endpoint: GET /BoxTrapper/process_messages
Version: 11.136.0.31
Security: BasicAuth

## Query parameters:

  - `action` (string, required)
    The action to perform on the email message file. To perform multiple actions on the specified email messages, pass this parameter multiple times.

* deliver — Deliver a specific message.
* deliverall — Deliver all messages from a sender.
* delete — Delete a message.
* deleteall — Delete all messages from a sender.
* blacklist — Blacklist the sender of an email message.
* whitelist — Whitelist the sender of an email message.
* ignore — Ignore email messages from a sender.

Note:

The function performs the actions on the email messages files in the order that you pass each action.
    Enum: "deliver", "deliverall", "delete", "deleteall", "blacklist", "whitelist", "ignore"

  - `queuefile` (string, required)
    The filename of the email message to process. To process multiple email messages, pass this parameter multiple times.
    Example: "example.msg"

  - `email` (string)
    The account's email address.

Warning:

* The email parameter is required when this function is called outside of Webmail.
* If you call this function in Webmail, the email parameter is not required, and
the system overrides this parameter with the current authenticated user's email address.
    Example: "user@example.com"

## Response 200 fields (application/json):

  - `apiversion` (integer)
    The version of the API.
    Example: 3

  - `func` (string)
    The name of the method called.
    Example: "process_messages"

  - `module` (string)
    The name of the module called.
    Example: "BoxTrapper"

  - `result` (object)

  - `result.data` (array)
    An array of objects containing processed email message information.

  - `result.data.email` (string,null)
    The email address for which the system
processed an email message.

  - `result.data.failed` (integer)
    Whether the system failed to process the message.

* 1 - The function failed to process the message. This is the only
possible value.

Note:

The function only returns this value if it fails to process the message.
    Enum: 1

  - `result.data.matches` (array)
    An array of email messages that the system processed.

  - `result.data.operator` (string)
    The operation that the system performed.
* deliver - Delivered a specific message.
* deliverall - Delivered all messages from a sender.
* delete - Deleted a message.
* deleteall - Deleted all messages from a sender.
* blacklist - Blacklisted the sender of an email message.
* whitelist - Whitelisted the sender of an email message.
* ignore - Ignored email messages from a sender.

Note:

The function only returns this value if it successfully processes the message.
    Enum: "deliver", "deliverall", "delete", "deleteall", "blacklist", "whitelist", "ignore"

  - `result.data.reason` (string)
    A message about the failure or the warning.

Note:

The function only returns this value if it fails to processes the message or experiences issues when it processes the message.

  - `result.errors` (array,null)
    List of errors if the API failed.

  - `result.messages` (array,null)
    List of messages generated by the API.

  - `result.metadata` (object)

  - `result.metadata.transformed` (integer)
    Post-processing may have transformed the data.
    Enum: 1

  - `result.status` (integer)
    * 1 - Success
* 0 - Failed. Check the errors field for more details.
    Enum: 0, 1

  - `result.warnings` (array,null)
    List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.


