403 Error with POST to JSON File

I’m trying to update a json file and I have a function to request a POST to it but I keep getting 403 errors. The URL for the resource in the console opens the JSON file in the browser so that part seems OK but I don’t seem to be able to make updates to it. I can load the asset with this.app.assets.find(“wrtcInfo.json”), load it with this.app.assets.load(sessionsAsset) and get the URL with sessionsAsset.getFileUrl()

The parameter holds the asset URL for the JSON file and this is the error I get: Failed to load resource: the server responded with a status of 403 ().

The value of the URL parameter I’m passing is: https://launch.playcanvas.com/api/assets/files/scripts/wrtcInfo.json?id=183592002&branchId=2d66098d-0e65-4e08-a960-8f760ebbf9b8&t=a74757ad04e43d790b807ec10cbd6d97

I get this error when I publish the project:
https://s3-eu-west-1.amazonaws.com/apps.playcanvas.com/a6e39ae4/files/assets/183592002/1/wrtcInfo.json?t=25bcf6655d266536cf0a080bef6a1e23’ from origin ‘https://playcanv.as’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

I’ve tried pc.http.post() and I get the same issue with cors between Playcanv.as and aws.

Here’s the code:

async function setSessionInfo(wrtcSessionAssetURL){

  let wrtcHeader = new Headers({"Authorization": `Bearer token-key-goes-here`});
  let wrtcBlob = new Blob([JSON.stringify({"session_ID" : "999999999"})], {type: 'application/json'});
  let wrtcData = new FormData();
  wrtcData.append("branchId", this.branchID);
  wrtcData.append("file", wrtcBlob, {filename: "wrtcInfo.json", contentType: "application/json"});

  var wrtcSessionInfo = new Request(wrtcSessionAssetURL);

  fetch(wrtcSessionInfo, {headers: wrtcHeader, method: "POST", body:wrtcData})
    .then((response) => {
      if (response.status === 200) {
      return response.json();
      } else {
        throw new Error("Something went wrong on API server!");
    .then((response) => {
    .catch((error) => {