Depends on what does it need to do, but you most probably will need a regular
RPC instead of trivial CRUD (REST) or mostly data query (GraphQL). Though RPC
is not fancy nor sexy, so most web developers this days won't even look at
that.
The question is intentionally generic as I am trying to find out what most folks would do if they were starting with something fresh. Your comment reminded me I needed to narrow the focus a bit. I edited the question to add an assumption that this is a Web API.