There doesn't seem to be a clear documentation for what permissions are actually required for this API, or an obvious way to allow it in the domain dashboard.
I have a script that works when a "Super Administrator" uses it - but not when a "Administrator" tries.
The Email Settings API can only be used by user with full administrative rights over the domain, i.e. super administrators.