Error while using document upload to alpaca broker api


We are getting the following error when trying to call upload_doc_to_account method of Alpaca Brokers AccountsApi.

I’m sure I’have base64 encoded the file. BTW, when I set a random string to content I get the same error.

Thanks for your help.

Reason: Bad Request
HTTP response headers: HTTPHeaderDict({‘Date’: ‘Fri, 28 Jun 2024 07:26:56 GMT’, ‘Content-Type’: ‘application/json; charset=UTF-8’, ‘Content-Length’: ‘151’, ‘Connection’: ‘keep-alive’, ‘Access-Control-Allow-Origin’: ‘*’, ‘Vary’: ‘Origin’, ‘X-Ratelimit-Limit’: ‘1000’, ‘X-Ratelimit-Remaining’: ‘999’, ‘X-Ratelimit-Reset’: ‘1719559616’, ‘X-Request-Id’: ‘049fdc48b273fa06183f78b7582fe04c’, ‘Strict-Transport-Security’: ‘max-age=31536000; includeSubDomains’, ‘Access-Control-Allow-Credentials’: ‘true’, ‘Access-Control-Allow-Methods’: ‘GET,OPTIONS,PATCH,DELETE,POST,PUT’, ‘Access-Control-Allow-Headers’: ‘Apca-Api-Key-Id,Apca-Api-Secret-Key,Authorization,Content-Type’, ‘Access-Control-Max-Age’: ‘1728000’})
HTTP response body: {“code”:40010000,“message”:“request body format is invalid: json: cannot unmarshal object into Go value of type entities.BrokerAccountDocumentUploads”}