Create a reference library
Code Mode: praxis.studio.codexes.create
HTTP: POST /studio/v1/codexes
Create a reference library: a store of the people, places, products and facts a piece draws on. Attach it to a work with the work update call, and the entries it holds then reach the context packs of that work’s units. A library made this way is shared across works, which suits brand facts several pieces mention; the library a work needs for its own setting is created with the work itself, and the work list call finds it by filtering on work.
签名
praxis.studio.codexes.create(args:{body:{/** Name of the new library, written so a person can tell it apart from the organization's other libraries. e.g. "乌江设定集" */ name:string;/** What this library is for; it is shown wherever the library is chosen and reaches nobody's context pack by itself. e.g. "1935 年南京的人物、地点与报纸资料" */ description?:string;labels?:{[key:string]:string}}}):Promise<{/** Reference library identifier, which is also its only address: a library has no name-based path. e.g. "cdx_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Resource kind marker, always studio.codex for this shape. e.g. "studio.codex" */ object:string;/** Creation time in RFC 3339 UTC. e.g. "2026-11-04T09:31:02Z" */ create_time?:string;/** Time of the last change to the library itself in RFC 3339 UTC; adding an entry moves the entry, not this. e.g. "2026-11-04T10:02:44Z" */ update_time?:string;/** Console address of this library, which opens its entry list; the same address carries an entry parameter when one entry is open. e.g. "https://console.deepraxis.com/studio/codexes/cdx_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ viewer_url:string;/** Name of the library, used by people to pick it when attaching it to a work; it is not unique across the organization. e.g. "乌江设定集" */ name:string;/** What this library is for and which works draw on it, shown beside the name wherever a library is chosen. e.g. "1935 年南京的人物、地点与报纸资料" */ description:string;/** How many entries the library holds right now, which is what tells a caller whether the entry list still needs paging. e.g. 48 */ entry_count:number;/** Work this library belongs to, or null for a library shared across works; every work is created with one library of its own, named after it. e.g. "wk_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ work:string;labels:{[key:string]:string}}>;请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json | The reference library to create: its name and an optional description. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 201 | application/json | The new library with its viewer link and an entry count of zero; keep its identifier to add entries. |
| 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. |
| 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. |