fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Create a 'person' API endpoint

Open dherder opened this issue 1 year ago • 3 comments

Problem

Users would like to be able to search for the people/humans associated with a device rather than search for a device and find the human associated with it. Additionally, it is not uncommon to have many devices associated with a single person. The use case of wanting to know all the devices a human/person has is much more common than searching for all the people (users) using a single device (like in a shared computer use case).

Potential solutions

From @noahtalerman: I'm thinking the first step could be a GET /fleet/human/:id endpoint (riffing) that returns all devices for a specific person. Then, you could hit an endpoint to apply the label to each device.

dherder avatar Feb 20 '24 18:02 dherder

wanting to know all the devices a human/person has

@dherder heads up that this can be accomplished today w/ GET /hosts?query={email}. This will return all devices that are associated with the person's email.

I agree a new endpoint is easier to understand / clearer. Bringing this to feature fest.

noahtalerman avatar Feb 27 '24 14:02 noahtalerman

@noahtalerman the problem is that if a user wanted to apply a label 1:1 with a "person", they cannot do that with the above approach.

dherder avatar Mar 01 '24 18:03 dherder

the problem is that if a user wanted to apply a label 1:1 with a "person", they cannot do that with the above approach.

Here's how this could work:

  1. Automation hits GET /hosts?query={email} endpoint. This returns a list of hosts for that person (end user).
  2. For each host in the list, automation hits the POST /hosts/:id/labels endpoint to apply the label to each host.
  3. The label is applied to all of the end user's hosts.

Does that work?

noahtalerman avatar Mar 04 '24 19:03 noahtalerman

@noahtalerman that approach doesn't work unfortunately. I want to hit an endpoint to get all the "humans" without knowing anything about an email.

dherder avatar Mar 07 '24 19:03 dherder

@dherder got it. Thanks!

Heads up that we didn't have room for this improvement in the design sprint we just kicked off (4.48).

noahtalerman avatar Mar 11 '24 20:03 noahtalerman