Zapier Code Step Returns 404 When Updating Float Time-Off Entry

Facing 404 error using Zapier code to update a Float time-off record. Local Python update succeeds, but Zapier fails. New code attempt below:

import http.client
import json

record = '456'
st_date = '2024-02-01'
end_date = '2024-02-05'
remarks = 'Modified details'
member = '789'
hours_used = 5

payload = json.dumps({
    'record': record,
    'start': st_date,
    'end': end_date,
    'remarks': remarks,
    'member': member,
    'hours': hours_used
})

conn = http.client.HTTPSConnection('api.newfloat.com')
headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Token new_api_token'
}

conn.request('PATCH', f'/records/{record}', body=payload, headers=headers)
response = conn.getresponse()
result = response.read()
print(result.decode('utf-8'))

I was facing a similar issue and after digging around I noticed that the endpoint path was slightly different when used within Zapier. It turns out that even though the local Python environment worked fine, Zapier was more strict on the API routing. I ended up double-checking the URL structure against the API docs and discovered that the records endpoint was versioned. Also, ensuring the authentication was correctly applied in all environments was essential. Once I adjusted the endpoint and reviewed the header details, the request worked across both platforms.