Compute zonal statistics from Sentinel-2 VI's

I’m sorry I haven’t seen that sourceBandName, expression and validPixelExpression are note publicly accessible.
This makes this operator unusable via the API. It can only be used via gpt from the command line. This should be fixed with the next release.

But maybe it is anyway easier for you to use the statistical functionalities which are available in python.
There for you would need the data.
You can get the data by using the readPixels method.
Here is an example:

Instead of reading the data line wise you can also get the whole image.