---
agentTools:
  projectIndex: https://developers.uberflip.com/llms.txt
---

# Create Filter

This endpoint creates a new Smart Filter.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Uberflip API",
    "version": "2.1",
    "description": "Uberflip API",
    "contact": {
      "name": "Uberflip",
      "url": "https://developers.uberflip.com/",
      "email": "contact@uberflip.com"
    }
  },
  "servers": [
    {
      "url": "https://v2.api.uberflip.com"
    }
  ],
  "tags": [
    {
      "name": "FILTERS"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/filters": {
      "post": {
        "tags": [
          "FILTERS"
        ],
        "summary": "Create Filter",
        "description": "This endpoint creates a new Smart Filter.",
        "operationId": "create-filter",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/filterrequestbody"
                  }
                ],
                "required": [
                  "hub_id",
                  "target_hub_id",
                  "user_id",
                  "name",
                  "run_on",
                  "filter_actions",
                  "filter_search_criteria"
                ],
                "properties": {
                  "hub_id": {
                    "type": "integer",
                    "description": "The Hub identifier"
                  },
                  "user_id": {
                    "type": "integer",
                    "description": "The identifier of the user creating the Filter"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/filter"
                },
                "examples": {
                  "Result": {
                    "value": {
                      "id": 163621,
                      "user_id": 1189437,
                      "hub_id": 75699,
                      "target_hub_id": 75699,
                      "name": "Example Filter",
                      "run_on": "edit",
                      "created_at": "2022-05-19T18:03:50-0400",
                      "modified_at": "2022-05-19T18:03:50-0400",
                      "filter_actions": {
                        "id": 226357,
                        "filter_id": 163621,
                        "data": "{\"add_tags\":{\"list\":[\"436754\"]}}"
                      },
                      "filter_search_criteria": {
                        "id": 226387,
                        "filter_id": 163621,
                        "data": "{\"and_or\":{\"excludes_streams\":\"false\",\"excludes_tags\":\"false\",\"excludes_text\":\"false\",\"includes_streams\":\"false\",\"includes_tags\":\"false\",\"includes_text\":\"false\"},\"includes_streams\":{\"all_streams\":\"Any Stream\"},\"includes_tags\":{\"list\":[\"436748\"]}}"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token from /authorize endpoint"
      }
    },
    "schemas": {
      "filter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The Filter identifier"
          },
          "user_id": {
            "type": "integer",
            "description": "Primary User identifier"
          },
          "hub_id": {
            "type": "integer",
            "description": "The Hub identifier"
          },
          "target_hub_id": {
            "type": "integer",
            "description": "The target Hub identifier"
          },
          "name": {
            "type": "string",
            "description": "The Filter name"
          },
          "run_on": {
            "type": "string",
            "description": "The action triggering the Filter",
            "enum": [
              "create",
              "create_edit",
              "edit",
              "manual"
            ]
          },
          "created_at": {
            "type": "string",
            "description": "The Filter created date",
            "format": "date-time"
          },
          "modified_at": {
            "type": "string",
            "description": "The Filter last modified date",
            "format": "date-time"
          },
          "filter_actions": {
            "type": "object",
            "description": "Object describing Filter actions",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Filter action identifier"
              },
              "filter_id": {
                "type": "integer",
                "description": "The Filter identifier"
              },
              "data": {
                "type": "string",
                "description": "The Filter action data"
              }
            }
          },
          "filter_search_criteria": {
            "type": "object",
            "description": "Object describing Filter search criteria",
            "properties": {
              "id": {
                "type": "integer",
                "description": "The Filter search criteria identifier"
              },
              "filter_id": {
                "type": "integer",
                "description": "The Filter identifier"
              },
              "data": {
                "type": "string",
                "description": "The Filter search criteria data"
              }
            }
          }
        }
      },
      "filterrequestbody": {
        "type": "object",
        "properties": {
          "target_hub_id": {
            "type": "integer",
            "description": "The target Hub identifier"
          },
          "name": {
            "type": "string",
            "description": "The Filter name"
          },
          "run_on": {
            "type": "string",
            "description": "The action triggering the Filter",
            "enum": [
              "create",
              "create_edit",
              "edit",
              "manual"
            ]
          },
          "filter_actions": {
            "type": "object",
            "description": "Object describing Filter actions",
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "type": "string",
                "description": "The Filter action data"
              }
            }
          },
          "filter_search_criteria": {
            "type": "object",
            "description": "Object describing Filter search criteria",
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "type": "string",
                "description": "The Filter search criteria data"
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 99,
      "1": 151,
      "2": 113,
      "3": 115,
      "4": 165,
      "5": 253,
      "6": 73,
      "7": 0,
      "8": 113,
      "9": 158,
      "10": 39,
      "11": 103
    }
  }
}
```