I am also running some other applications on different paths on the same subdomain. But, as I tried to set up Portainer, which also uses the path /api for its UI, I knew that this will not work so easily.
My question is, if it's even possible to use both on one subdomain, or is the only solution moving one of them to its own.
Use Traefik as a load balancer or a reverse proxy for microservices-based architecture. You also looked at the API and the dashboard available in Traefik .
Usually you would set just one PathPrefix for it. But as I mention you will likely require configuration on the portainer side. Look in the portainer documentation for terms like reverse proxy, root url, base url, base path, root path