remagicaDocs home
API referenceWorkflows

Save a workflow

PUT
/workflows/{workflowId}

Needs a key withworkflows:write

Saves a workflow's document and/or name. Send the version you last read; if someone saved since, you get 409 and should reload (or merge). Nodes' results and status in what you send are ignored. The response is the workflow's summary with its new version.

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

workflowId*string
Length1 <= length <= 128

Request Body

application/json
  1. body
document?

The document (schemaVersion: 2): pages of nodes and edges in React Flow's shape, and the workflow's variables. A node's settings are in data.settings (see GET /node-types); edges join handles by key. Nodes' results and status are the server's: they're filled in when you read the workflow and ignored when you save it. A node shows and sends on the result at data.selectedResultIndex, or its newest when that's left out.

name?string
Length1 <= length <= 200
version*integer

The version you last read. A save based on an older version is refused (409), so nobody overwrites changes they haven't seen.

Range1 <= value

Response Body

The saved workflow's summary, with its new version.

application/json
  1. response
createdAt*string
Formatdate-time
id*string
name*string
nodeCount*integer
updatedAt*string
Formatdate-time
version*integer
Example Request
curl -X PUT 'https://api.remagica.com/api/v1/workflows/cb35dcdb-5b3d-4f60-8e2a-1d9c6b4f7e05' \  -H 'Content-Type: application/json' \  -d '{  "version": 3}'
Example Response
{  "createdAt": "2026-10-21T12:00:00.000Z",  "id": "a5614527-5b3d-4f60-8e2a-1d9c6b4f7e05",  "name": "Autumn campaign",  "nodeCount": 1,  "updatedAt": "2026-10-21T12:00:00.000Z",  "version": 3}