Add an entry to a reference library
Code Mode: praxis.studio.codexes.entries.create
HTTP: POST /studio/v1/codexes/{codex}/entries
Add one entry: a character, a place, a product, a source of facts. Give it the type the genre uses, the name the text will mention, and the description, notes, facts and story time that should reach a writer when it is mentioned. Attach a picture gallery when the entry should be looked at as well as read. Aliases and excluded phrases keep detection honest, so a common word inside an idiom is not mistaken for the entry. A name already used in the library is refused.
Signature
praxis.studio.codexes.entries.create(args:{path:{/** e.g. "cdx_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ codex:string};body:{/** What kind of thing this entry is, from the types the genre's libraries carry. e.g. "location" */ type:"character"|"location"|"item"|"lore"|"event"|"source"|"fact"|"reference"|"product"|"audience"|"brand"|"persona"|"footage";/** Name as the text will mention it; it must be unique inside this library after normalization, and it is what a unit claims when it links this entry. e.g. "乌江日报" */ name:string;/** Free-text group to file this entry under, such as a layer of the setting, a faction or a cast, so people and later sessions find related entries together; leave e.g. "第 0 层 · 内核" */ group?:string;/** Other spellings the text may use, each matched like the name; use them instead of adding a second entry for the same thing. */ aliases?:Array<string>;/** Whether matching distinguishes letter case; leave it false unless the name collides with an ordinary word in another case. e.g. false */ case_sensitive?:boolean;/** Phrases in which this name must not count as a mention, such as a longer idiom containing it. */ exclude_phrases?:Array<string>;/** What a writer should know, in the words the piece should be able to use; this text reaches the context pack. e.g. "1935 年南京的一家民营报纸,主角在此做排字工。" */ description?:string;/** Fact ledger entries for this entry, keyed by the caller's own names; they reach the context pack and are compared for consistency. e.g. {"成立年份":"1928"} */ facts?:{[key:string]:string};/** Notes on this entry, which reach the writer's context pack on the line after the description and the facts; an empty string adds no line. e.g. "名字取自原型人物的笔名。" */ notes?:string;/** When this entry happens in the story, such as 2037, 1931 年 4 月 or 第 3 天; at most 40 characters, and an empty string records no time. e.g. "2037–2039" */ time?:string;/** When this entry reaches a context pack; when_mentioned is the default and keeps the pack small. e.g. "when_mentioned" */ tracking?:"always"|"when_mentioned"|"never";/** Entries this one relates to at creation, each naming the target and the label that reads from this entry to it. */ relations?:Array<{/** Entry this one relates to, by its name in the same library or by its ent_ identifier. e.g. "陈望之" */ entry:string;/** How the relation reads from this entry to that one, such as 工作单位 or 对手. e.g. "社长" */ label:string}>;/** Picture gallery of this entry, in write order: send pictures with a name and a description, or send a bare file identifier when the picture has no name yet and */ images?:Array<string|{/** Identifier of the uploaded file, from the file service; the bytes stay there and the gallery only references them, so attaching the same file to several entries e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ file:string;/** Short name shown under the picture, such as a view or a costume; at most 40 characters after trimming. e.g. "定妆 · 正面" */ name:string;/** What this particular picture shows and why it was chosen, such as the lighting or the angle; at most 200 characters, and an empty string means no description. e.g. "冷光,半身,衣领扣到最上面一颗。" */ description:string}>}}):Promise<{/** Entry identifier, stable across a rename; the name beside it is what the text has to mention. e.g. "ent_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Resource kind marker, always studio.entry for this shape. e.g. "studio.entry" */ object:string;/** Creation time in RFC 3339 UTC. e.g. "2026-11-04T09:33:18Z" */ create_time?:string;/** Time of the last change to this entry in RFC 3339 UTC. e.g. "2026-11-04T10:05:01Z" */ update_time?:string;/** Console address that opens this entry inside its library, which is where its facts and mentions can be read side by side. e.g. "https://console.deepraxis.com/studio/codexes/cdx_01JQ8Z3M9K4V7B2N6C5X0YTRHW?entry=%E4%B9%8C%E6%B1%9F%E6%97%A5%E6%8A%A5" */ viewer_url:string;/** Library this entry belongs to; an entry never moves between libraries. e.g. "cdx_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ codex:string;/** What kind of thing this entry is, which decides how it is shown and which genres treat it as a viewpoint or a product rather than as background. */ type:"character"|"location"|"item"|"lore"|"event"|"source"|"fact"|"reference"|"product"|"audience"|"brand"|"persona"|"footage";/** Name as the text mentions it, unique inside this library after normalization; detection matches this and the aliases by word boundary. e.g. "乌江日报" */ name:string;/** Free-text group the person or agent chose for this entry, such as a layer of the setting, a faction or a cast; the Console lists entries under it, and an empty e.g. "第 0 层 · 内核" */ group:string;/** Other spellings or short forms the text may use for this entry, each matched like the name itself. */ aliases:Array<string>;/** Whether matching distinguishes letter case; leave it false for Chinese text and turn it on for names that collide with ordinary words. */ case_sensitive:boolean;/** Phrases in which this name must not count as a mention, such as an idiom that happens to contain it. */ exclude_phrases:Array<string>;/** What a writer should know about this entry; it is the text that reaches the context pack when the entry is included. e.g. "1935 年南京的一家民营报纸,主角在此做排字工。" */ description:string;/** Fact ledger for this entry, such as a birth year, an age or a possession; the keys are the caller's own and the values are compared for consistency across units e.g. {"成立年份":"1928","社长":"陈望之"} */ facts:{[key:string]:string};/** Notes on this entry that reach the writer's context pack, rendered on the line after the description and the facts; an empty string adds no line. e.g. "名字取自原型人物的笔名。" */ notes:string;/** When this entry reaches a context pack: in every unit of a work that attaches the library, only when the text mentions it, or never. */ tracking:"always"|"when_mentioned"|"never";/** Other entries this one relates to, each with the label that reads from this entry to the other, such as a workplace or a rival. */ relations:Array<{/** Entry this one relates to, by its ent_ identifier. e.g. "ent_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ entry:string;/** How the relation reads from this entry to that one, such as 工作单位 or 对手. e.g. "工作单位" */ label:string}>;/** Picture gallery of this entry, in the order the pictures were written; each carries a name and a description, and the gallery is shown beside the entry rather t */ images:Array<{/** Identifier of the uploaded file, from the file service; the bytes stay there and the gallery only references them, so attaching the same file to several entries e.g. "file_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ file:string;/** Short name shown under the picture, such as a view or a costume; at most 40 characters after trimming. e.g. "定妆 · 正面" */ name:string;/** What this particular picture shows and why it was chosen, such as the lighting or the angle; at most 200 characters, and an empty string means no description. e.g. "冷光,半身,衣领扣到最上面一颗。" */ description:string}>;/** When this entry happens in the story, written the way the setting reads it, such as 2037 or 民国二十四年冬; an empty string means no time is recorded, which is also wh e.g. "2037–2039" */ time:string}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| codex | path | string | yes | Reference library being addressed, given by its cdx_ identifier; a library has no name-based address, so read the library list first when only the name is known. |
Request body
| Required | Content types | Description |
|---|---|---|
| yes | application/json | The entry to add: its type, its name, and the description, facts and detection settings that decide when it reaches a writer. |
Responses
| Status | Content types | Description |
|---|---|---|
| 201 | application/json | The new entry with its normalized name and detection settings; keep its name, which is what a unit intent claims. |
| 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 | CODEX_NOT_FOUND means no reference library in this organization has that identifier; read the library list and pass one of its identifiers, since a library owned by another organization answers the same way. |
| 409 | application/json | ENTRY_NAME_TAKEN means an entry with that name or an alias of it already exists in this library after normalization; change the existing entry instead of adding a second one. |
| 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. |