DorkOS
ApiRoomsIdFiles

List one directory of a room's own files

GET
/api/rooms/{id}/files

Preview. This operation may change in any release.

Serves the room's git repo, as of the commit main points at — never the checkout on disk, so a half-written edit or a merge in flight is not something a reader can see, and .git is not a path anybody can name because it is not in the tree. commit says exactly which snapshot this listing is. path is a directory relative to the repo root and defaults to it; .., an absolute path, a backslash, a control character, a doubled slash and leading or trailing whitespace are all refused (400) before git is asked anything — the whitespace rule is a refusal rather than a repair, because a filename may legitimately end in a space and trimming the request would answer with a different file. The server never rewrites a path, so every path in a listing can be handed straight to the content route. Entries come back directories first, then files, each group in code-unit order — byte order rather than the machine's locale, so one room lists identically everywhere. Membership gates it exactly as reading the room's history does — a caller who is not on the roster gets the same 404 an unknown room gets, so a room id is never a capability, and an agent that IS a member may read, because a room's files are what its members are working on together. A member of a room that has no files of its own gets 409 room_has_no_repo, and that question is asked strictly AFTER membership so that nobody can learn which rooms are project rooms by probing ids. Each entry carries the last commit that touched it — author, time and subject — from one bounded walk of the room's history, so a directory of five hundred files costs the same handful of git commands as a directory of five; an entry nobody touched inside that window answers lastCommit: null, which means "not known here" rather than "never changed". A symlink is listed as a symlink and is never followed. Everything here — filenames, commit subjects, author names — is written by the room's members: render it as untrusted text.

Authorization

__Secure-better-auth.session_token<token>

The sign-in cookie a browser gets when a person signs in to DorkOS. An installed DorkOS on port 4242 names it __Secure-better-auth.session_token. On any other port the prefix carries a suffix for its data folder (better-auth-<hash>), and a development server leaves off __Secure-. From this computer, an operation that takes the sign-in cookie or a personal API key needs neither while "Ask for a password on this computer too" is off, which is how DorkOS installs (dorkos auth enable turns it on). A request from another device needs one, with one exception for now: a browser reaching a Docker container through its published port, while the container runs with DORKOS_ALLOW_INSECURE_BIND and has no owner account yet.

In: cookie

Path Parameters

id*string
Length1 <= length

Query Parameters

path?string

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/api/rooms/string/files"
{  "path": "string",  "commit": "string",  "entries": [    {      "name": "string",      "path": "string",      "kind": "file",      "size": 0,      "lastCommit": {        "sha": "string",        "author": "string",        "at": "string",        "subject": "string"      }    }  ]}