you could use the tokens as filters to not create/edit certain datas
if api is triggered with token A - then access everything, if it is triggered with token B then only access contacts and not companies (using conditional filters in the workflow)
this achieves what you want using the existing bubble architecture.
I suggest storing the token somewhere so the user (admin user) can change it or set it so that they can create their own tokens to share with 3rd parties
ie you could create a data “token” - set strict privacy rules on it for security
then allow users to create tokens
system generates a random 15 character string
allow users to add “permissions” to the token via an option set
then in the backend workflow you can add conditions where you lookup the token to see the permissions and then run or not run certain events
my original idea was just tokens but you can extend it with option sets and add more functionality for users to self manage their tokens.
allowing users to reset tokens also creates better security as when they remove a token then the workflow conditions won’t run anything - giving them the ability to control their own access
I don’t see the need to have users on api workflows as you can do what you want to do using existing bubble logic quite easily.
- I read and understood your post and you can achieve what you want using the logic I shared. I do not think adding oauth2 style access constraints to the backend workflows is needed
if you really wanted it you could already achieve it anyway
add a list of permissions to the users
generate a token per user (allow them to refresh it or even disable it)
do the same method above but this time lookup the users, get their access and then use it to control the apis access