RESTHeart Cloud is coming soon! Stay tuned!
RESTHeart Cloud - Root User Setup
Create your root user account with full administrative privileges. This setup gives you complete control over your RESTHeart Cloud instance.
What This Setup Does
This wizard will:
-
Create a root user with your chosen credentials
-
Set up full permissions allowing all operations on your instance
-
Test the authentication to ensure everything works correctly
Warning
|
Security Notice: The root user has complete access to your instance. Choose strong credentials and keep them secure. |
Wizard Setup
🔧 Configuration
⚠️ Setup Required
Before using these examples, get an Admin JWT token from https://cloud.restheart.com
Step 1: Create Root User
cURL
curl -X PUT [INSTANCE-URL]/users/root \
-H "Authorization: Bearer [JWT]"
-d '{"password": "[YOUR-PASSWORD]"}'
HTTPie
http PUT [INSTANCE-URL]/users/root \
Authorization:"Bearer [JWT]" password=[YOUR-PASSWORD]
JavaScript
const response = await fetch('[INSTANCE-URL]/users/root', {
method: 'PUT',
body: JSON.stringify({ "password": "[YOUR-PASSWORD]" }),
headers: {
'Authorization': 'Bearer [JWT]'
}
});
Step 2: Set Up Root Permissions
The admin permission (/_acl/rootCanDoEverything
) grants full access to all endpoints and operations. This permission uses:
-
Predicate:
path-prefix('/')
- Matches all paths -
Roles:
["root"]
- Applied to users with the root role -
Priority:
0
- High priority permission -
MongoDB Options: Enables all management operations
curl -X PUT [INSTANCE-URL]/acl/rootCanDoEverything \
-H "Authorization: Bearer [JWT]"
-d '{"predicate": "path-prefix('/')", "roles": ["root"], "priority": 0, "mongoOptions": {"allowManagementRequests": true}}'
HTTPie
http PUT [INSTANCE-URL]/acl/rootCanDoEverything \
Authorization:"Bearer [JWT]" predicate="path-prefix('/')" roles:='["root"]' priority:=0 mongo:='{"allowManagementRequests": true}'
JavaScript
const response = await fetch('[INSTANCE-URL]/acl/rootCanDoEverything', {
method: 'PUT',
body: JSON.stringify({"predicate": "path-prefix('/')", "roles": ["root"], "priority": 0, "mongo": {"allowManagementRequests": true}}),
headers: {
'Authorization': 'Bearer [JWT]'
}
});
Next Steps
Once your root user is set up, you can:
-
Create additional users with specific roles and permissions
-
Set up collections for your application data
-
Configure roles and permissions for different user types