Skip to main content

Is there any Jamf Pro API (not the Classic API) that allows retrieval of the membership of a given static computer group?

I found the endpoint GET /v2/computer-groups/smart-group-membership/{id}, which returns the membership of a smart computer group, but I couldn’t find a corresponding endpoint for static groups.

If there isn’t a Jamf Pro API for retrieving the current membership of a static computer group, what’s the recommended way to add a computer to an existing static group using only the Jamf Pro API?

@nkcall This may help you to add a computer to a static group. 

https://github.com/robjschroeder/Jamf-API-Scripts/blob/main/api-AddComputerToStaticGroup.sh


Is there any Jamf Pro API (not the Classic API) that allows retrieval of the membership of a given static computer group?

I found the endpoint GET /v2/computer-groups/smart-group-membership/{id}, which returns the membership of a smart computer group, but I couldn’t find a corresponding endpoint for static groups.

If there isn’t a Jamf Pro API for retrieving the current membership of a static computer group, what’s the recommended way to add a computer to an existing static group using only the Jamf Pro API?



You’re very much in the right place. The endpoint URL is 

/v2/computer-groups/static-groups/{id}

You can find out more on the developer site as well - https://developer.jamf.com/jamf-pro/reference/get_v2-computer-groups-static-groups-id

Hope that helps. 


Thank you, ​@ktrojano , but the API used in your response is the classic one. I would like to know if there is an equivalent endpoint to the classic /JSSResource/computerGroups/id/${computerGroupID} in the new Jamf Pro API.


Thank you ​@r0blee , but the endpoint in your response, /api/v2/computer-groups/static-groups/{id}, does not return members of a given static group. It only returns the ID, name, description and site ID.
I want to know the membership of a given static computer group, but I can't find such an endpoint :-<


Sorry about that ​@nkcall