New item in collection, fields is required error

Hi, I’m trying to update a collection from a script make in a google sheet (I don’t want to use Zapier) but I receive the “fields is required” error.

This is my code

var teamData = {
    "fields": {
      "name": "test",
      "slug": "test",
      "category": "WOMEN",
      "nationality-iso-code": "Italy",
      "payment-status": "Confirmed",
      "_archived": "false",
      "_draft": "false"
    }
  }

  var options = {
    'method': 'POST',
    'muteHttpExceptions': true,
    'headers': {
      'accept': 'application/json',
      'content-type': 'application/json',
      'authorization':'Bearer ' + API_TOKEN
    },
    'body' : JSON.stringify(teamData)
  };


  var response = UrlFetchApp.fetch(URL, options);

The same json via postman works, and I have the same problem if I try to update an item, via postman works, via google script not.
How can I solve this problem?

Where is this script executing? If it’s executing in your browser during your use of e.g. Google Sheets, it will fail due to browser-to-API security restrictions.

Using an automation tool would be a much better solution. Check out Make.com, it has a free plan and good Webflow integration.