Which API Key to use when creating new Accounts

Hi,

Once I’ve enabled local authorization on my rancher and created an admin account can I create other user accounts with an environment API key? Seems like I’m getting a 404 error see below

curl -u “[environmentAPI-Key]:[envrionmentAPI-SecretValue]”
-X POST
-H ‘Accept: application/json’
-H ‘Content-Type: application/json’
-d ‘{“accessMode”:“unrestricted”,“name”:“admin”,“id”:null,“type”:“localAuthConfig”,“enabled”:true,“password”:“password”,“username”:“test”}’
http://192.168.99.123:8080/v1/localauthconfig

{“id”:“e51d028f-87b2-463e-95c0-ab1716e156a7”,“type”:“error”,“links”:{},“actions”:{},“status”:404,“code”:“Not Found”,“message”:“Not Found”,“detail”:null}

Any suggestions?

Thanks!

No, an environment key can only manipulate things within that environment. You need an Account key for that. The request you show above though is turning on local auth though, which you only do once.

Thanks Vincent. Using the account key worked.