Update material
Code Mode: praxis.media.libraries.materials.update
HTTP: PATCH /media/v1/libraries/{library_id}/materials/{asset_id}
Rename an element, move it, or replace its body. A new body is validated like a new element, replaces the old body whole and bumps version; generations that already used the element keep recording the version they read, and an Idempotency-Key replayed after the change is treated as a different request. Use library_id and asset_id from element creation. Example: PATCH /media/v1/libraries/lib_example/materials/9dfa312ef9bc4b00816339b598b1152c with {“name”:“Docs brand v2”}.
Signature
praxis.media.libraries.materials.update(args:{path:{library_id:string;asset_id:string};body:{/** New display name, 1 to 120 characters. */ name?:string;/** A whole new body for the same material_type; it replaces the old body and bumps version. */ body?:{/** What the character looks like and wears, in plain words; appended to the prompt of every generation that references the element. */ description:string;/** Pictures of the subject, 1 to 8, each an image or sticker asset of this same library, in the order a generation hands them to the model. */ references:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>;/** fictional for an invented character. */ likeness:"real_person"|"fictional";/** Consent record that authorises a real person’s likeness; required with likeness real_person and refused with fictional. */ consent_id?:string}|{/** What the product is and how it looks; appended to the prompt of every generation that references it. */ description:string;/** Pictures of the subject, 1 to 8, each an image or sticker asset of this same library, in the order a generation hands them to the model. */ references:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>;/** Facts such as material, size or colour as name/value pairs, at most 20; written into the prompt sorted by name. */ attributes?:{[key:string]:string};/** Details the model may not change, such as the logo position or the cap colour; at most 20 entries of up to 200 characters. */ must_keep?:Array<string>}|{/** The place, light and mood to reproduce; appended to the prompt of every generation that references it. */ description:string;/** Pictures of the subject, 1 to 8, each an image or sticker asset of this same library, in the order a generation hands them to the model. */ references:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>}|{/** Brand tone and voice in plain words. */ description:string;/** Optional pictures that show the brand, 0 to 8 image or sticker assets of this library; kept with the brand but never expanded into a generation. */ references?:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>;/** Logo assets of this library (images or stickers), at most 8. */ logos?:Array<string>;/** Brand colours, at most 12, written into the prompt as hex with their names. */ colors?:Array<{/** Colour as #rrggbb; stored in lower case. */ hex:string;/** Optional name of the colour, such as Praxis blue. */ name?:string}>;/** Font assets of this library, at most 8. */ fonts?:Array<string>;/** Words generated text should avoid, at most 100 entries of up to 40 characters. */ banned_words?:Array<string>};/** Folder to move the element to. */ asset_folder?:string}}):Promise<{/** Element id. */ asset_id:string;/** Always media.material. */ object:"media.material";/** Library that holds the element. */ library_id:string;/** Kind of element. */ material_type:"character"|"product"|"scene"|"brand";/** Display name of the element. */ name:string;/** Body version; every saved body bumps it, and a generation records the version it used in provenance.elements. */ version:number;/** The element body as stored. */ body:{/** What the character looks like and wears, in plain words; appended to the prompt of every generation that references the element. */ description:string;/** Pictures of the subject, 1 to 8, each an image or sticker asset of this same library, in the order a generation hands them to the model. */ references:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>;/** fictional for an invented character. */ likeness:"real_person"|"fictional";/** Consent record that authorises a real person’s likeness; required with likeness real_person and refused with fictional. */ consent_id?:string}|{/** What the product is and how it looks; appended to the prompt of every generation that references it. */ description:string;/** Pictures of the subject, 1 to 8, each an image or sticker asset of this same library, in the order a generation hands them to the model. */ references:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>;/** Facts such as material, size or colour as name/value pairs, at most 20; written into the prompt sorted by name. */ attributes?:{[key:string]:string};/** Details the model may not change, such as the logo position or the cap colour; at most 20 entries of up to 200 characters. */ must_keep?:Array<string>}|{/** The place, light and mood to reproduce; appended to the prompt of every generation that references it. */ description:string;/** Pictures of the subject, 1 to 8, each an image or sticker asset of this same library, in the order a generation hands them to the model. */ references:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>}|{/** Brand tone and voice in plain words. */ description:string;/** Optional pictures that show the brand, 0 to 8 image or sticker assets of this library; kept with the brand but never expanded into a generation. */ references?:Array<{/** Asset id of an image or sticker in this same library. */ asset_id:string;/** Optional word for what the picture shows, such as 正面 or side view; at most 20 characters. */ view?:string}>;/** Logo assets of this library (images or stickers), at most 8. */ logos?:Array<string>;/** Brand colours, at most 12, written into the prompt as hex with their names. */ colors?:Array<{/** Colour as #rrggbb; stored in lower case. */ hex:string;/** Optional name of the colour, such as Praxis blue. */ name?:string}>;/** Font assets of this library, at most 8. */ fonts?:Array<string>;/** Words generated text should avoid, at most 100 entries of up to 40 characters. */ banned_words?:Array<string>};/** Every asset the body names (pictures, logos, fonts). */ depends_on:Array<string>;/** Folder the element is filed in. */ asset_folder:string;/** Console page that shows the element to a person. */ viewer_url:string;/** When the element was created. */ created_at:string;/** When the element was last saved. */ updated_at:string}>;Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| library_id | path | string | yes | Library ID returned by creation. |
| asset_id | path | string | yes | 32-character asset ID. |
Request body
| Required | Content types | Description |
|---|---|---|
| yes | application/json |
Responses
| Status | Content types | Description |
|---|---|---|
| 200 | application/json | Successful response. |
| 400 | application/json | A selector, cursor, limit or other parameter is invalid; correct the reported field before retrying. |
| 402 | application/json | Request failed; see the error code reference. |
| 403 | application/json | This credential has read-only access to the library; use a write-capable binding for mutations. |
| 404 | application/json | The library or asset is missing, deleted or belongs to another tenant; verify its identifier and owner. |
| 409 | application/json | Request failed; see the error code reference. |
| 413 | application/json | The file exceeds an input limit; provide a smaller source file. |
| 415 | application/json | This media format is unsupported; provide a supported format. |
| 422 | application/json | Request failed; see the error code reference. |
| 429 | application/json | A rate limit was reached; wait before retrying. |
| 501 | application/json | The requested operation is unsupported; choose a supported method. |
| 502 | application/json | Request failed; see the error code reference. |
| 503 | application/json | Historical projections are still being initialized, or library storage is temporarily unavailable; retry shortly and check failureSummary counts_complete. |