API key
From where do we obtain API key ?
The API Key is in /data/ directory, into .api-key archive file (dev-admin-key) wit default
But where is this /data/ is located, is it generated after deployment?
If you deployed OpenWA using docker, the data directory is located at /app/data/, being "/app/data/.api-key" the full path of the file containing the API key.
sudo docker exec -it <your_container_name> "/bin/cat" "/app/data/.api-key"; echo
Use this command to read the file directly from your host terminal, replace the container name with OpenWA API container name (openwa-api by default).
I am not using docker, i fetched repo and npm build
In that case, after you run npm run dev, the data directory should be created in the directory you fetched the repo, and you should be able to find the file containing the API key.
You can also look at the terminal output at start when running 'npm run dev'. the api-key is printed there.
This is the API_KEY by default, test = dev-admin-key
Hi, I tried using the default API key 'dev-admin-key', but for each request I get: 'Error: Unauthorized'
How do you have the variable API_MASTER_KEY or API_KEY defined in your .env file? Are you using Docker?
The API key is stored in data/.api-key (default 'dev-admin-key' in dev) and is also printed in the startup logs. Closing as answered — see the thread above.