Generate API Token through REST in v4?

I’m working on a microservice that needs to create an API key in ChirpStack v4 and then store the key details in a separate system. The goal is to return an API token given a specific name.

I’m using the endpoint http://<chirpstack-server>/api/apiKeys with the necessary headers and body parameters.

Could someone confirm whether we can generate an API key through ChirpStack v4 by not using the UI?

You can not generate API keys through the API. You can create a key using the CLI however, please see chirpstack --help.