DorkOS
ApiSessionsIdTree

See a chat’s tree

GET
/api/sessions/{id}/tree

Preview. This operation may change in any release.

A chat’s place in the tree of chats that started each other: the chats above it, nearest first, and every chat below it, depth first, each with whether it ran, is still launching, or never started and why. depth limits how many levels down, 1 to 64; all of them when left out. A chat you may not read is left out; when a chat you may read hangs below it, it shows as a private joint with no id. States and ids only, never what was said. Page the chats below it with limit and the returned nextCursor; the chats above it repeat on every page, so count them once. chatId is the chat’s id or its dork:chat: reference.

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

The chat's id, or its dork:chat: reference.

Length1 <= length <= 96

Query Parameters

depth?integer

How many levels below the chat, 1 to 64; all when left out.

Range1 <= value <= 64
cursor?string

The nextCursor of the page before; leave it out for the first page.

Length1 <= length <= 4096
limit?integer

How many chats below it this page holds, 1 to 500.

Range1 <= value <= 500
Default500

Response Body

application/json

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/api/sessions/string/tree"
{  "chatId": "string",  "state": {    "kind": "chat"  },  "ancestors": [    {      "chatId": "string",      "depth": 1,      "via": "started",      "state": {        "kind": "chat"      }    }  ],  "descendants": [    {      "chatId": "string",      "parentId": "string",      "depth": 1,      "via": "started",      "state": {        "kind": "chat"      }    }  ],  "truncated": true,  "nextCursor": "string"}