List Task Filters
curl --request GET \
--url https://api.lemlist.com/api/v2/tasks/filters \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/v2/tasks/filters"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/v2/tasks/filters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/v2/tasks/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/v2/tasks/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"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
}{
"success": false,
"error": {
"code": "UNKNOWN_FIELD",
"message": "Unknown filter field: contactFoo"
}
}{
"success": false,
"error": {
"code": "ROUTE_UNAUTHORIZED",
"message": "Unauthorized"
}
}{
"error": "Method not allowed"
}{
"success": false,
"error": {
"code": "SEARCH_FAILED",
"message": "Failed to search tasks"
}
}Tasks
List Task Filters
Lists every field you can use in the advancedFilters tree of Search Tasks.
GET
/
v2
/
tasks
/
filters
List Task Filters
curl --request GET \
--url https://api.lemlist.com/api/v2/tasks/filters \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.lemlist.com/api/v2/tasks/filters"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.lemlist.com/api/v2/tasks/filters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://api.lemlist.com/api/v2/tasks/filters")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lemlist.com/api/v2/tasks/filters",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"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
}{
"success": false,
"error": {
"code": "UNKNOWN_FIELD",
"message": "Unknown filter field: contactFoo"
}
}{
"success": false,
"error": {
"code": "ROUTE_UNAUTHORIZED",
"message": "Unauthorized"
}
}{
"error": "Method not allowed"
}{
"success": false,
"error": {
"code": "SEARCH_FAILED",
"message": "Failed to search tasks"
}
}Each row tells you how a field can be addressed:
typedecides the allowedoperators— adatefield takesis_before, anenumfield takesis_any_of, and so on.queryParamis the bridge between the two tiers: when it is set, a flat query parameter of that name addresses the field on Search Tasks; when it isnull, go throughadvancedFilters.custom: truemarks one of your team’s custom fields. They are resolved per team, so this response is the authoritative list for your account.
scope to keep only the task, contact or company fields, and search to
match a field id or label.Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Query Parameters
Restricts the response to one section.
Available options:
task, contact, company Keeps the fields whose id or label contains this text.
Was this page helpful?