Set different domain for public domain and fucntions API

I have a site on cloudflare pages using pages functions.
the functions also acts like an rest Api validating through API or Sessions.

My question now is how I can make the domain on the public for cloudflare pages

app.mydomain.com
and then the functions acting as API can be api.mydomain.com

currently all are on mydomain.com

so mydomain.com is for the main site
and mydomain.com/apiendpoint is for the Api

Trying to separate it, if possible 🙏
Was this page helpful?