Workflows
Create workflow draft
Open a new editable draft as a copy of a version (the latest when none is given), as the web app's "New draft" does: each step's triggers are then updated for the new draft.
Authorization
AuthorizationstringheaderrequiredBearer <key>, where <key> is a workspace API key or a user API key. See Authentication.
workspace_id*integerThe workspace. List the ones your key can reach with GET /v1/workspaces.
workflow_id*stringThe workflow.
uuidregion*RegionsRegion of the resource: besg (Europe) or usnv (United States), as GET /v1/regions lists them
"besg""usnv"Idempotency-Key?|Makes the create retry-safe for 24 hours: a retry with the same key answers the resource the first call created, with the Idempotent-Replayed: true header, and creates nothing. 1 to 255 visible ASCII characters. The same key with a different request answers 422; while the first call still runs, 409.
nullapplication/json- body
from_version?|The version copied into the new draft; the latest when absent
nullvalidate_only?Validate OnlyRun every check of the write and answer 204 without writing: a refused write answers the error the write would
falseCreated
application/json- response
workflow_id*Workflow Idregion*Regions"besg""usnv"version*A version without its document; step_ids lists its steps (workflow_module_instance_id)
triggers*array<>curl -X POST 'https://api.stacksync.com/v1/workspaces/0/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/drafts?region=besg' \ -H 'Content-Type: application/json' \ -d '{ "from_version": "<from_version>"}'{ "workflow_id": "<workflow_id>", "region": "besg", "version": { "workflow_version": "<workflow_version>", "is_draft": false, "is_deployed": false, "last_modified_time": "<last_modified_time>", "step_ids": [ "<step_ids>" ] }, "triggers": [ { "step_id": "<step_id>", "status": "succeeded", "msg": "<msg>" } ]}POSTCreate workflow
Create a workflow with only its Input step, as the builder's New workflow does: its other steps are saved in its draft once it exists (PATCH /draft), which sets up their triggers. A document refused leaves no workflow behind.
PATCHUpdate workflow
Rename a workflow, switch it on (running) or off (paused) with its schedules and sync triggers, or share it with the workspace.