remagicaDocs home
API referenceLibrary

Add a version

POST
/library/items/{itemId}/versions

Needs a key withlibrary:write

Saves a new version of an item (a changed description, references, sheet or voice) and makes it current. Versions never change, so canvases pinned to an older one keep it until they're updated. basedOn alone makes an older version (an older sheet) the default again.

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.

Path Parameters

itemId*string
Length1 <= length <= 128

Request Body

application/json
  1. body
basedOn?integer

Start from this version instead of the current one: sending only basedOn makes an old version (an older sheet) the default again, as a new version.

Range1 <= value
characterId?|null
description?string

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

Lengthlength <= 4000
files?array<>

Replaces the references (in order); left out, they're kept.

Itemsitems <= 50
sheetKey?|

A new sheet image (storage key); null drops the sheet; left out, it's kept.

voice?|null

Response Body

The item with its versions.

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/3f0c7a52-2f47-4a51-9b3e-9d7c0a1e6b21/versions' \  -H 'Content-Type: application/json' \  -d '{}'
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"    }  ]}