Restore a saved flow version
const url = 'https://api-dev.mindflow.io/v1/organizations/ORGA-57b858ed-ec60-4507-b2ef-ea58244ac742/flows/PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19/versions/VERS-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/restore';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"environmentId":"ENVI-57b858ed-ec60-4507-b2ef-ea58244ac742"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-dev.mindflow.io/v1/organizations/ORGA-57b858ed-ec60-4507-b2ef-ea58244ac742/flows/PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19/versions/VERS-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d/restore \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "environmentId": "ENVI-57b858ed-ec60-4507-b2ef-ea58244ac742" }'Copies one saved version back onto the live canvas: the working copy that Studio edits and that deployments tracking latest run. Steps, links, and flow settings become those of the saved version, so the next run uses them.
Before it restores, the platform saves the current canvas as a new version named Autosave. List versions to find
it when you need to undo the restore.
versionId must be a saved version of this flow. Passing latest, or the id of the live canvas entry
(isLatest: true), returns 400. 404 when the flow or version is missing. 409 NO_LATEST_DEPLOYMENT when
the flow has no live canvas yet: create a flow deployment with versionId: "latest" first.
Success is 200 with flowId and the canvas revision after the restore. Send that revision as baseRevision
on your next replace.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Opaque id of the organization that owns the resource. In a playbook step this can be filled from the current organization when the caller leaves it unset.
Organization that owns the flow. Pass the value unchanged.
Example
ORGA-57b858ed-ec60-4507-b2ef-ea58244ac742Opaque id of a flow. Use it on get, update, delete, versions, and when deploying the flow.
Flow to restore. Pass the value unchanged.
Example
PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19Opaque id of one saved snapshot of a flow. Deploy this id to run that snapshot. It does not include the canvas.
Saved version to copy onto the live canvas, passed unchanged. latest is rejected with 400.
Example
VERS-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6dRequest Bodyrequired
Section titled “Request Bodyrequired”Request body for copying a saved version back onto the live canvas.
object
Environment the restore runs in, passed unchanged. Scheduled triggers in the restored version are checked against it. Use the environment of the flow deployment that tracks latest.
Example
{ "environmentId": "ENVI-57b858ed-ec60-4507-b2ef-ea58244ac742"}Responses
Section titled “Responses”Saved version restored onto the live canvas. Returns the flow id and the canvas revision after the restore.
The flow id and the live canvas revision after a restore. Send revision as baseRevision on the next replace.
object
Flow whose live canvas changed. Same value as the flowId path parameter.
Revision of the live canvas after this change.
Example
{ "flowId": "PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19", "revision": "ba78a5a43ca73898a4d85cb80dfee6483ea30fbf158ce13a2cc49ec901880088"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
The request was invalid. Common causes include:
- Invalid timestamp format.
- Using
cursorwithbeforeorafter. - Missing
limitwhen usingbeforeorafter. - Invalid field names in the
fieldsparameter.
See the error response for specific details about what went wrong.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always BAD_REQUEST on this response. Read detail for which value to change, then send a corrected request.
Example
{ "type": "about:blank", "title": "Bad Request", "status": 400, "detail": "The request body or query is invalid.", "code": "BAD_REQUEST"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Authentication failed. The request lacks valid credentials or the provided credentials are invalid.
Ensure you have:
- A valid API key or token.
- Proper authentication headers.
- Required permissions.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always MISSING_OR_INVALID_TOKEN on this response. Branch on this value, not on detail.
Example
{ "type": "about:blank", "title": "Unauthorized", "status": 401, "detail": "The bearer token is missing or invalid.", "code": "MISSING_OR_INVALID_TOKEN"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Forbidden. The server understood the request but refuses to authorize it.
For connector APIs, this often indicates insufficient permissions on the remote system (for example SFTP write access denied).
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always FORBIDDEN on this response. The token was accepted and the action is not allowed.
Example
{ "type": "about:blank", "title": "Forbidden", "status": 403, "detail": "You cannot perform this action.", "code": "FORBIDDEN"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
The requested resource was not found.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always NOT_FOUND on this response. The resource is not available to this caller.
Example
{ "type": "about:blank", "title": "Not Found", "status": 404, "detail": "The resource was not found.", "code": "NOT_FOUND"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
The flow has no live canvas yet (code is NO_LATEST_DEPLOYMENT). Nothing was restored. Create a flow deployment
with versionId: "latest", then retry.
Problem Details for a 409 on the live canvas. code says why: NO_LATEST_DEPLOYMENT when the flow has no live canvas
yet (create a flow deployment with versionId: "latest"), REVISION_CONFLICT when the canvas changed since
baseRevision was read (re-read the latest definition and re-apply), or UNSUPPORTED_CONSTRUCTS when the live
canvas holds constructs the Workflow SDK cannot express (findings names them).
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Stable conflict code. NO_LATEST_DEPLOYMENT: no live canvas yet. REVISION_CONFLICT: the live canvas changed
since baseRevision. UNSUPPORTED_CONSTRUCTS: a replace would drop constructs the SDK cannot express.
Present with UNSUPPORTED_CONSTRUCTS. Each finding names a construct the SDK cannot express.
One compile, decompile or save finding. error findings block the request; warning findings are advice and
never block. When the finding comes from the TypeScript source, line and column locate it (1-based).
object
Stable rule identifier for the finding, grouped by layer (for example syntax.parse, structure.reference, catalog.operation, save.renamed).
error blocks the request; warning is advice.
What is wrong, in one sentence.
How to fix it, when the rule knows.
Relative path of the TypeScript file the finding is about.
1-based line where the construct starts.
1-based column where the construct starts.
1-based line where the construct ends.
1-based column where the construct ends.
Step id from the definition when the finding is about one step.
Dotted option path inside the step (for example fields.channel) when the finding is about one option.
Example
{ "type": "about:blank", "status": 409, "title": "Conflict", "detail": "This flow has no live canvas yet. Create a flow deployment with versionId \"latest\", then retry.", "code": "NO_LATEST_DEPLOYMENT"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Too many requests. The request rate limit has been exceeded.
Please wait until the rate limit window resets before making additional requests.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always RATE_LIMIT_EXCEEDED on this response. Wait Retry-After seconds before retrying.
Example
{ "type": "about:blank", "title": "Too Many Requests", "status": 429, "detail": "The request rate limit has been exceeded.", "code": "RATE_LIMIT_EXCEEDED"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Internal server error. The server encountered an unexpected condition that prevented it from fulfilling the request.
Please try again later or contact support if the problem persists.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always INTERNAL_ERROR on this response. Retry later. Do not retry a create in a tight loop.
Example
{ "type": "about:blank", "title": "Internal Server Error", "status": 500, "detail": "The request could not be completed.", "code": "INTERNAL_ERROR"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.