Cannot write in private fields error when saving to Master Data

Good afternoon!
I’m testing data recording in Masterdata, using a table that already exists and works in the production store. My goal is to develop a middleware that records data retrieved from Sintegra. Through Insomnia, I’m able to make the POST request and save the data, but through the middleware, I can’t. It returns the error message above.

import { ExternalClient, IOContext, InstanceOptions } from "@vtex/api";

export default class vtexCustomClient extends ExternalClient {
  constructor(context: IOContext, options?: InstanceOptions) {
    super('https://fujiokadistribuidor.vtexcommercestable.com.br', context, {
      ...options,
      headers: {
        "X-VTEX-API-AppKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "X-VTEX-API-AppToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "Content-Type": "application/json",
        "Accept": "application/vnd.vtex.ds.v10+json"
      }
    });
  }

  public async createNewCustomer() {
    return await this.http.post(`/api/dataentities/CL/documents`);
  }
}



export async function createNewUser(ctx: Context, next: () => Promise<void>) {
  ctx.set("Cache-Control", "no-cache");

  await ctx.clients.masterdata.createDocument({
    dataEntity: "CL",
    fields: {
      "businessPhone": "xxxxxxxxxxx",
      "corporateDocument": "",
      "email": "antonio.junior@gmail.com",
      "fieldOfStore": "",
      "email_boleto": "antonio.junior@gmail.com",
      "licitacao": false,
      "lastName": "Jr",
      "isCorporate": true,
      "firstName": "Antonio",
      "emailPrimary": "antonio.junior@gmail.com",
      "email_nf": "antonio.junior@gmail.com",
      "phone": "",
      "homePhone": "",
      "purchaseIntention": "",
      "isNewsletterOptIn": false
    }
  })

  ctx.body = {
    mensagem: "Deu tudo certo! :)"
  }

  ctx.status = 200;

  console.log(ctx.response);

  await next();
}

Hey!

Just guessing here…

Try adding these 2 headers.

‘X-VTEX-Use-Https’: ‘true’,
‘Proxy-Authorization’: context.authToken,

Good afternoon!
@Saito I managed to solve it by applying some policies in the manifest.json

{
      "name": "WorkflowAction"
    },
    {
      "name": "CancelAction"
    },
    {
      "name": "POWER_USER_DS"
    },
    {
      "name": "ADMIN_DS"
    },
    {
      "name": "vbase-read-write"
    },

Thank you so much for responding!