Should I split my API by user type?

by Msencenb   Last Updated July 28, 2017 16:05 PM

Let's say I have an app to manage sporting teams. Potential users have a role of 'coach', 'player', and 'fan'. In many cases they will have to make similar api calls to retrieve info like this:

/api/v1/players    (retrieve all players on their current team)
/api/v1/events     (retrieve all events for their current team)

In other cases roles might have certain features only available to them, like this:

/api/v1/opposing_players/:opposing_player_id  (retrieve scouting info about an opposing player, not available to fans)

My question boils down to... Should I explicitly break out the apis with a prefix for each role? Or should the API only have one base url?

/api/v1/coaches/events
/api/v1/fans/events
/api/v1/players/events

or

/api/v1/events


Related Questions


How does global load balancing work?

Updated September 03, 2017 11:05 AM