Disable Optimization on aggregation / correlation - Does this Python logic look correct?

Your request is configured with Content-Type application/json, but your body is not JSON.
Try using this for your payload instead:

payload = '{"disableOptimization":true}'

You can confirm that it worked by checking that the aggregation entry in the UI contains the following after the aggregation is completed:
image