Is MasterKey is required when using Cloud function via rest API

This link shows how to use rest api to use cloud function.
https://docs.moralis.io/moralis-dapp/cloud-code/cloud-functions#call-via-rest-api

and I want to use rest api to call the cloud function, but the question is that the rest api need masterKey, so masterKey is visiable in my request url, so how can I hide my masterKey in request url or not using maskterKey to call the cloud function using rest api

Many thanks.

Did you try to call it without master key and it didn’t work?

That url is not public.

I tried not using masterkey in my request , and I get the error like “Validation failed. Master key is required to complete this request.” so I set the masterkey in http headers of my request and it worked. This request url contains my masterkey, it seems not safe if someone get this request url, so can I using cloud function via rest api without masterkey.

the cloud function like following code:

Moralis.Cloud.run(
    'watchEthAddress',
    {
      address,
      syncHistorical: false,
    },
    { useMasterKey: true }
  );

where from are you making that http request to the cloud function?

now I am testing, so I just use postman to request the cloud function

I would expect it to work directly without the need to provide master key, as when it is called from the SDK, the master key is not provided, and I expect it to work