Get devices with a profile installed / not installed via API

Is it possible to retrieve the devices that have a profile installed / not installed via API? We need to collect their DeviceIDs in order to perform actions on them afterwards.

In the console, we can correctly filter the devices.

However, we cannot find any endpoint like /profile/{referenceId}/* that provides this information.

We have also tried using the /devices and /devices/search endpoints with the filter field, but we have not been able to make it work. This test returned KO (copy/paste the console filter and codifiy it):

--header 'accept: application/json' \
--header 'Authorization: Bearer xxx'
 
{
    "$type": "ErrorDetails",
    "ErrorCode": 2058,
    "Message": "Device filter is invalid: 'Profile HasWith { ReferenceId Equal \"776bfd88-339a-42f4-83c0-3abfa99f582f\" AND Status Equal \"Installed\" } '.",
    "Data": [
        "Profile HasWith { ReferenceId Equal \"776bfd88-339a-42f4-83c0-3abfa99f582f\" AND Status Equal \"Installed\" } "
    ],
    "HelpLink": null
}

Is it possible to obtain this information?

Thanks!

7 days ago
SOTI MobiControl
ANSWERS
RS
Rafael Schäfer
7 days ago (edited 7 days ago)

For me following works in the api page of Mobicontrol 2026.0.1 for the filter:

HAS%2520Profile%2520WITH%2520%2528Name%2520CONTAINS%2520%2527wifi%2527%2529
(Searches for all devices which have a profile containing "wifi" in the profile name)

I got this out of the console using developer modes but when you use the api page instead of the external api call, you need to remove the 25 out of it:

HAS%20Profile%20WITH%20%28Name%20CONTAINS%20%27wifi%27%29

Maybe this helps

Hello Rafael! Your API filter returns the following response:

 
 
curl --location 'https://{SOTI_HOST}/MobiControl/api/devices/search?filter=HAS%2520Profile%2520WITH%2520%2528Name%2520CONTAINS%2520%2527wifi%2527%2529' \
--header 'accept: application/json' \
--header 'Authorization: Bearer xxx'

{
"$type": "ErrorDetails",
"ErrorCode": 2058,
"Message": "Device filter is invalid: 'HAS Profile WITH (Name CONTAINS 'wifi')'.",
"Data": [
"HAS Profile WITH (Name CONTAINS 'wifi')"
],
"HelpLink": null
}
 

We are using MobiControl version 2025.1.2.1007. Could that be the issue?

https://SERVER/mobicontrol/api/devices/search?groupPath=PATH&filter=HAS%2520Profile%2520WITH%2520%2528Name%2520CONTAINS%2520%2527wifi%2527%2529&includeSubgroups=false&verifyAndSync=false

Not sure, i just had problems on 2025 as well with the filtering but used there only something like that:

&filter=LastAgentDisconnectTime%2520NOT%2520WITHIN%252020%2520DAYS&includeSubgroups=true
(get all devices went offline for 20 days and include subgroups)

And that worked fine. But they might have aligned that part with 2026 a bit maybe.

I get this data out of developer mode and then the payload for filter for the relevant request.

Have you tried to get this working using the api page from mobicontrol?

Hi,

The filter is now working OK. I’m attaching the exact query I’m using:

curl --location 'https://{{SOTI_HOST}}/MobiControl/WebConsole/api/devices/search?filter=HAS%2520Profile%2520WITH%2520%2528ReferenceId%2520%253D%2520%2527776bfd88-339a-42f4-83c0-3abfa99f582f%2527%2529%2520AND%2520Family%2520%253D%2520%2527AndroidPlus%2527&includeSubgroups=false&verifyAndSync=true&skip=0&take=1000'
--header 'accept: application/json'
--header 'Authorization: Bearer ****'

I was missing the indexing of a property from the console. Once that was done, everything worked perfectly. I also confirmed that you can obtain the "filter" value from the browser’s developer mode — it’s as simple as copy and paste, and it works perfectly.

Thank you very much.