> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lemlist.com/llms.txt
> Use this file to discover all available pages before exploring further.

> Lists every field you can use in the advancedFilters tree of Search Tasks.

# List Task Filters

Each row tells you how a field can be addressed:

* **`type`** decides the allowed **`operators`** — a `date` field takes
  `is_before`, an `enum` field takes `is_any_of`, and so on.
* **`queryParam`** is the bridge between the two tiers: when it is set, a flat
  query parameter of that name addresses the field on
  [Search Tasks](/api-reference/endpoints/tasks/get-many-tasks-v2); when it is
  `null`, go through `advancedFilters`.
* **`custom: true`** marks one of your team's custom fields. They are resolved per
  team, so this response is the authoritative list for your account.

Use `scope` to keep only the task, contact or company fields, and `search` to
match a field id or label.


## OpenAPI

````yaml get /v2/tasks/filters
openapi: 3.0.0
info:
  title: lemlist API
  version: 1.0.0
  description: >-
    Welcome to the lemlist Developer Documentation.


    lemlist is very customizable and open. You'll find on this page all the API
    and integration you can do with lemlist.


    # Rate Limit


    lemlist's API rate limits requests in order to prevent abuse and overload of
    our services.  

    Rate limits are applied on all routes and per API key performing the
    request.  

    The rate limits are **20** requests per **2** seconds.  

    The response provides any information you may need about it:


    | Header | Description |

    | --- | --- |

    | Retry-After | The number of seconds in which you can retry |

    | X-RateLimit-Limit | The maximum requests in that time |

    | X-RateLimit-Remaining | The number of remaining requests you can make |

    | X-RateLimit-Reset | The date when the rate limit will reset |


    _Example of values for the rate limit headers_


    ``` json

    {
        "Retry-After": 2,
        "X-RateLimit-Limit": 20,
        "X-RateLimit-Remaining": 7,
        "X-RateLimit-Reset" : "Tue Feb 16 2021 09:02:42 GMT+0100 (Central European Standard Time)"
    }

     ```

    # Definitions


    ## Team


    A team is the entity of lemlist that can handle users and billing.


    ## Credits


    Credits are the coins a team uses to enrich emails, LinkedIn URLs, etc. via
    the enrich route. Each enrichment feature needs a certain amount of credits
    to run.


    ## User


    You use a user account to connect to lemlist and send messages via the
    connected emails or LinkedIn account.


    ## Campaign


    A campaign is the entity to automate outreach. A campaign has multiple
    sequences composed of steps.


    ## Lead


    A lead is a person that you try to contact via a campaign.


    ## Activity


    An activity is the history of all the steps.


    ## Unsubscribe


    An unsubscribe occurs when a person decides they don't want to receive
    emails from you anymore.


    # Authentication


    All API routes use the dedicated subdomain `api.lemlist.com`.


    lemlist uses API keys to allow access to the API. You can get your lemlist
    API key at our [integration
    page](https://app.lemlist.com/settings/integrations).


    You need to add the `Authorization` header using the `Basic` authentication
    type. `login:password` **where the login is always empty and the password is
    the API key**.


    ⚠️ **Don't forget to add the semicolon (**`:`**) before your API key in curl
    command.**


    > To authorize, use this code: 
      

    ``` shell

    curl https://api.lemlist.com/api/team \
      --user ":YourApiKey"

     ```

    **Make sure to replace** **`YourApiKey`** **with your API key.**


    # Give feedback


    If you want to report a bug, ask for data, or share with us a use case,
    please fill this [form](https://lemlist.typeform.com/to/mfVlkyGf). It will
    help us centralize your needs!
servers:
  - url: https://api.lemlist.com/api
security:
  - basicAuth: []
paths:
  /v2/tasks/filters:
    get:
      tags:
        - Tasks
      summary: List Task Filters
      description: >-
        Lists every field addressable by `advancedFilters` on `GET /v2/tasks`,
        with its type, its allowed operators and the flat query parameter that
        addresses it, when there is one. The team's custom fields are included.
      parameters:
        - name: scope
          in: query
          required: false
          description: Restricts the response to one section.
          schema:
            type: string
            enum:
              - task
              - contact
              - company
          example: contact
        - name: search
          in: query
          required: false
          description: Keeps the fields whose id or label contains this text.
          schema:
            type: string
          example: campaign
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskV2FiltersResponse'
              example:
                results:
                  - field: status
                    label: Status
                    scope: task
                    type: enum
                    custom: false
                    operators:
                      - is
                      - is_not
                      - is_any_of
                      - is_none_of
                      - is_empty
                      - is_not_empty
                    queryParam: status
                    values: null
                  - field: contactLeadStatus
                    label: Lead status
                    scope: contact
                    type: enum
                    custom: false
                    operators:
                      - is
                      - is_not
                      - is_any_of
                      - is_none_of
                      - is_empty
                      - is_not_empty
                    queryParam: null
                    values: null
                total: 57
        '400':
          description: >-
            Invalid parameter — an unknown field, an operator the field type
            does not allow, an unknown `sortBy`, a malformed date range, a
            filter tree over the allowed bounds, or a page beyond the maximum
            result window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskV2Error'
              example:
                success: false
                error:
                  code: UNKNOWN_FIELD
                  message: 'Unknown filter field: contactFoo'
        '401':
          description: The authentication you supplied is incorrect.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskV2Error'
              example:
                success: false
                error:
                  code: ROUTE_UNAUTHORIZED
                  message: Unauthorized
        '405':
          description: Method not allowed — these routes are read-only.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: Method not allowed
        '500':
          description: The search failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskV2Error'
              example:
                success: false
                error:
                  code: SEARCH_FAILED
                  message: Failed to search tasks
components:
  schemas:
    TaskV2FiltersResponse:
      type: object
      description: Response of `GET /v2/tasks/filters`.
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/TaskV2FilterDescriptor'
        total:
          type: integer
    TaskV2Error:
      type: object
      description: Error envelope of the v2 task routes.
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
              description: Machine-readable error code
              enum:
                - INVALID_PARAMETER
                - UNKNOWN_FIELD
                - FIELD_TYPE_MISMATCH
                - INVALID_ADVANCED_FILTERS
                - FILTER_TREE_TOO_COMPLEX
                - UNKNOWN_SORT_FIELD
                - INVALID_DATE_RANGE
                - PAGE_OUT_OF_RANGE
                - SEARCH_FAILED
                - ROUTE_UNAUTHORIZED
                - ROUTE_BAD_METHOD
            message:
              type: string
              description: What was wrong, and what is allowed
    TaskV2FilterDescriptor:
      type: object
      description: One field addressable by `advancedFilters`.
      properties:
        field:
          type: string
          description: Field id, as used in an `advancedFilters` condition
        label:
          type: string
          description: Human-readable name
        scope:
          type: string
          enum:
            - task
            - contact
            - company
          description: Section the field belongs to
        type:
          type: string
          enum:
            - text
            - number
            - date
            - enum
            - relation
            - tags
            - boolean
          description: Data type, which decides the allowed operators
        custom:
          type: boolean
          description: True for a custom field of the team
        operators:
          type: array
          items:
            type: string
          description: Operators allowed on this field
        queryParam:
          type: string
          nullable: true
          description: >-
            Flat query parameter addressing this field; `null` means
            `advancedFilters` only
        values:
          type: array
          nullable: true
          items:
            type: string
          description: Reserved — always `null` today
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````