remagicaDocs home
API referenceSprites

Replace a frame's image

POST
/sprites/frames/{frameId}/replace

Needs a key withsprites:write

Saves a touch-up: an uploaded PNG the frame's size (POST /uploads first) becomes the frame's file. The generated file is kept for revert (only the first original, so revert always gets back to it). The take is scored again; an approved take goes back to review. Locked frames can't change.

Requires scope sprites: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

frameId*string
Length1 <= length <= 128

Request Body

application/json
  1. body
image*

The touched-up frame: a PNG the size of the frame, as the Touch up tools drew it.

Response Body

The frame, scored again.

application/json
  1. response

The frame after the edit, scored again.

frame*

A frame of a take.

take*

The frame's take, after the edit.

Example Request
curl -X POST 'https://api.remagica.com/api/v1/sprites/frames/f68c2bb4-5b3d-4f60-8e2a-1d9c6b4f7e05/replace' \  -H 'Content-Type: application/json' \  -d '{  "image": {    "key": "uploads/org_123/5d1c…/frame.png"  }}'
Example Response
{  "frame": {    "clipIndex": 1,    "editedFromKey": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",    "gameplay": {      "events": [        "string"      ],      "hit": {        "h": 1,        "w": 1,        "x": 1,        "y": 1,        "damage": 1,        "knockback": {          "x": 1,          "y": 1        },        "on": true      },      "hurt": {        "h": 1,        "w": 1,        "x": 1,        "y": 1      },      "root": 1    },    "holdMs": 1,    "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",    "index": 1,    "isTween": true,    "key": "generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png",    "locked": true,    "offsetX": 1,    "offsetY": 1,    "score": 1,    "scoreModel": "string",    "takeId": "2a6faac1-5b3d-4f60-8e2a-1d9c6b4f7e05",    "url": "https://files.remagica.com/generations/e661f4c9-5b3d-4f60-8e2a-1d9c6b4f7e05/0.png"  },  "take": {    "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",    "status": "queued"  }}