Read a work, optionally with one draft and unit
Code Mode: praxis.studio.works.retrieve
HTTP: GET /studio/v1/works/{work}
Read a work and, in the same answer, whatever part of it the page needs: pass draft to get that draft with its todos, its unit outline and its properties, and unit to get one unit with its blocks and Markdown body. This is the call that opens an editing session, because it answers the goal, the brief, the current revisions and the unit to write in one round trip.
Signature
praxis.studio.works.retrieve(args:{path:{/** e.g. "wu-gang" */ work:string};query?:{/** e.g. "novel" */ draft?:string;/** e.g. "12" */ unit?:string;/** e.g. ["status","unit"] */ expand?:Array<"status"|"drafts"|"outline"|"unit">}}):Promise<({/** Work identifier; the slug beside it is what a person should say, and this id is what remains stable when the slug is renamed. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Resource kind marker, always studio.work for this shape, so a client can tell the payloads of a batch apart. e.g. "studio.work" */ object:string;/** Creation time in RFC 3339 UTC; it never moves, unlike update_time. e.g. "2026-11-04T09:12:33Z" */ create_time?:string;/** Time of the last work-level change in RFC 3339 UTC; content writes move content_revision instead and leave this alone. e.g. "2026-11-04T10:41:07Z" */ update_time?:string;/** Console address of this work, ready to hand to a person; it opens the editing page rather than the API. e.g. "https://console.deepraxis.com/studio/wu-gang" */ viewer_url:string;/** Organization-unique name of the work, usable in every call in place of the identifier; an old value still resolves after a rename. e.g. "wu-gang" */ slug:string;/** Working title of the work as a person sees it; it is a label for the work, not the title any rendition publishes. e.g. "乌江" */ title:string;goal:{/** Who the piece is written for, in the person's own words; every later judgement about tone and detail follows it. e.g. "关注民国史的普通读者" */ reader:string;/** What the reader should get or do after reading, such as following the serial or buying the product; promotion belongs here, not in the genre. e.g. "追读下一章并收藏" */ outcome:string;/** The single message the piece carries, one sentence; changing it turns every draft derived from the message stale. e.g. "一个人在乱世里守住的那点体面" */ message:string};/** Revision of the goal message alone; a draft derived from the message records the value it was built on and turns stale when this moves past it. e.g. 3 */ message_revision?:number;/** Reference libraries attached to this work, the work's own library first; their entries are what the context pack draws on while a unit is written. */ codexes:Array<string>;/** Style attached to the work, which drafts inherit unless one overrides it; null means the work carries no style. e.g. "sty_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ style:string;/** Identifier of the cover image, or null when the work has no cover yet; the file stays in the file service and can be replaced or cleared at any time. e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ cover:string;baseline:{/** Identifier of the work that was copied; keep it to say where this work came from, and note that it is not a parent, so nothing written here flows back to it. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ work:string;/** Title the source work carried when the copy was made, kept as it was so a later rename of the source does not rewrite this history. e.g. "乌江" */ title:string;/** When the copy was made, in RFC 3339 UTC; it never moves afterwards. e.g. "2026-11-07T08:15:42Z" */ time:string};adapted_from?:{/** Identifier of the work or draft this one was derived from. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ source?:string;/** Source revision this derivation was built on; a larger current revision means the derivation is stale and must be rebased. e.g. 42 */ revision?:number};labels?:{[key:string]:string};/** Work-level settings revision; pass it as expected_revision when changing the title, goal, libraries or style. e.g. 7 */ revision:number;/** Content revision of the whole work, moved by any unit or draft write; derivations, projections and versions compare against it. e.g. 128 */ content_revision:number;/** Whether the work is archived; an archived work stays readable and writable but is left out of the default list. */ archived:boolean;/** Summaries of this work's drafts in the order they were created, one per genre the work has been written in. */ drafts:Array<{/** Draft identifier, stable when its in-work key is renamed. e.g. "drf_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** In-work key of the draft, such as novel or xiaohongshu, used in the draft path segment of every later call. e.g. "novel" */ key:string;/** Genre this draft was created with, which decides the kinds, properties and checks it obeys. e.g. "novel_long" */ genre:string;/** Page title of the draft, such as a platform note with its campaign name; the published title is a draft property instead. e.g. "乌江 · 长篇小说" */ title:string;/** Whether the thing this draft derives from moved past the revision it was built on, which a rebase call clears. */ stale:boolean;/** Number of units in the draft tree today, counted across every level. e.g. 24 */ unit_count:number;/** Total characters written across the draft bodies, with whitespace removed. e.g. 68210 */ chars:number;/** Draft structure and property revision; pass it as expected_revision when changing the draft itself rather than a unit. e.g. 9 */ revision:number;/** Content revision of the draft; a draft derived from this one is stale once this passes its derived_from.revision. e.g. 22 */ content_revision:number;derived_from?:{/** What the draft was derived from: the goal message of the work, or another draft of the same work. */ kind:"message"|"draft";/** Identifier of the source draft, present only when the kind is draft. e.g. "drf_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ draft?:string;/** Source revision this draft was built on; when the source moves past it, stale becomes true until a rebase confirms the catch-up. e.g. 96 */ revision:number};last_rendition?:{/** Versioned platform key of that rendition, such as wechat_mp@1. e.g. "wechat_mp@1" */ platform?:string;/** State the rendition reached, such as exported or published; a state other than published means nothing reached the platform. e.g. "published" */ state?:string}}>})&({/** Computed todo list of the requested draft, in the order they should be worked. */ status?:Array<{/** What is outstanding, chosen from a closed set so a caller can branch on it instead of reading the text. */ kind:"goal_incomplete"|"brief_points_unplaced"|"no_structure"|"intent_missing"|"intent_ahead_of_body"|"body_missing"|"draft_stale"|"work_adaptation_stale"|"prop_missing"|"check_failed"|"review_unresolved"|"rendition_stale"|"rendition_missing"|"publish_blocked";/** Which of the seven layers this item belongs to, used to order the list; the layers are always in the same order. */ layer:"goal"|"frame"|"task"|"reference"|"body"|"coherence"|"rendition";/** Unit this item is about, present when the item points at one unit rather than the whole draft. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ unit?:string;/** In-work number of that unit, which is what the unit path segment of a call takes. e.g. 12 */ number?:number;/** The item in words, written to be shown to a person as is. e.g. "第 12 节还没有正文" */ text:string;/** For a check_failed item, the key of the failing check, so a program can act on it without parsing the text; a unit that already has an item for it gets no separ e.g. "body_total_chars" */ check?:string;/** Suggested next call for this item, offered as guidance rather than a fixed script. e.g. "praxis.studio.works.units.retrieveContext" */ call?:string}>;/** Unit tree of the requested draft without bodies, in draft order. */ outline?:Array<{/** Unit identifier, stable when units are moved or renamed. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Work this unit belongs to; it is the same value the work path segment carries. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ work?:string;/** Draft this unit belongs to; units never move between drafts. e.g. "drf_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ draft?:string;/** In-work number assigned in creation order, never reused and unchanged by a move; it is what the unit path segment takes. e.g. 12 */ number:number;/** Unit this one sits under, or null at the top level of the tree. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ parent?:string;/** Sort key among siblings; it is opaque, and moving a unit rewrites only its own row. e.g. "0|hzzzzz:" */ position?:string;/** Structural kind of this unit, which must be one the genre allows at this position of the tree. e.g. "chapter" */ kind:string;/** Structure name used by people and agents to manage the tree, such as the second scene of a chapter; it is not the published heading. e.g. "第二章 · 排字房" */ name:string;/** Heading the finished piece shows for this unit, or null when it shows none; a genre may require it or forbid it. e.g. "第二章 排字房" */ heading?:string;intent:{/** What this unit has to accomplish, written as the story so far for later units; it is what a reader of the outline sees. e.g. "主角在排字房看到通缉令,第一次动摇了立场。" */ synopsis:string;/** Points this unit hits, called beats, arguments or selling points depending on the genre. */ points:Array<string>;/** Keys of the brief points this unit claims, which is how the requirement coverage check knows a point landed. */ brief_points:Array<string>;/** Intent revision, moved whenever the synopsis or the points change; a body written against an older value is behind. e.g. 4 */ revision:number;/** Whether the writer confirmed the synopsis matches what the body actually says, rather than what was planned. */ synopsis_from_body:boolean};/** How far this unit has come, moving forward as intent and body are written; a unit marked final refuses changes without confirmation. */ status:"idea"|"outlined"|"writing"|"drafted"|"revised"|"final";/** Intent revision the current body was written against, or null when there is no body; an older value means the intent moved on. e.g. 4 */ body_from_intent?:number;/** Unit of the upstream draft this one was written from, present when the draft derives from another; a serial of a novel records it per section. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ source_unit?:string;/** Reference entries this unit is tied to, including the mentions detected in its text. */ links?:Array<{/** Identifier of the reference entry this unit is tied to. e.g. "ent_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ entry?:string;/** How the tie came about, which decides whether the entry reaches the context pack for this unit. */ kind?:"mention"|"attached"|"excluded";/** Role of the entry inside this genre, such as point-of-view character or main product; it lifts the entry's priority in the pack. e.g. "视角人物" */ role?:string}>;/** Characters in the body with whitespace removed, which is what the length checks measure. e.g. 2680 */ chars:number;/** Duration in seconds for units of a video genre, or null for a written unit. e.g. 42 */ seconds?:number;/** Unit revision, moved by any change to the unit; pass it as expected_revision when writing the body. e.g. 6 */ revision:number;last_editor?:{/** Whether the change came from a person, an agent or the platform itself; an agent session through the API is recorded as an agent. */ kind?:"user"|"agent"|"system";/** Identifier of that actor, such as a user identifier or an agent session identifier. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id?:string;/** Display name of the actor when one is known, shown beside the change. e.g. "张三" */ label?:string};/** Body blocks, present only when the unit was read with its content; writing block by block needs their identifiers. */ blocks?:Array<{/** Block identifier, carried inline in Markdown as an anchor comment so an edit can address one block without rewriting the body. e.g. "blk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Unit revision at which this block was last changed; it decides whether an older precondition still allows a block edit. e.g. 6 */ revision:number;/** Element kind of this block, from the set the genre allows; it decides how the block is rendered in a rendition. */ type:"paragraph"|"heading"|"list"|"quote"|"code"|"image"|"video"|"divider"|"scene_break"|"callout"|"hashtags"|"link"|"cut"|"canvas";/** Markdown text of this block, empty for blocks that carry a reference instead of words. e.g. "排字房的铅字盘上,压着一张通缉令。" */ text:string;/** File this block shows, for image and video blocks, referenced by its file identifier. e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ file?:string;/** Caption shown with a media block and carried into renditions that keep captions. e.g. "1935 年的排字房" */ caption?:string;/** Heading depth for a heading block, one to four, which decides the outline level in the finished piece. e.g. 2 */ level?:number}>}>;current?:({/** Unit identifier, stable when units are moved or renamed. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Work this unit belongs to; it is the same value the work path segment carries. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ work?:string;/** Draft this unit belongs to; units never move between drafts. e.g. "drf_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ draft?:string;/** In-work number assigned in creation order, never reused and unchanged by a move; it is what the unit path segment takes. e.g. 12 */ number:number;/** Unit this one sits under, or null at the top level of the tree. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ parent?:string;/** Sort key among siblings; it is opaque, and moving a unit rewrites only its own row. e.g. "0|hzzzzz:" */ position?:string;/** Structural kind of this unit, which must be one the genre allows at this position of the tree. e.g. "chapter" */ kind:string;/** Structure name used by people and agents to manage the tree, such as the second scene of a chapter; it is not the published heading. e.g. "第二章 · 排字房" */ name:string;/** Heading the finished piece shows for this unit, or null when it shows none; a genre may require it or forbid it. e.g. "第二章 排字房" */ heading?:string;intent:{/** What this unit has to accomplish, written as the story so far for later units; it is what a reader of the outline sees. e.g. "主角在排字房看到通缉令,第一次动摇了立场。" */ synopsis:string;/** Points this unit hits, called beats, arguments or selling points depending on the genre. */ points:Array<string>;/** Keys of the brief points this unit claims, which is how the requirement coverage check knows a point landed. */ brief_points:Array<string>;/** Intent revision, moved whenever the synopsis or the points change; a body written against an older value is behind. e.g. 4 */ revision:number;/** Whether the writer confirmed the synopsis matches what the body actually says, rather than what was planned. */ synopsis_from_body:boolean};/** How far this unit has come, moving forward as intent and body are written; a unit marked final refuses changes without confirmation. */ status:"idea"|"outlined"|"writing"|"drafted"|"revised"|"final";/** Intent revision the current body was written against, or null when there is no body; an older value means the intent moved on. e.g. 4 */ body_from_intent?:number;/** Unit of the upstream draft this one was written from, present when the draft derives from another; a serial of a novel records it per section. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ source_unit?:string;/** Reference entries this unit is tied to, including the mentions detected in its text. */ links?:Array<{/** Identifier of the reference entry this unit is tied to. e.g. "ent_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ entry?:string;/** How the tie came about, which decides whether the entry reaches the context pack for this unit. */ kind?:"mention"|"attached"|"excluded";/** Role of the entry inside this genre, such as point-of-view character or main product; it lifts the entry's priority in the pack. e.g. "视角人物" */ role?:string}>;/** Characters in the body with whitespace removed, which is what the length checks measure. e.g. 2680 */ chars:number;/** Duration in seconds for units of a video genre, or null for a written unit. e.g. 42 */ seconds?:number;/** Unit revision, moved by any change to the unit; pass it as expected_revision when writing the body. e.g. 6 */ revision:number;last_editor?:{/** Whether the change came from a person, an agent or the platform itself; an agent session through the API is recorded as an agent. */ kind?:"user"|"agent"|"system";/** Identifier of that actor, such as a user identifier or an agent session identifier. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id?:string;/** Display name of the actor when one is known, shown beside the change. e.g. "张三" */ label?:string};/** Body blocks, present only when the unit was read with its content; writing block by block needs their identifiers. */ blocks?:Array<{/** Block identifier, carried inline in Markdown as an anchor comment so an edit can address one block without rewriting the body. e.g. "blk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Unit revision at which this block was last changed; it decides whether an older precondition still allows a block edit. e.g. 6 */ revision:number;/** Element kind of this block, from the set the genre allows; it decides how the block is rendered in a rendition. */ type:"paragraph"|"heading"|"list"|"quote"|"code"|"image"|"video"|"divider"|"scene_break"|"callout"|"hashtags"|"link"|"cut"|"canvas";/** Markdown text of this block, empty for blocks that carry a reference instead of words. e.g. "排字房的铅字盘上,压着一张通缉令。" */ text:string;/** File this block shows, for image and video blocks, referenced by its file identifier. e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ file?:string;/** Caption shown with a media block and carried into renditions that keep captions. e.g. "1935 年的排字房" */ caption?:string;/** Heading depth for a heading block, one to four, which decides the outline level in the finished piece. e.g. 2 */ level?:number}>})&({/** Whole body as Markdown with block anchors kept inline, so a rewrite can round-trip the block identifiers. e.g. "第一段。<!-- blk_01JQ8Z3M9K4V7B2N6C5X0YTRHW -->" */ markdown?:string;intent_diff?:{/** Intent revision the current body was written against. e.g. 4 */ from_revision?:number;/** Synopsis at that revision, shown beside the newer one so a writer can see what moved. e.g. "主角在报馆第一次见到通缉令。" */ synopsis?:string;/** Intent points at that revision, in the order they were written. */ points?:Array<string>}})})>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| work | path | string | yes | The work being addressed, either its organization-unique slug or its wk_ identifier; a slug case is what a person would say, and a renamed slug still resolves through its old value. |
| draft | query | string | no | Draft to include in the answer, either its in-work key such as novel or its drf_ identifier; when it is given, the answer also carries that draft’s todos, outline and current unit. |
| unit | query | string | no | Unit to include in the answer, written as its in-work number without a hash, such as 12; it returns that unit with its blocks and Markdown body. |
| expand | query | Array<“status” | “drafts” | “outline” | “unit”> | no | Extra parts to include, comma separated: status for the draft todo list, drafts for the draft summaries, outline for the unit tree without bodies, and unit for the current unit with its body. |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/json | The work with its drafts, plus the requested draft status, outline and current unit when asked for. |
| 400 | application/json | INVALID_PARAMS means a field is missing, malformed or not allowed for this resource; correct the named field and repeat the call. |
| 401 | application/json | The API key is missing, invalid or carries no organization; send a valid organization key in the Authorization header. |
| 404 | application/json | WORK_NOT_FOUND means no work in this organization matches that slug or identifier; use the value from the work list, or resolve a loose name first. |
| 500 | application/json | INTERNAL means the request could not complete; re-read the resource before retrying a write, because the write may already have landed. |