Getting 500 code when trying to update account

Getting 500 code when trying to update account

Hello, 

I am having trouble to udpate any parameter using the API.

I am pretty sure that I am sending a correct Token and that it has the needed scope (Desk.contacts.UPDATE).

First I tried sending the whole information, but got the error, and I ma still getting the same error by just sending just one parameter:

  1. async function updateCompany(accountId, params){
  2.     let headers = httpCalls.buildHeaders();
  3.     let url = `https://desk.zoho.com/api/v1/accounts/${accountId}`;
  4.     let payload = JSON.stringify(params);
  5.     let opts = {
  6.       "method":"PATCH",
  7.       "headers":headers,
  8.       "payload":payload
  9.     }
  10.     let answer = await UrlFetchApp.fetch(url,opts);
  11.     return {
  12.       status: answer.getResponseCode(),
  13.       msg: answer.getContentText()
  14.     }
  15. }

  16. async function testUpdate(){
  17.   let verifiedId = 65046501652005 /*This number is just to show how it is called, the actual number it is of course a valid accountId*/
  18.   let info = {
  19.     accountName: "AccountName"
  20.   }
  21.   console.log(JSON.stringify(info));
  22.   let answer = await updateCompany(verifiedId, info);
  23.   
  24.   console.log(answer);
  25. }
I am pretty sure that headers and accountId are valid because I can get the company info with those same parameters, but no luck to update.

Any thoughts on this? Thank you in advance