Skip to main content
PATCH
Set Doc Role

Authorizations

X-API-Key
string
header
required

Path Parameters

session_id
integer
required
doc_id
integer
required

Cookies

wos-session
string
datalab_active_team
string

Body

application/json

PATCH /sessions/{id}/docs/{doc_id} — flip one reference doc's role (D1 doc roles). Text docs are role-LOCKED to context (400).

role
enum<string>
required
Available options:
process,
context

Response

Successful Response

id
integer
required
name
string
required
page_count
integer | null

Surface count of doc_kind surfaces: pages for page docs, SHEETS for sheet docs (spreadsheets have no pages — sheet path, plan A7). Always None for text docs.

doc_kind
enum<string> | null

What page_count counts (the locator surface vocabulary); 'text' = context-only .md/.txt doc. None = legacy row, page semantics.

Available options:
page,
sheet,
text
role
enum<string>
default:process

What the doc is FOR (D1): 'process' docs are exercised by commits/launches; 'context' docs feed the agent's context and never launch runs.

Available options:
process,
context
role_locked
boolean
default:false

True for text docs — they can only be context (no converter on the agent path covers text).

created
string<date-time> | null