remagicaDocs home
API referenceLibrary

Create an item

POST
/library/items

Needs a key withlibrary:write

Adds an asset (one file) or an element (a locked description plus ordered reference files) to the Library, from files the workspace already has: uploads, generation outputs, workflow node outputs.

Requires scope library:write.

Authorization

apiKey
headerx-api-key<token>

An API key of your workspace (rmg_…), created in the web app. It acts for that workspace, not for a person, and keeps working when its creator leaves.

Request Body

application/json
  1. body

A new Library item.

characterId?string

A registered character from GET /characters this element is (an asset:// reference). Video models that hold it get it as a reference.

Formatuuid
description?string

The locked description: added to every prompt that mentions the item, verbatim.

Lengthlength <= 4000
files?array<>

The files, references in order. An asset has exactly one; an element needs files or a description.

Itemsitems <= 50
Default[]
folderId?string

Folder of the same scope; the starting folder of kind when left out.

Length1 <= length <= 128
kind?string

What it is, as the starting folders sort it: character, sprite (a Sprite Studio character), scene, item, style, sound_effect or other.

Default"other"
Value in"character""sprite""scene""item""style""sound_effect""other"
name*string
Length1 <= length <= 120
scope?string

team: every member of the workspace sees and uses it. private: only you (in this workspace). API keys act for the workspace, so they use team only.

Default"team"
Value in"private""team"
slug?string

What @ completes, unique per workspace and scope (per person for Private). Made from the name when left out.

Match^[a-z0-9]+(?:-[a-z0-9]+)*$
Length1 <= length <= 48
source?

Where the files came from, for its history.

type?string

asset: one file. element: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet.

Default"asset"
Value in"asset""element"
voice?string

A voice (name or id) speech models use when the item is mentioned and the request sets none.

Length1 <= length <= 200

Response Body

The item.

application/json
  1. response

A Library item with its versions.

createdAt*string
Formatdate-time
deleted*boolean

Deleted (listed when asked for by ids, or in Recently Deleted).

deletedAt*|

When it was deleted; purged 30 days later.

description*string

The current version's locked description.

faces*|

Characters only: whether Seedance takes its face, from the generation that made its current version (trusted: Seedream or Seedance on ModelArk in the last 30 days). Other video models take any. Null for other items.

favorite*boolean
fileCount*integer
folderId*string|null
generationId?|

The generation it was filed from, for a generated asset.

id*string
Length1 <= length <= 128
kind*string

What it is, as the starting folders sort it: character, sprite (a Sprite Studio character), scene, item, style, sound_effect or other.

Value in"character""sprite""scene""item""style""sound_effect""other"
labels*array<>

Its labels, in name order.

latestVersion*integer

Number of the newest version.

mention*string

The token that mentions the current version in a prompt, e.g. [@ id="lib:<id>@v2" label="ninja"].

model*|

The model that made it (generated assets).

name*string
origin*string

upload: uploaded or made by hand. generation: filed from a generation (a workflow step's, the agent's or the API's).

Value in"upload""generation"
ownerUserId*string|null
pendingSheets*integer

AI Character sheets still generating.

pinnedAt*|

When it was pinned (for everyone who sees it); null: not pinned.

reviewStatus*|null
scope*string

team: every member of the workspace sees and uses it. private: only you (in this workspace). API keys act for the workspace, so they use team only.

Value in"private""team"
slug*string
sprite?|

Sprites (kind sprite) made in Sprite Studio: its character there. Null for other items.

thumbnail*|

The sheet, else the first reference. A character's portrait; a sprite's largest master.

type*string

asset: one file. element: a reusable character, place, prop or style: a locked description, ordered reference files and an optional generated sheet.

Value in"asset""element"
updatedAt*string
Formatdate-time
workflowId*|

The project (workflow) it came from.

provenance*|

How a generated asset was made; null for uploads.

sheetErrors*array<string>

Why AI Character sheets that just finished failed.

versions*array<>

Every version, newest first: the sheet history.

Example Request
curl -X POST 'https://api.remagica.com/api/v1/library/items' \  -H 'Content-Type: application/json' \  -d '{  "name": "Autumn campaign"}'
Example Response
{  "createdAt": "2026-09-30T12:00:00.000Z",  "deleted": true,  "deletedAt": null,  "description": "Product shots for the autumn campaign.",  "faces": "trusted",  "favorite": true,  "fileCount": 1,  "folderId": "899433f8-5b3d-4f60-8e2a-1d9c6b4f7e05",  "generationId": "241081c2-5b3d-4f60-8e2a-1d9c6b4f7e05",  "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",  "kind": "character",  "labels": [    {      "color": "gray",      "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",      "name": "Autumn campaign"    }  ],  "latestVersion": 3,  "mention": "string",  "model": "google/nano-banana-pro",  "name": "Autumn campaign",  "origin": "upload",  "ownerUserId": "ba132481-5b3d-4f60-8e2a-1d9c6b4f7e05",  "pendingSheets": 1,  "pinnedAt": "2026-10-21T12:00:00.000Z",  "reviewStatus": "todo",  "scope": "private",  "slug": "string",  "sprite": {    "characterId": "eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05",    "masterVersionId": "371019b7-5b3d-4f60-8e2a-1d9c6b4f7e05",    "sizeClass": "small"  },  "thumbnail": {    "contentType": "image/png",    "durationSeconds": 5,    "height": 1280,    "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",    "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",    "kind": "image",    "position": 1,    "role": "sheet",    "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",    "width": 1024  },  "type": "asset",  "updatedAt": "2026-09-30T12:00:00.000Z",  "workflowId": "cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05",  "provenance": {    "modelName": "string",    "project": {      "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",      "name": "Autumn campaign"    },    "prompt": "A lighthouse on a cliff at dusk, cinematic",    "settings": {}  },  "sheetErrors": [    "string"  ],  "versions": [    {      "characterId": "eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05",      "createdAt": "2026-09-30T12:00:00.000Z",      "createdByUserId": "f3656abb-5b3d-4f60-8e2a-1d9c6b4f7e05",      "description": "Product shots for the autumn campaign.",      "files": [        {          "contentType": "image/png",          "durationSeconds": 5,          "height": 1280,          "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",          "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",          "kind": "image",          "position": 1,          "role": "sheet",          "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",          "width": 1024        }      ],      "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",      "n": 1,      "sheet": {        "contentType": "image/png",        "durationSeconds": 5,        "height": 1280,        "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",        "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",        "kind": "image",        "position": 1,        "role": "sheet",        "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",        "width": 1024      },      "source": {},      "voice": "string"    }  ]}