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

/profile/files

First published 3 Oct 20260.1.0Unchanged since publication

Register a hand-edited file for profile exports

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

Set path to the absolute path of an existing regular file of up to 1 MB, such as /etc/php.d/99-custom.ini. For a symbolic link, register its target. Each path can be registered once. The optional note accepts up to 200 printable ASCII characters.

The API returns 400 for a missing or malformed path or an invalid note. Path components may contain word characters and the characters .+@%:-. The components . and .. are forbidden. The API also returns 400 for paths under UrbeStack's own directories or under /proc, /sys, /dev, or /run, for files UrbeStack manages such as its adapter files and the hosts file, and for paths whose names suggest they contain secrets. These restrictions apply to both the supplied path and its resolved path.

The API returns 201 with the new registration and its current disk metadata in file. Profile exports include the file's contents, mode, owner, and group. To restore the file, run urbestack-import --trust-files at the shell. The import result lists the restored file.

As a command

Run as root on the server

Request body

JSON ·ProfileFileCreate· 2 fields
pathstring, up to 1024 charactersRequired
notestring, up to 200 characters

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X POST "$API/profile/files" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "note": "added by hand",
    "path": "public_html/index.php"
  }'
Response · 201 Created
{
  "file": {
    "changed_at": "text",
    "created_at": "2026-09-09T10:15:00Z",
    "group": "text",
    "id": 1,
    "mode": "text",
    "note": "added by hand",
    "owner": "text",
    "package": {
      "name": "alice",
      "version": "0.0.1"
    },
    "path": "public_html/index.php",
    "present": true,
    "size": 1
  }
}

Errors

9 errors, each a status and a sentence
400<path> is a file the panel writes itself; what it holds travels with the profile already
400<path> is inside <own>, which the panel manages itself
400<path> looks like a secret and may not travel in a profile
400A path is required
400Invalid note
400The path may not contain . or .. components
400The path must be absolute and plain
401Authentication required
409<path> is already registered
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-profile-files/