Change the title, goal or attached libraries
Code Mode: praxis.studio.works.update
HTTP: PATCH /studio/v1/works/{work}
Change work-level settings: the title, the slug, the goal, the attached reference libraries, the style or the archived flag. Send update_mask naming exactly the fields you change; a field left out keeps its value. Pass expected_revision to have the write refused when someone else changed the work first, and note that changing the message makes every draft derived from it stale.
签名
praxis.studio.works.update(args:{path:{/** e.g. "wu-gang" */ work:string};body:{/** Field paths this call changes, spelled as they appear in the work, such as title or goal.message; a field left out keeps its value. */ update_mask:Array<string>;/** Work revision the caller read; when the work moved past it the write is refused with REVISION_CONFLICT and nothing changes. e.g. 7 */ expected_revision?:number;/** New working title of the work, replacing the previous one when title is named in the update mask. e.g. "乌江(民国长篇)" */ title?:string;/** New organization-unique name; the previous slug keeps resolving so existing links do not break. pattern: ^[a-z0-9](?:[a-z0-9-]{1,62}[a-z0-9])$ e.g. "wu-jiang-2026" */ slug?: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};/** Complete set of reference libraries to keep attached; a library left out is detached from the work. */ codexes?:Array<string>;/** Style to attach to the work, replacing the previous one; send an empty value to detach the style entirely. e.g. "sty_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ style?:string;/** Cover image to set, by a file identifier that belongs to this organization, replacing the previous cover; send null with cover named in the update mask to clear e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ cover?:string;labels?:{[key:string]:string};/** Set to true to archive the work, which hides it from the default list without deleting anything. e.g. false */ archived?:boolean}}):Promise<{value:{/** 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}}>};/** Deterministic checks of the genre run against what was just written, empty when the change produced no new finding. */ checks?:Array<{/** Key of the check that produced this row, such as unit_chars or body_total_chars; the genre lists which ones it runs. e.g. "unit_chars" */ check:string;/** Whether the check passed; a failed hard check blocks publishing until the text changes. */ ok:boolean;/** What the check found, in words, including the measured value and the bound it broke. e.g. "本章 2680 字,低于 3000 字的目标。" */ text:string;/** Unit the finding is about, present when the check is per unit. e.g. "unt_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ unit?:string;/** Block the finding is about, present when the check is per block, such as a missing image or a banned word. e.g. "blk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ block?:string;/** How serious the finding is: an error fails the check, a warning is reported without failing it. */ severity:"error"|"warning";/** Whether this is a platform hard limit, which is the only kind a free-writing genre puts into its todo list. */ hard:boolean}>;/** The first few outstanding items of the draft, so the caller can continue with them instead of listing everything. */ next?: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}>}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| work | path | string | 是 | 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. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json | The work fields to change, with the update mask that names them. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The updated work with its checks and the next todos, so the caller continues without re-reading. |
| 400 | application/json | INVALID_PARAMS means a named field is missing, malformed or not allowed; correct it and repeat the call. STYLE_NOT_IN_WORK means the style belongs to another work, and a work may only use its own styles: list the styles with the work filter set to this work, create a style with work set to it if none fits, and attach one of those. |
| 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 or STYLE_NOT_FOUND means the work or the style named is not reachable in this organization; read the work for a reachable address and the style list for an identifier it returns. |
| 409 | application/json | REVISION_CONFLICT means the resource changed since the expected_revision you sent, so nothing was written; re-read it, merge the other change into yours and repeat the call with the revision you just read. |
| 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. |