Filters

Each filter is essentially a set of data validation conditions. A filter of the same kind can be applied when fetching list of Deals, Persons, Organizations, Products or Deals in the context of a Pipeline. When applied, only items matching the conditions of the filter are returned. Detailed definitions of filter conditions and additional functionality is not yet available.

Get all filters

Copy link
Copy to clipboard
GET

/v1/filters

Returns data about all filters.

Query parameters

type

string

The types of filters to fetch

Values

deals

org

people

products

activity

Response
200

success

Expand all
Copy code
    • true
    • [ ... ]

    Get all filter helpers

    Copy link
    Copy to clipboard
    GET

    /v1/filters/helpers

    Returns all supported filter helpers. It helps to know what conditions and helpers are available when you want to add or update filters. For more information on how filter’s helpers can be used, see this tutorial.

    Response
    200

    success

    Expand all
    Copy code
      • true
      • { ... }

      Get one filter

      Copy link
      Copy to clipboard
      GET

      /v1/filters/{id}

      Returns data about a specific filter. Note that this also returns the condition lines of the filter.

      Path parameters

      id

      integer

      required

      The ID of the filter

      Response
      200

      success

      Expand all
      Copy code
        • true
        • { ... }

        Add a new filter

        Copy link
        Copy to clipboard
        POST

        /v1/filters

        Adds a new filter, returns the ID upon success. Note that in the conditions JSON object only one first-level condition group is supported, and it must be glued with 'AND', and only two second level condition groups are supported of which one must be glued with 'AND' and the second with 'OR'. Other combinations do not work (yet) but the syntax supports introducing them in future. For more information on how to add a new filter, see this tutorial.

        Body parameters

        application/json

        name

        string

        required

        The name of the filter

        conditions

        object

        required

        The conditions of the filter as a JSON object. It requires a minimum structure as follows: {"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. Replace CONDITION_OBJECTS with JSON objects of the following structure: {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or leave the array empty. Depending on the object type you should use another API endpoint to get field_id. There are five types of objects you can choose from: "person", "deal", "organization", "product", "activity" and you can use these types of operators depending on what type of a field you have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT LIKE '%$'". To get a better understanding of how filters work try creating them directly from the Pipedrive application.

        type

        required

        The type of filter to create

        Values

        deals

        org

        people

        products

        activity

        Response
        200

        success

        Expand all
        Copy code
          • true
          • { ... }

          Update filter

          Copy link
          Copy to clipboard
          PUT

          /v1/filters/{id}

          Updates an existing filter.

          Path parameters

          id

          integer

          required

          The ID of the filter

          Body parameters

          application/json

          name

          string

          The name of the filter

          conditions

          object

          required

          The conditions of the filter as a JSON object. It requires a minimum structure as follows: {"glue":"and","conditions":[{"glue":"and","conditions": [CONDITION_OBJECTS]},{"glue":"or","conditions":[CONDITION_OBJECTS]}]}. Replace CONDITION_OBJECTS with JSON objects of the following structure: {"object":"","field_id":"", "operator":"","value":"", "extra_value":""} or leave the array empty. Depending on the object type you should use another API endpoint to get field_id. There are five types of objects you can choose from: "person", "deal", "organization", "product", "activity" and you can use these types of operators depending on what type of a field you have: "IS NOT NULL", "IS NULL", "<=", ">=", "<", ">", "!=", "=", "LIKE '%$%'", "NOT LIKE '%$%'", "LIKE '$%'", "NOT LIKE '$%'", "LIKE '%$'", "NOT LIKE '%$'". To get a better understanding of how filters work try creating them directly from the Pipedrive application.

          Response
          200

          success

          Expand all
          Copy code
            • true
            • { ... }

            Delete multiple filters in bulk

            Copy link
            Copy to clipboard
            DELETE

            /v1/filters

            Marks multiple filters as deleted.

            Query parameters

            ids

            string

            required

            Comma-separated filter IDs to delete

            Response
            200

            success

            Expand all
            Copy code
              • true
              • { ... }

              Delete a filter

              Copy link
              Copy to clipboard
              DELETE

              /v1/filters/{id}

              Marks a filter as deleted.

              Path parameters

              id

              integer

              required

              The ID of the filter

              Response
              200

              success

              Expand all
              Copy code
                • true
                • { ... }

                Subscribe to Pipedrive’s Developer Newsletter