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

/files/{user}/content

First published 3 Oct 20260.1.0Unchanged since publication

Read a file's contents as base64

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

Supply the file path in the path query parameter. The operation uses the customer's permissions and returns the file entry with its base64-encoded contents. A symbolic link that resolves outside the home directory yields no file contents.

The text field indicates whether the built-in editor can display the file. The editor accepts UTF-8 files up to one megabyte without NUL bytes. If the file exceeds files.upload_limit_mb, the API returns 413 and directs you to SFTP.

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.
pathquery ·HomePathRequired

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X GET "$API/files/alice/content?path=public_html/index.php" \
  -H "Authorization: Bearer $TOKEN"
Response · 200 OK
{
  "content": "text",
  "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/get-files-user-content/