Get Started
Usage API
More information

POST api/2.0/mail/filters This function requires authentication

Description

Creates a new filter with the parameters specified in the request.

Parameters
Name Description Type Example
filter
sent in body
Filter parameters: ID, name, position, enabled, conditions, actions, options ASC.Mail.Data.Contracts.MailSieveFilterData
Example
POST api/2.0/mail/filters
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json

{
  "filter": {
    "id": 1,
    "name": "name",
    "position": 2,
    "enabled": true,
    "conditions": [
      {
        "key": 1,
        "operation": 1,
        "value": "value"
      }
    ],
    "actions": [
      {
        "action": 1,
        "data": "data"
      }
    ],
    "options": [
      {
        "matchMultiConditions": 1,
        "applyTo": {
          "folders": [
            1
          ],
          "mailboxes": [
            1
          ],
          "withAttachments": 1
        },
        "ignoreOther": true
      }
    ]
  }
}
Returns

Filter

Example Response

application/json

{
  "status": 0,
  "response": {
    "id": 1,
    "name": "name",
    "position": 2,
    "enabled": true,
    "conditions": [
      {
        "key": 1,
        "operation": 1,
        "value": "value"
      }
    ],
    "actions": [
      {
        "action": 1,
        "data": "data"
      }
    ],
    "options": [
      {
        "matchMultiConditions": 1,
        "applyTo": {
          "folders": [
            1
          ],
          "mailboxes": [
            1
          ],
          "withAttachments": 1
        },
        "ignoreOther": true
      }
    ]
  }
}

text/xml

<result>
  <status>0</status>
  <response>
    <id>1</id>
    <name>name</name>
    <position>2</position>
    <enabled>True</enabled>
    <conditions>
      <key>1</key>
      <operation>1</operation>
      <value>value</value>
    </conditions>
    <actions>
      <action>1</action>
      <data>data</data>
    </actions>
    <options>
      <matchMultiConditions>1</matchMultiConditions>
      <applyTo>
        <folders>1</folders>
        <mailboxes>1</mailboxes>
        <withAttachments>1</withAttachments>
      </applyTo>
      <ignoreOther>True</ignoreOther>
    </options>
  </response>
</result>