Get your free beta license ↗
API operation · users group
POST

/users/{name}/home-repair

First published 3 Oct 20260.1.0Unchanged since publication

Repair ownership and permissions in a customer's home

Who may call it
AdministratorResellerCustomer
Token scope, any of
usersall
Answers200 OK

Administrators can repair homes for customers and resellers. Resellers can repair their own customers' homes. The repair sets the home container (/home/USER) to 0755 with root:root ownership and the home directory (/home/USER/files) to 0750 with the account as owner and the web server's group. It sets web/, each site directory and each document root to 0755. It sets tmp/, mail/, non-hidden directories directly under mail/ and .ssh/ to 0700, and .ssh/authorized_keys to 0600.

Below the home directory, the repair restores the account as owner and its primary group as group. The recursive walk changes ownership on symbolic links themselves and skips their targets, device nodes and sockets. When checking standard paths and document roots, UrbeStack follows up to 32 root-owned symbolic links in parent path components and reports links that stand in place of an expected file or directory.

Set modes to true to apply 0755 to directories and 0644 to files under web/ and document roots within the home, clearing setuid and setgid bits. The optional content mode repair excludes mail/ and the home directory's dotfiles.

The response contains home, with the old and new values for the first 1000 changes and the total number of entries affected. Use dry_run to preview the report. The repair has a timeout of 1800 seconds and skips accounts with a missing Linux account or home container. Use urbestack-rebuild to create missing paths.

As a command

Run as root on the server

Parameters

namepath ·UsernameRequired

Request body

JSON· 2 fields
dry_runboolean
Whether to preview the changes without applying them. Defaults to false.
modesboolean
Whether to also reset content permissions under web/ and document roots within the home. Defaults to false.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/users/alice/home-repair" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "dry_run": true,
    "modes": true
  }'
Response · 200 OK
{
  "home": {
    "changed": 1,
    "changes": [
      {
        "from": "text",
        "path": "public_html/index.php",
        "to": "text",
        "what": "mode"
      }
    ],
    "modes": 1,
    "name": "alice",
    "skipped": [
      {
        "path": "public_html/index.php",
        "why": "text"
      }
    ]
  }
}

Errors

7 errors, each a status and a sentence
400--name and --all exclude each other
400<name> is an administrator, not a customer: administrators have no home
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400One of --name or --all is required
400Username '<value>' is reserved
401Authentication required
404User '<name>' not found
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.1.0 on 3 Oct 2026.
urbestack.com/docs/api/post-users-name-home-repair/