import requests
url = "https://{FUSION HOST}/api/tasks"
payload = {
    "type": "rest-call",
    "id": "test-task-created",
    "callParams": {
        "uri": "solr://system_jobs_history/update",
        "method": "post",
        "queryParams": { "wt": "json" },
        "headers": {},
        "entity": "<root><delete><query>timestamp_dt:[* TO NOW-30DAYS] AND type_s:history</query></delete><commit /></root>"
    }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())