remagicaDocs home
API referenceApps

Run an app

POST
/apps/{appId}/runs

Needs a key withapps:run

Runs an app with your values: they go into a copy of its published page in a workflow of your own, and every node its outputs need runs there (your workspace pays). Results show up pending at once.

Follow them with GET /workflows/{workflowId}/events (the run's workflowId), or poll GET /workflow-runs/{runId}. A run that can't start is refused with 409 RUN_REFUSED, as a workflow run is.

Requires scope apps:run.

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

appId*string
Length1 <= length <= 128

Header Parameters

Idempotency-Key?string

Makes the request safe to retry: send a unique value (a UUID, say). The same request sent again with the same key within 24 hours gets the first one's response back, and nothing runs or is charged twice. Reusing a key for a different request, or while the first is still running, is 409 CONFLICT. A request that fails frees its key.

Length1 <= length <= 255

Request Body

application/json
  1. body
count?integer

How many results each output makes.

Range1 <= value <= 20
Default1
priceVersion?integer

The price book version (GET /pricing) your estimate came from. If prices went up since, the run is refused with 409 PRICE_CHANGED and its new estimate, rather than charged more than you showed.

Range0 <= value
test?boolean

Run the workflow's page as it is now with the app's current inputs and outputs, published or not (people who can edit the workflow only).

Defaultfalse
values?

Values by input id (nodeId:key): text, a storage key of your workspace's file for a media input, or a parameter's value. Inputs left out keep the app's own value.

Default{}

Response Body

Accepted: the run is going.

application/json
  1. response
appId*string
createdAt*string
Formatdate-time
id*string
outputNodeIds*array<string>
run*

One run of nodes of a workflow.

values*
workflowId*string

The workflow the run runs in: follow GET /workflows/{workflowId}/events for its results.

Example Request
curl -X POST 'https://api.remagica.com/api/v1/apps/3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05/runs' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "appId": "3106d2f0-5b3d-4f60-8e2a-1d9c6b4f7e05",  "createdAt": "2026-10-21T12:00:00.000Z",  "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",  "outputNodeIds": [    "string"  ],  "run": {    "completedAt": "2026-10-21T12:00:00.000Z",    "count": 1,    "createdAt": "2026-10-21T12:00:00.000Z",    "creditsEstimated": 12,    "creditsSpent": 12,    "error": null,    "id": "8e41b2d7-0c5f-4a93-b6e2-1f7d9a3c5b08",    "nodeIds": [      "string"    ],    "pageId": "c5dd13a6-5b3d-4f60-8e2a-1d9c6b4f7e05",    "results": [      {        "createdAt": "string",        "credits": 12,        "error": null,        "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",        "outputs": {},        "provider": "string",        "runId": "599e5591-5b3d-4f60-8e2a-1d9c6b4f7e05",        "settings": {},        "status": "pending",        "stop": "kept",        "item": 1,        "nodeId": "7b79be4b-5b3d-4f60-8e2a-1d9c6b4f7e05",        "variation": 1      }    ],    "runType": "node",    "status": "running",    "workflowId": "cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"  },  "values": {    "node_prompt_1:text": "A cozy cabin in the snow"  },  "workflowId": "cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05"}