List the templates a genre can start from
Code Mode: praxis.studio.templates.list
HTTP: GET /studio/v1/templates
List templates: the built-in starting structures of each genre, followed by the ones this organization saved. Pass a genre to see only the templates that genre can use. A template is used once when a draft is created and is then detached, so changing a template never rewrites a draft that already started from it.
Signature
praxis.studio.templates.list(args?:{query?:{/** e.g. "novel_long" */ genre?:string;/** e.g. 20 */ page_size?:number;/** e.g. "01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ page_token?:string}}):Promise<{/** Templates on this page: the built-in ones of the genre first, then the organization's own. */ items:Array<{/** Template id for a saved template, or the built-in key when builtin is true. e.g. "three-act" */ id?:string;/** Genre key whose drafts this template may seed; a template of another genre is refused. e.g. "novel_long" */ genre?:string;/** Display name of the template, shown where a draft chooses its starting structure. e.g. "三幕式" */ name?:string;/** Writing guidance the template adds to the first context pack of the draft it seeded. e.g. "第一幕建立人物与目标,第二幕升级阻碍,第三幕兑现冲突。" */ guide?:string;/** Starting node tree in draft order, each node naming the unit kind and intent it creates. */ outline?:Array<{/** Unit kind key from the genre, which must be allowed at that position of the tree. e.g. "chapter" */ kind?:string;/** Structure name for the created unit, used for management rather than as a rendition heading. e.g. "第一幕 · 建立" */ name?:string;/** Starting synopsis of the unit intent, describing what this part has to accomplish. e.g. "主角的日常被打破,目标浮出水面。" */ synopsis?:string;/** Starting intent points for the unit, called beats, arguments or selling points depending on the genre. */ points?:Array<string>;/** Nested nodes created beneath this unit, in the order they appear in the draft. */ children?:Array<unknown>}>;/** Whether this template ships with the genre instead of being saved from a work; built-in ones cannot be deleted. */ builtin?:boolean}>;/** Cursor for the next page, empty when this was the last one; the built-in templates ride the first page only, so a later page carries saved templates alone. e.g. "" */ next_page_token?:string}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| genre | query | string | no | Genre key to filter by; when given, only the built-in and saved templates of that genre are returned. Omit it to list every genre’s templates together. |
| page_size | query | number | no | How many items this page returns, 1 to 100; omitted uses the service default. Treat the answer as one page, not the whole set, and keep following next_page_token while it is present. |
| page_token | query | string | no | Cursor from the previous answer’s next_page_token; it is opaque, so pass it back unchanged and never build one from an id or an offset. |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/json | One page of templates with their genres and outlines, and the cursor for the next page. |
| 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 | GENRE_NOT_FOUND means the key names no genre in the catalog; read the genre list and pass one of its keys exactly. |
| 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. |