Can't sign crypto agreement

Hi there, i am new to alpaca, i am trying to sign trade agreement but getting the following response:
:white_check_mark: Status: 404
:page_facing_up: Response: Not Found

using the following code.

import requests

with open(“D:/trade/key.txt”, “r”) as f:
API_KEY, API_SECRET = f.read().splitlines()

account_id = “xxxxxxxxx”

Static payload with crypto agreement details

payload = {
“agreements”: [
{
“agreement”: “crypto_agreement”,
“signed_at”: “2025-05-27T19:38:44Z”,
“ip_address”: “x.x.x.x”
}
]
}

Correct endpoint for updating existing user with crypto agreement

url = f"https://api.alpaca.markets/v1/accounts/{account_id}"

Authorization headers

headers = {
“APCA-API-KEY-ID”: API_KEY,
“APCA-API-SECRET-KEY”: API_SECRET,
“Content-Type”: “application/json”
}

Submit the request to Alpaca

try:
response = requests.patch(url, headers=headers, json=payload)
print(“:white_check_mark: Status:”, response.status_code)
print(“:page_facing_up: Response:”, response.text)
except Exception as e:
print(“:cross_mark: Error:”, str(e))

Please help