Skip to content
Read a mount file

Read a mount file

Read one file of a mount, with its content.

GET/api/v1/mounts/:mountId/files/content

Request#

TypeScript
const response = await fetch("https://api.smallworld.sh/api/v1/mounts/0199a1c4-5b6e-7a10-9c2d-3e4f5a6b7c8d/files/content?path=/faq.md", {
  method: "GET",
  headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();

Use your server-side apiKey. Replace the example IDs.

Path parameters#

mountIdUUIDrequired

The mount's ID, returned as id when the mount was created.

Query parameters#

pathstringrequired

A path inside the mount, such as /guides/refunds.md for /workspace/docs/guides/refunds.md in a mount at /workspace/docs. guides/refunds.md names the same file. No empty, . or .. segments and no trailing slash. URL-encode it.

Responses#

Returns the entry as GET /mounts/:mountId/files lists it, with type file, plus content and encoding. Content that is valid UTF-8 without null bytes is returned as text with encoding utf8; anything else as base64.

200 response
{
  "path": "/faq.md",
  "type": "file",
  "size": 37,
  "hash": "e08222b5163270229c47f385e4d0e8a9de482f71d0364a66de787c09b3b63b0a",
  "modifiedAt": "2026-10-10T12:00:01.000Z",
  "content": "# FAQ\n\nRefunds take 3 business days.\n",
  "encoding": "utf8"
}
More about this endpoint

The encoding depends on the stored bytes, not on how they were written. Decode content with its encoding.

Folders have no content: a folder's path returns 404.