Set Downtime via API not possible

i try to configure a downtime via API. example code below. does not show in webinterface. doesnt matter if duration flag is set or not.
Checkmk Enterprise Edition 2.1.0p24

import requests
import json

url = "https://monitoring.domain.local/regionen/check_mk/api/1.0/domain-types/downtime/collections/host"

payload = json.dumps({
  "start_time": "2024-04-21T17:32:28Z",
  "end_time": "2024-04-21T18:32:28Z",
  "comment": "TEST",
  "downtime_type": "host",
  "host_name": "hostnameA"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer api_user pass'
}

response = requests.request("POST", url, headers=headers, data=payload, verify=False)

print(response.status_code)
print(response.text)

http code: 204 (documentation says this is successfull)

this is working for me:

def create_downtime(hostname,comment,start_time,end_time,API_URL,session):
    resp = session.post(
    f"{API_URL}/domain-types/downtime/collections/host",
    headers={
        "Content-Type": 'application/json',
    },
    json={
        'start_time': start_time,
        'end_time': end_time,
        'recur': 'fixed',
        'duration': 0,
        'comment': comment,
        'downtime_type': 'host',
        'host_name': hostname
    },
    )
    print(resp.status_code)
    logging.info(f"Created downtime for host '{hostname}'. Response: {resp.status_code}")

ok my problem was that it was not shown in “historical downtimes” in monitor menu because i scheduled future downtimes only.

so problem solved. thanks