<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error using &amp;quot;NOT_IN&amp;quot; on Deals Search API method in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/856112#M67769</link>
    <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to perform a search on Deals, using the API's Search method.&lt;BR /&gt;The search requires 3 parameters in the filters. However, one of these parameters uses the "NOT_IN" operator, as I need the return of all deals from the conditional, except deals that are in specific dealstages, as shown in the body of the request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  async function getDealByMatricula() {
    try {
        filterGroup = { 
          filters: [ 
              {propertyName: 'matricula', operator: 'EQ', value: matricula}, 
              {propertyName: 'associations.contact', operator: 'EQ', value: contactId},
              {propertyName: 'dealstage', operator: 'NOT_IN', values: ['429127', '48914296']}
            ]
        };
        const properties = ['matricula'];
        const limit = 1;
        const dealObjectSearch = { filterGroups: [filterGroup], properties, limit };
        const dealSearchResponse = await hubspotClient.crm.deals.searchApi.doSearch(dealObjectSearch);
		console.log(JSON.stringify(dealSearchResponse.body.results));
        if (dealSearchResponse.body.results.length &amp;gt; 0) {
          return dealSearchResponse.body.results[0].id;
        } else {
          return null;
        }
    } catch (err) {
        throw err;
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When calling the method, HubSpot responds with a 400 error, with the message:&lt;BR /&gt;&lt;EM&gt;"&lt;SPAN&gt;Invalid input JSON on line 1, column 214: operator NOT_IN requires values.&lt;/SPAN&gt;"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use Postman, I get the expected result. I can't see where the error is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2023 13:32:50 GMT</pubDate>
    <dc:creator>rocketman22</dc:creator>
    <dc:date>2023-09-27T13:32:50Z</dc:date>
    <item>
      <title>Error using "NOT_IN" on Deals Search API method</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/856112#M67769</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to perform a search on Deals, using the API's Search method.&lt;BR /&gt;The search requires 3 parameters in the filters. However, one of these parameters uses the "NOT_IN" operator, as I need the return of all deals from the conditional, except deals that are in specific dealstages, as shown in the body of the request:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  async function getDealByMatricula() {
    try {
        filterGroup = { 
          filters: [ 
              {propertyName: 'matricula', operator: 'EQ', value: matricula}, 
              {propertyName: 'associations.contact', operator: 'EQ', value: contactId},
              {propertyName: 'dealstage', operator: 'NOT_IN', values: ['429127', '48914296']}
            ]
        };
        const properties = ['matricula'];
        const limit = 1;
        const dealObjectSearch = { filterGroups: [filterGroup], properties, limit };
        const dealSearchResponse = await hubspotClient.crm.deals.searchApi.doSearch(dealObjectSearch);
		console.log(JSON.stringify(dealSearchResponse.body.results));
        if (dealSearchResponse.body.results.length &amp;gt; 0) {
          return dealSearchResponse.body.results[0].id;
        } else {
          return null;
        }
    } catch (err) {
        throw err;
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When calling the method, HubSpot responds with a 400 error, with the message:&lt;BR /&gt;&lt;EM&gt;"&lt;SPAN&gt;Invalid input JSON on line 1, column 214: operator NOT_IN requires values.&lt;/SPAN&gt;"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I use Postman, I get the expected result. I can't see where the error is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 13:32:50 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/856112#M67769</guid>
      <dc:creator>rocketman22</dc:creator>
      <dc:date>2023-09-27T13:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error using "NOT_IN" on Deals Search API method</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/856995#M67821</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/503235"&gt;@rocketman22&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for your question. We're you able to get this resolved?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If not, have you tried breaking out the filters? To see if we can identify why it's not recognizing the array you're sending with this filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Jaycee&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 21:11:30 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/856995#M67821</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-09-28T21:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Error using "NOT_IN" on Deals Search API method</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/857200#M67838</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074"&gt;@Jaycee_Lewis&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the feedback!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Yes, I tried breaking the filters. Without the "NOT_IN" parameter everything works normally. The code above returns deals without problems, but of course, because it doesn't have the third parameter, it returns the wrong deals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And as mentioned, when I print the request body and use it in Postman (including with the "NOT_IN" operator), the endpoint returns status 200 and I get exactly the response I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 10:30:53 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/857200#M67838</guid>
      <dc:creator>rocketman22</dc:creator>
      <dc:date>2023-09-29T10:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error using "NOT_IN" on Deals Search API method</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/1228795#M85740</link>
      <description>&lt;P&gt;I have seen this error when passing along the Array to the "value" attribute instead of the "values" attribute.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 18:24:46 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Error-using-quot-NOT-IN-quot-on-Deals-Search-API-method/m-p/1228795#M85740</guid>
      <dc:creator>marcelolx</dc:creator>
      <dc:date>2025-11-26T18:24:46Z</dc:date>
    </item>
  </channel>
</rss>

