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

/files/{user}/directories

First published 3 Oct 20260.1.0Unchanged since publication

Create a directory in a customer's home

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesall
Answers201 Created

Supply path starting with /, which represents the customer's home directory. The operation uses the customer's permissions to create one directory with mode 0755. The parent directory must already exist. If an entry already exists at path, the API returns 409.

As a command

Run as root on the server

Parameters

userpath ·UsernameRequired
Username of the customer who owns the home directory. Administrators can specify any customer, and customers can specify only themselves.

Request body

JSON ·FilePath· 1 field
pathHomePathRequired
A path within the customer's home directory, with / representing the home directory itself. The path cannot contain .. components or control characters.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/files/alice/directories" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "path": "public_html/index.php"
  }'
Response · 201 Created
{
  "file": {
    "inside": true,
    "mode": "text",
    "modified": "text",
    "name": "alice",
    "owner": "text",
    "path": "public_html/index.php",
    "size": 1,
    "target": "https://example.com/new",
    "target_type": "dir",
    "text": true,
    "type": "dir"
  }
}

Errors

12 errors, each a status and a sentence
400--path is required
400--user is required
400<name> is an administrator: administrators have no home
400<what> climbs out of the home with ..
400<what> has a name over 255 characters
400<what> holds a control character
400<what> is required
400<what> is too long
400<what> must start with /, which is the home
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Username '<value>' is reserved
401Authentication required
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-files-user-directories/