{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-apis.sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"WHM API 1 Filter Output","description":"With its world-class support and rich feature set, cPanel &amp; WHM has been the industry-leading web hosting platform for over 20 years. Trusted worldwide by our technology partners WordPress, CloudLinux, LiteSpeed, and more.","siteUrl":"https://api.docs.cpanel.net/","image":"/assets/cpanel-whm.ccd85fdccb18de0645f8a6ebf38e36a0489b92fc9d4ca92776f06aa5a160b167.db81178d.svg","keywords":"documentation, api, portal, cpanel","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"whm-api-1-filter-output","__idx":0},"children":["WHM API 1 Filter Output"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use additional variables to filter WHM API 1 output."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Notes:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can test WHM API 1 functions in WHM's ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://go.cpanel.net/whmdocsAPIShell"},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["API Shell"]}]}," interface (",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Home >> Development >> API Shell"]},"). Click ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Show Sort/Filter/Paginate Options"]}," to display the additional text boxes."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"filter-output","__idx":2},"children":["Filter output"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["WHM API 1 filters use four basic variables:"]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apifilterenable","__idx":3},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.enable"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description:"]}," Whether to enable filtering."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type:"]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Boolean"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible values:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," - Enable filtering."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["0"]}," - Disable filtering."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apifilterafield","__idx":4},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.field"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description:"]}," The return to match against."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type:"]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible values:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The name of one of the function's returns.  You can use the asterisk character (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["*"]},") to filter across all of a function's returns."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apifilteraarg0","__idx":5},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.arg0"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description:"]}," The return value to match."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type:"]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible values:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["An integer or string value."]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apifilteratype","__idx":6},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.type"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description:"]}," The match type. This variable defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contains"]},"."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.arg0"]}," value is a string, use a string operator."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.arg0"]}," value is an integer, use a numeric operator."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type:"]}," ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Possible Values:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Numeric operators:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["=="]}," - The numeric value is equal to the match value."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lt"]}," - The value is less than the match value. This match type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["cannot"]}," handle unlimited values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lt_equal"]}," - The value is less than or equal to the match value. This match type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["cannot"]}," handle unlimited values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lt_handle_unlimited"]}," - The value is less than the match value. This match type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["can"]}," handle unlimited values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gt"]}," - The value is greater than the match value. This match type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["cannot"]}," handle unlimited values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gt_equal"]}," - The value is greater than or equal to the match vale. This match type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["cannot"]}," handle unlimited values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gt_handle_unlimited"]}," - The value is greater than the match value. This match type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["can"]}," handle unlimited values."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["String operators:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["begins"]}," - The value begins with the match value's string."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contains"]}," - The value contains the match value's string."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["eq"]}," - The string value is equal to the match value."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":7},"children":["Examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example function calls execute the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/openapi/whm/operation/listaccts/"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listaccts"]}]}," function and filter the results to return only accounts with a maximum of 400 subdomains:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON API"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"json-api/listaccts?api.version=1&api.filter.a.field=maxsub&api.filter.a.arg0=400&api.filter.a.type=%3D%3D&api.filter.enable=1\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Command Line"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"whmapi1 listaccts api.filter.enable=1 api.filter.a.field=maxsub api.filter.a.arg0=400 api.filter.a.type=%3D%3D\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"use-multiple-filters","__idx":8},"children":["Use multiple filters"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use multiple filters on a single WHM API 1 call, increment the letter in each filter variable."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For example, use the following variables to pass two sets of filter information:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Pass the first set of filter information to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.field"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.arg0"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.a.type"]}," variables."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Pass the second set of filter information to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.b.field"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.b.arg0"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.b.type"]},"  variables"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Do not include more than one ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["api.filter.enable"]}," Boolean variable."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"more-examples","__idx":9},"children":["More Examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example function calls execute the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/openapi/whm/operation/listaccts/"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["listaccts"]}]}," function and filter the results to return only accounts with a maximum of 400 subdomains that use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paper_lantern"]}," theme:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON API"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"json-api/listaccts?api.version=1&api.filter.a.field=maxsub&api.filter.a.arg0=400&api.filter.a.type=%3D%3D&api.filter.b.field=theme&api.filter.b.arg0=paper_lantern&api.filter.b.type=eq&api.filter.enable=1\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Command Line"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"whmapi1 listaccts api.filter.enable=1 api.filter.a.field=maxsub api.filter.a.arg0=400 api.filter.a.type=%3D%3D api.filter.b.field=theme api.filter.b.arg=paper_lantern api.filter.b.type=eq\n"},"children":[]}]},"headings":[{"value":"WHM API 1 Filter Output","id":"whm-api-1-filter-output","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Filter output","id":"filter-output","depth":2},{"value":"api.filter.enable","id":"apifilterenable","depth":3},{"value":"api.filter.a.field","id":"apifilterafield","depth":3},{"value":"api.filter.a.arg0","id":"apifilteraarg0","depth":3},{"value":"api.filter.a.type","id":"apifilteratype","depth":3},{"value":"Examples","id":"examples","depth":2},{"value":"Use multiple filters","id":"use-multiple-filters","depth":3},{"value":"More Examples","id":"more-examples","depth":2}],"frontmatter":{"seo":{"title":"WHM API 1 Filter Output"}},"lastModified":"2026-11-03T20:46:36.146Z","pagePropGetterError":{"message":"","name":""}},"slug":"/whm/filter-output","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}