Update workflow
Writes the editable draft of a workflow. Send only the keys you want to change; nodes and
edges always travel together. When the workflow is published and has no draft yet, a new draft version
is created next to the published version and the published version keeps running until you call
Publish workflow again. An empty body returns error 139.
Base URL:
PATCH: https://api.smsgatewayapi.com/v1/flows/{flow_id}Example:
PATCH: https://api.smsgatewayapi.com/v1/flows/flw_5d41402abc4b2a76b9719d911017c592
| Parameter | Input | Description | |
|---|---|---|---|
| client_id | API client ID | Developer › API & Webhooks › API credentials | Required |
| client_secret | API client secret | A cs_ credential, shown once when you create it under Developer › API & Webhooks › API credentials | Required |
| flow_id | workflow ID | The public ID (flw_...) of the workflow as returned by List workflows; the numeric ID is accepted too | Required |
| name | name of the workflow | 1 to 255 characters | Optional |
| nodes | list of node objects | 1 to 200 nodes; replaces the whole definition together with edges | Optional |
| edges | list of edge objects | 0 to 400 edges; always sent together with nodes | Optional |
| viewport | { x, y, zoom } | Position and zoom of the builder canvas | Optional |
| meta | object | Free-form data that is stored with the version | Optional |
<?php
//PHP - cURL
$ch = curl_init();
$url = "https://api.smsgatewayapi.com/v1/flows/{flow_id}";
$client_id = "XXX"; // Your API client ID (required)
$client_secret = "YYY"; // Your API client secret (required)
$data = [
'name' => "STOP = opt-out (renamed)" //New name (optional); nodes and edges can be sent too, always together
];
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-Client-Id: $client_id",
"X-Client-Secret: $client_secret",
"Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
?>
Example request:
{
"name": "STOP = opt-out (renamed)"
}
Example success response:
{
"id": "flw_5d41402abc4b2a76b9719d911017c592",
"uuid": "c0a8012e-4f5b-4d6c-8e9f-1a2b3c4d5e6f",
"name": "STOP = opt-out (renamed)",
"status": "active",
"trigger_type": "inbound_message",
"trigger_config": {
"triggerType": "inbound_message",
"inboxId": 0
},
"published_version_number": 1,
"draft_version_number": 2,
"has_draft_changes": true,
"published_at": "2026-09-01T09:00:00+02:00",
"updated_at": "2026-09-08T11:02:41+02:00",
"nodes": [ ... ],
"edges": [ ... ],
"viewport": null,
"meta": null,
"version_number": 2,
"version_status": "draft"
}
The workflow was published (version 1 stays active); the change went into a new draft, version 2.
Example error response:
{
"error": 139,
"errorMsg": "Parameters nodes and edges must be sent together"
}