---
title: "Return email filter's information"
method: GET
path: "/Email/get_filter"
tags: ["Email", "Email Filtering"]
---

# Return email filter's information

`GET /Email/get_filter`

This function retrieves an email filter's information.

**Important:**

When you disable the [Receive Mail](https://go.cpanel.net/serverroles) role, the system **disables** this function.

## Query parameters

- `account` string, email, required
- `filtername` string, required

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object
      - `actions` object[] — An array of objects that contains the filter's actions.
        - `action` 'deliver' | 'fail' | 'finish' | 'save' | 'pipe' — The filter's action. * `deliver` - The filter sends mail to the destination address. * `fail` - The filter forces a delivery failure. * `finish` - The filter stops message processing. * `save` - The filter saves mail to the destination file. * `pipe` - The filter sends mail to the destination application.
        - `dest` union — The destination to which the filter sends mail. A destination can be one of the following. * A file path. * An application path. * A valid email address.
          - string, path
          - string, email
        - `number` integer — The filter's position in the order of the account's filters.
      - `filtername` string — The filter's name.
      - `metadata` object
        - `transformed` 1 — Post-processing may have transformed the data.
      - `rules` object[] — An array of objects that contains the filter's rules.
        - `match` 'is' | 'matches' | 'contains' | 'does not contain' | 'begins' | 'does not begin' | 'ends' | 'does not end' | 'does not match' | 'is above' | 'is not above' | 'is below' | 'is not below' — The filter's match type. * `is` * `matches` * `contains` * `does not contain` * `begins` * `does not begin` * `ends` * `does not end` * `does not match` * `is above` * `is not above` * `is below` * `is not below`
        - `number` integer — The filter's position in the order of the account's filters.
        - `opt` 'and' | 'or' | 'null' — The connection between multiple conditions. * `and` - Match both conditions. * `or` - Match either condition. * `null` - There is only one condition.
        - `part` '$header_from:' | '$header_subject:' | '$header_to:' | '$reply_address:' | '$message_body' | '$message_headers' | 'foranyaddress $h_to:,$h_cc:,$h_bcc:' | 'not delivered' | 'error_message' — The queried email section. * `$header_from:` - Matches against the From: section. * `$header_subject:` - Matches against the Subject: section. * `$header_to:` - Matches against the To: section. * `$reply_address:` - Matches against the Reply To: section. * `$message_body` - Matches against the message's body. * `$message_headers` - Matches against the message's headers. * `foranyaddress $h_to:,$h_cc:,$h_bcc:` - Matches against all message recipients. * `not delivered` - Matches if the message is not queued for delivery. * `error_message` - Matches if the incoming message bounced.
        - `val` string — The matched value.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `status` 0 | 1 — * `1` - Success. * `0` - Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.dev/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.dev/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
