# API Operators

**URL:** <https://hub.mender.io/t/api-operators/5850>\
**Category:** General Discussions\
**Created:** [May 18, 2023, 9:29pm UTC](https://hub.mender.io/t/api-operators/5850 "2023-05-18T21:29:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![archibaldodlc](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@archibaldodlc](https://hub.mender.io/u/archibaldodlc)\
**Post date:** [May 18, 2023, 9:29pm UTC](https://hub.mender.io/t/api-operators/5850/1 "2023-05-18T21:29:57Z")

</div>

Hi!

I hope everything goes well. We (my team and I) have a doubt about the use of the operators in API in endpoint api/management/v2/inventory/filters/search

When we set the equal ($eq) operator, everything works fine, like this example

```auto
curl -X POST -H "Authorization: Bearer $PERSONAL_ACCESS_TOKEN" -H 'Content-Type: application/json' -H 'Accept: application/json' $MENDER_SERVER_URI/api/management/v2/inventory/filters/search -d @json

{
  "page": 1,
  "per_page": 200,
  "filters": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "type": "$eq",
      "value": "7c9a6515"
    }
  ],
  "sort": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "order": "asc"
    }
  ],
  "attributes": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory"
    }
  ]
}
[{"id":"03d47853-426a-4773-a3b7-7f7ded511d9e","attributes":[{"name":"rootfs-image.script.version","value":"7c9a6515","scope":"inventory"}],"updated_ts":"0001-01-01T00:00:00Z"}]

```

but when we tried another operator (different from $eq) we got an error, like this:

```auto
{
  "page": 1,
  "per_page": 200,
  "filters": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "type": "$ne",
      "value": "7c9a6515"
    }
  ],
  "sort": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory",
      "order": "asc"
    }
  ],
  "attributes": [
    {
      "attribute": "rootfs-image.script.version",
      "scope": "inventory"
    }
  ]
}
{"error":"type: must be a valid value.","request_id":"58db008e-a880-43c9-bf3a-db7d855005f9"}

```

Are these operators (others than $eq) part of the subscription plan?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [May 19, 2023, 8:44am UTC](https://hub.mender.io/t/api-operators/5850/2 "2023-05-19T08:44:42Z")

</div>

Hello @archibaldodlc,

Yes, the guess is actually correct, you’ve hit a shortcoming in the API documentation. The operators other than `$eq` are only available in the Hosted and Enterprise On-Premise offers. I’ll pass this to the team to improve the endpoint notes.

You can find the swagger spec [here](https://github.com/mendersoftware/inventory/blob/b84f0fa8238ad96eedb153f67d3742b25255677e/docs/management_api_v2.yml#L274).

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![archibaldodlc](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@archibaldodlc](https://hub.mender.io/u/archibaldodlc)\
**Post date:** [May 19, 2023, 2:42pm UTC](https://hub.mender.io/t/api-operators/5850/3 "2023-05-19T14:42:36Z")

</div>

Ok, I understand. Thanks for the response @TheYoctoJester

Regards,  
Archibaldo.
