Overview

The Workspace Files API exposes filesystem operations for the packaged Allternit Platform app. It resolves paths against the user’s home directory (supporting the ~ shorthand) and sandboxes requests through a caller identity derived from the auth header. This API is the HTTP fallback used when the desktop preload does not expose direct filesystem access.

Base URL

For local development:

Authentication

Requests are authorized through the platform auth middleware. The route also accepts a desktop-bootstrap header as a lenient fallback so Electron desktop sessions can operate without requiring the middleware to populate an AuthUser extension.

Endpoints

Path resolution

All paths are resolved relative to the caller’s home directory:
  • ~/Projects/app resolves to <home>/Projects/app.
  • /absolute/path is used as-is.
  • relative/path resolves to <home>/relative/path.

List files

Query parameters

Response

Recursive listings are capped at a depth of 8 and a maximum of 1,000 entries. If the directory does not exist, the endpoint returns an empty entries array rather than an error.

Read a text file

Response

Read a raw file

The response is returned with the detected Content-Type header.

Check existence

JSON variant (always returns 200):

Response

HEAD variant:
Returns 200 OK if the path exists, otherwise 404 Not Found.

Create a directory

Response

Delete a file or directory

Response

Write a file

The path may be supplied either as a query parameter or in the JSON body. Parent directories are created automatically.

Response

Supported MIME types

The /files/raw endpoint detects the following common types from the file extension:

Error codes

  • Files — upload and reference files for LLM requests
  • Agent Workspaces — workspace directories and paths
  • ACI — computer-interface filesystem actions