Import a sprite sheet
Needs a key withsprites:write
Imports a sheet you uploaded (POST /uploads): sliced on grid, its ground taken out, each row fitted to the game's canvas (one scale for the sheet, so the master's figure stands at the size class's height, and each row's lowest feet on the baseline) and made a draft take of its action in its direction, then scored against the master. With no characterId a new character is made (a Library sprite); its master comes from masterFrom, by default the first row's first frame. Rows can name the character's actions by key or any action by name (new ones are added). Charges nothing. Follow it on the studio's live feed (topic import) or with GET /sprites/imports/{importId}.
Requires scope sprites:write.
apiKeyx-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.
application/json- body
characterId?stringThe game's character it goes to. Left out: a new character is made.
1 <= length <= 128gameId*string1 <= length <= 128grid*The sheet's grid: cell i of a row starts at offsetX + i × (cellW + gapX).
idempotencyKey?stringThe same key returns the same import.
1 <= length <= 255image*An image you uploaded.
key?|The background colour to take out, as #rrggbb; null keeps every pixel. Left out: the sheet's own ground is found (a flat colour round its border).
masterFrom?The frame the master is made from. Left out: the first row's first frame for a new character, and the character's own master otherwise.
name?stringThe new character's name. Left out: the file's.
1 <= length <= 120rows*array<>The rows to import, each an action (actionKey or actionName) in a direction: one take each.
1 <= items <= 32Accepted: the import is queued.
application/json- response
characterId*stringThe character it goes to (made by the import when new).
1 <= length <= 128importId*stringThe import: the live feed (GET /sprites/events, topic import) follows it.
1 <= length <= 128status*string"queued""running""done""failed"curl -X POST 'https://api.remagica.com/api/v1/sprites/imports' \ -H 'Content-Type: application/json' \ -d '{ "gameId": "5c2a9e1d-7b3f-4a6e-8d0c-2f1e3a4b5c6d", "grid": { "cols": 8, "rows": 4 }, "image": { "key": "uploads/org_123/5d1c…/frame.png" }, "rows": [ { "direction": "E" } ]}'{ "characterId": "eb1fe45b-5b3d-4f60-8e2a-1d9c6b4f7e05", "importId": "2b7d4f9a1c3e5a7b9d0f2e4c6a8b0d1f", "status": "queued"}