To add an admin to Kong Manager via the Admin API, you’ll need to follow these steps:
# Disable RBAC
curl -X PUT http://localhost:8001/rbac/enable --data '{"enabled": false}'
# Create a new admin user
curl -X POST http://localhost:8001/admins \
--header "Content-Type: application/json" \
--data '{
"username": "newadmin",
"email": "newadmin@example.com",
"password": "yourpassword"
}'
# Assign roles to the new admin
curl -X POST http://localhost:8001/admins/newadmin/roles \
--header "Content-Type: application/json" \
--data '{
"roles": ["super-admin"]
}'
# Enable RBAC
curl -X PUT http://localhost:8001/rbac/enable --data '{"enabled": true}'