If I do an API call like this:
curl --location --request GET "http://127.0.0.1:8000/api/index.php/v1/users" --header "X-Joomla-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
I get the desired result.
Now I activate one system plugin of mine and I get an 500, because the system plugin is doing some things that are only needed if processing as client or admin request.
Is there a way of identifying the request as an API request, so decisions can be made? This should also work in future Joomla updates?