I have no advanced rights on enwikibooks. I used ApiSandbox to try and delete a page:
{
"servedby": "mw1193",
"error": {
"code": "permissiondenied",
"info": "Permission denied",
"*": "See https://en.wikibooks.org/w/api.php for API usage"
}
}Tried to protect a page:
{
"servedby": "mw1123",
"error": {
"code": "permissiondenied",
"info": "Permission denied",
"*": "See https://en.wikibooks.org/w/api.php for API usage"
}
}Globally block a user:
{
"servedby": "mw1223",
"error": {
"code": "permissiondenied",
"info": "Permission denied",
"*": "See https://en.wikibooks.org/w/api.php for API usage"
}
}And so on, you get the picture.
These errors don't say precisely what permission has been denied, so they're not especially useful. They should mention which right is required to perform the given action, or for bonus marks, which user groups have the required right (just like the UI does)
In general, the API has been pretty bad at providing machine-readable error messages. This would be a good place to start improving that, by at least listing the missing user right as a data value alongside code and info.