RESTHeart Cloud is coming soon! Stay tuned!

Edit Page

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:

  1. Create a root user with your chosen credentials

  2. Set up full permissions allowing all operations on your instance

  3. 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

Values are saved in your browser

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:

  1. Create additional users with specific roles and permissions

  2. Set up collections for your application data

  3. Configure roles and permissions for different user types