getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
38.91k stars 4.17k forks source link

Bulk API that will return team members for all teams #74918

Open michaelchai-sentry opened 2 months ago

michaelchai-sentry commented 2 months ago

Problem Statement

One of our customers was wondering if we had an API that will return all the team members for every single team in their Sentry org. We currently do not, but we do have this endpoint for listing members for a single team: https://docs.sentry.io/api/teams/list-a-teams-members/

Solution Brainstorm

A bulk API that will return all the team members for every single team, without making separate calls to the members endpoint

Product Area

APIs

getsantry[bot] commented 2 months ago

Assigning to @getsentry/support for routing ⏲️

sentaur-athena commented 2 months ago

@michaelchai-sentry can you please ask the customer use case? Like what this would enable them to do so we can prioritize better

getsantry[bot] commented 2 months ago

Routing to @getsentry/product-owners-apis for triage ⏲️

michaelchai-sentry commented 2 months ago

@sentaur-athena the customer said that using this API, they would like to build a mapping of Sentry teams and how they correlate to their own internal team hierarchy for reporting. Hope this helps!

ceorourke commented 2 months ago

Is there a reason they can't iterate over each team using existing endpoints? How often do they expect to be doing this?

michaelchai-sentry commented 2 months ago

@ceorourke this particular customer has quite a few teams so they're worried about getting rate limited if they make separate GET calls for each team every time they update their cache

afle1 commented 1 month ago

Hi 👋🏻 I'd like to add my +1 describing my use case. We have hundreds of projects in our organization, each with their own team. We want to automatically manage permissions on those projects by mapping them to our internal team hierarchy and periodically syncing said mapping with Sentry team members using the API. Since we have hundreds of teams, we'd need to iterate over all of those to retrieve their current members and then update them according to the internal team mapping.

We run the risk of being rate-limited, and if we do, we would have to rate-limit the calls on our end and make the syncing task very slow, which would not provide the greatest UX (e.g., someone who should be on a Sentry team according to our team hierarchy might have to wait a long time until the syncing task updates their team).

This new endpoint would allow us to perform the actions I described for hundreds of teams with a handful of calls to the Sentry API, which would, in turn, allow us to run the syncing task much faster, and without worrying about being rate-limited.

sentaur-athena commented 1 month ago

Thanks for adding more context. I will add this to the backlog for the API improvements.