{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml","api-docs-v1/openapi.json":"api-docs-v1/openapi.json"},"props":{"metadata":{"markdoc":{"tagList":["openapi-code-sample"]},"type":"markdown"},"seo":{"title":"Custom Field Filtering"},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"custom-field-filtering","__idx":0},"children":["Custom Field Filtering"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Experimental — this may change or break at any time."]}," Custom field"," ","filtering is not a stable part of the API. Its syntax, the data types each"," ","filter supports and its error responses can change without warning or a"," ","version bump, and integrations built on it may break unexpectedly as a"," ","result. Do not depend on it in production, and expect to update your code"," ","without notice."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom fields are the fields your workspace defines on top of the built-in ones. Endpoints that support custom field filtering take a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["customFields"]}," query parameter, naming the field after a dot:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"?customFields.tier=gold\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The syntax below is the same wherever the filter is accepted. Which endpoints accept it is stated in the API reference — check the endpoint's parameters rather than assuming, as the set of endpoints supporting it may grow."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every key is the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["key"]}," of a custom field returned by ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/v1/openapi/customfields/listcustomfields"},"children":["listCustomFields"]},". Requesting a key that your workspace has not defined returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]},", so call that endpoint first if you are unsure what is available:"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-v1/openapi.json","operationId":"listCustomFields","parameters":{},"options":{},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  https://api.hook.co/v1/organizations/my-organization-id/custom-fields \\\n  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'"},{"lang":"javascript","title":"JavaScript","source":"const organizationId = 'my-organization-id';\nconst resp = await fetch(\n  `https://api.hook.co/v1/organizations/${organizationId}/custom-fields`,\n  {\n    method: 'GET',\n    headers: {\n      Authorization: 'Bearer <YOUR_TOKEN_HERE>'\n    }\n  }\n);\n\nconst data = await resp.text();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const organizationId = 'my-organization-id';\n  const resp = await fetch(\n    `https://api.hook.co/v1/organizations/${organizationId}/custom-fields`,\n    {\n      method: 'GET',\n      headers: {\n        Authorization: 'Bearer <YOUR_TOKEN_HERE>'\n      }\n    }\n  );\n\n  const data = await resp.text();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\norganization_id = \"my-organization-id\"\nurl = \"https://api.hook.co/v1/organizations/\" + organization_id + \"/custom-fields\"\n\nheaders = {\"Authorization\": \"Bearer <YOUR_TOKEN_HERE>\"}\n\nresponse = requests.get(url, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var host = \"https://api.hook.co\";\n    var organizationId = \"my-organization-id\";\n    var pathname = \"/v1/organizations/%7BorganizationId%7D/custom-fields\";\n    var request = HttpRequest.newBuilder()\n      .GET()\n      .uri(URI.create(host + pathname ))\n      .header(\"Authorization\", \"Bearer <YOUR_TOKEN_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"Authorization\", \"Bearer <YOUR_TOKEN_HERE>\"},\n      }\n    };\n\n      var OrganizationId = \"my-organization-id\";\n    using HttpResponseMessage request = await client.GetAsync(\"https://api.hook.co/v1/organizations/\" + OrganizationId + \"/custom-fields\");\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst organizationId = \"my-organization-id\";\n$curl = curl_init();\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_TOKEN_HERE>\"\n  ],\n  CURLOPT_URL => \"https://api.hook.co/v1/organizations/\" . organizationId . \"/custom-fields\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"GET\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  organizationId := \"my-organization-id\";\n  reqUrl := \"https://api.hook.co/v1/organizations/\" + organizationId + \"/custom-fields\"\n  req, err := http.NewRequest(\"GET\", reqUrl, nil)\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_TOKEN_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\norganization_id = 'my-organization-id'\nurl = URI('https://api.hook.co/v1/organizations/' + organization_id + '/custom-fields')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest['Authorization'] = 'Bearer <YOUR_TOKEN_HERE>'\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\norganization_id = \"my-organization-id\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://api.hook.co/v1/organizations/\" %&% organization_id %&% \"/custom-fields\"\n\ndata_req <- GET(\n  url,\n  add_headers(\"Authorization\" = \"Bearer <YOUR_TOKEN_HERE>\"),\n  verbose()\n)\n\ncontent(data_req)"}]},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"matching-values","__idx":1},"children":["Matching values"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Repeat the parameter to match any one of several values:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"?customFields.tier=gold&customFields.tier=silver\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fields holding a boolean accept ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},". Any other value returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"?customFields.is_paying=true\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"matching-a-range","__idx":2},"children":["Matching a range"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Fields holding a number or a date are filtered by a range, naming the bound in brackets. These are filtered this way only — they do not match exact values:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"?customFields.health_score[from]=50&customFields.health_score[to]=100\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Both bounds are required, and both are inclusive. Supplying only one returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Date bounds are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YYYY-MM-DD"]},", or a full ISO 8601 datetime in UTC — the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Z"]}," suffix is required. A datetime carrying a timezone offset, such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2026-01-01T09:30:00+01:00"]},", or none at all is not accepted:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"?customFields.signed_date[from]=2026-01-01&customFields.signed_date[to]=2026-12-31\n?customFields.signed_date[from]=2026-01-01T09:30:00Z&customFields.signed_date[to]=2026-12-31T23:59:59Z\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A date field holds a calendar date, so a datetime bound is narrowed to the day it names and the time carries no meaning. The two examples above match the same records."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"supported-data-types","__idx":3},"children":["Supported data types"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Which filter a custom field accepts depends on its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dataType"]},", as returned by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listCustomFields"]},":"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"dataType"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dataType"]}]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Matching values"},"children":["Matching values"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Matching a range"},"children":["Matching a range"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["array"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["date"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["date_array"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["integer"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["float"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["currency"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["percentage"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["date_array"]}," holds a list of dates and is filtered by a range alone. It matches when any one of its entries falls within the bounds."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Using a filter a field does not support returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]},", naming the data types that do support it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"errors","__idx":4},"children":["Errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every problem with a custom field filter returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400 Bad Request"]}," with a message describing it, rather than silently returning unfiltered results:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Cause"},"children":["Cause"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Example"},"children":["Example"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The custom field is not defined in your workspace"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["?customFields.not_a_field=1"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The field does not support that filter"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["?customFields.tier[from]=a"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["?customFields.signed_date=2026-01-01"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Only one bound of a range was supplied"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["?customFields.health_score[from]=50"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A bound is not a valid date or number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["?customFields.health_score[from]=high"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["?customFields.signed_date[from]=2026-01-01T09:30:00+01:00"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A boolean value is not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["?customFields.is_paying=yes"]}]}]}]}]}]}]},"headings":[{"value":"Custom Field Filtering","id":"custom-field-filtering","depth":1},{"value":"Matching values","id":"matching-values","depth":2},{"value":"Matching a range","id":"matching-a-range","depth":2},{"value":"Supported data types","id":"supported-data-types","depth":2},{"value":"Errors","id":"errors","depth":2}],"frontmatter":{"seo":{"title":"Custom Field Filtering"}},"lastModified":"2026-08-25T07:30:22.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/custom-field-filtering","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}