Create Admin Account

Create Admin Account

After installing the REST Module, you need to create an admin account to access the API.

Set up admin authentication for secure API access

Create Admin User

# Create admin account via REST API
curl -X POST http://localhost:8080/polocloud/api/v3/user/self -H "Content-Type: application/json" -d '{
  "username": "admin",
  "password": "your-secure-password",
  "roleId": -1
}'

Using Postman

  1. Create New Request

    • Method: POST
    • URL: http://localhost:8080/polocloud/api/v3/user/self
  2. Set Headers

    • Content-Type: application/json
  3. Set Body (raw JSON)

    {
      "username": "admin",
      "password": "your-secure-password",
      "roleId": -1
    }
  4. Send Request

    • Click "Send" to create the admin account

Admin Account

  • Use a strong password for security
  • roleId: -1 creates an admin user with full access
  • This endpoint can only be used when no users exist yet
  • The response includes an authentication token for immediate use
  • User data is stored in rest/users.json file