Create flow deployment
const url = 'https://api-dev.mindflow.io/v1/organizations/ORGA-57b858ed-ec60-4507-b2ef-ea58244ac742/environments/ENVI-57b858ed-ec60-4507-b2ef-ea58244ac742/flow-deployments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"flowId":"PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19","versionId":"latest"}'};
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/environments/ENVI-57b858ed-ec60-4507-b2ef-ea58244ac742/flow-deployments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "flowId": "PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19", "versionId": "latest" }'Deploys flowId into the environment. versionId is required.
Pass the literal latest to deploy the flow’s live canvas: the deployment then follows every saved edit to the flow
(tracksLatest true), and the response versionId names that live canvas. Pass a saved version id to pin that version
(tracksLatest false); later edits to the flow do not reach the deployment.
The deployment is created in BUILD mode when the organization uses test and live deployments, otherwise in LIVE
mode. Change the mode in Studio.
The environment can hold more than one deployment of the same flow. List with flowId first to reuse an existing one.
Optional credentialsMapping binds step ids to credential ids in the same request.
The response includes flowDeploymentId when the deployment is ready. Status 201.
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.
Opaque id of the organization. Pass it unchanged.
Example
ORGA-57b858ed-ec60-4507-b2ef-ea58244ac742Opaque id of an environment. In a playbook step this can be filled from the current environment when the caller leaves it unset.
Opaque id of the environment. Pass it unchanged.
Example
ENVI-57b858ed-ec60-4507-b2ef-ea58244ac742Request Bodyrequired
Section titled “Request Bodyrequired”Which flow and version to deploy. versionId is required: a saved version id, or latest for the live canvas.
Optional credentialsMapping binds steps after the deployment is created.
Which flow and version to deploy. versionId is required: a saved version id, or latest for the live canvas.
Optional credentialsMapping binds steps after the deployment is created.
object
Flow to deploy into this environment.
The literal latest. In a version path it names the live canvas: the working copy that Studio edits and that flow
deployments tracking latest run.
Opaque id of one saved snapshot of a flow. Deploy this id to run that snapshot. It does not include the canvas.
Optional step-to-credential bindings applied after create. Each key must be a step id of the deployed version.
object
Examples
Deploy the live canvas
The deployment follows every saved edit to the flow.
{ "flowId": "PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19", "versionId": "latest"}Deploy a saved version and bind a credential
The deployment stays on this version until the version route changes it.
{ "flowId": "PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19", "versionId": "VERS-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "credentialsMapping": { "STEP-57b858ed-ec60-4507-b2ef-ea58244ac742": "CRED-8f14e45f-ceea-467a-a6e6-4e9b8c7d6e5a" }}Responses
Section titled “Responses”Deployment created. tracksLatest tells whether it follows the live canvas.
One deployment of a flow version into an environment. Start endpoints and the resume base URL are on the endpoints operation.
credentialsMapping maps a step id to a credential id. It never includes secret values. studioUrl opens it in Studio.
tracksLatest tells whether the deployment follows the flow’s live canvas or stays pinned to a saved version.
object
Organization that owns this deployment. Same value as the organizationId path parameter.
Opaque id of this deployment.
Environment the flow is deployed into. Same value as the environmentId path parameter.
Opaque id of the flow that was deployed.
Opaque id of the version this deployment runs. Change it with the version route.
When tracksLatest is true, this id names the flow’s live canvas, not a frozen snapshot.
When external triggers may start runs. Read-only on this API; change it in Studio.
BUILD is a test deployment: webhook, email, schedule, and chat triggers start runs only while a build session
is open in Studio. Runs started with the run operation always start. LIVE is always on and counts toward the
organization’s live-deployment quota.
True when the deployment follows the flow’s live canvas: every saved edit to the flow is picked up by the next run. False when the deployment is pinned to one saved version and ignores later edits.
Map of step id to credential id. Values are credential ids, never secret payloads. An empty object means no step is bound. Read or change this map on the credentials-mapping route.
object
When the deployment was created, as ISO 8601 UTC.
When the deployment was last changed, as ISO 8601 UTC.
When the current version was deployed, as ISO 8601 UTC. Absent before the first successful deploy.
Link that opens this deployment in the Studio designer. Give it to the user to review or edit the flow. Treat it as opaque; do not build it yourself.
Example
{ "organizationId": "$CURRENT_ORGANIZATION_ID", "flowDeploymentId": "FLDP-3fa85f64-5717-4562-b3fc-2c963f66afa6", "environmentId": "$CURRENT_ENVIRONMENT_ID", "flowId": "PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19", "versionId": "VERS-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "mode": "BUILD", "tracksLatest": true, "credentialsMapping": { "additionalProperty": "CRED-8f14e45f-ceea-467a-a6e6-4e9b8c7d6e5a" }, "createdAt": "2026-03-01T09:00:00.000Z", "updatedAt": "2026-03-20T15:30:45.123Z", "deployedAt": "2026-03-20T15:30:45.123Z", "studioUrl": "https://kronos.mindflow.io/57b858edec604507b2efea58244ac742/designer/FLDP-3fa85f64-5717-4562-b3fc-2c963f66afa6"}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.
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.