Unpublish workflow
Sets a workflow to inactive: the trigger no longer runs it. The versions are untouched, so
Publish workflow activates it again without changes. No body is needed.
Base URL:
POST: https://api.smsgatewayapi.com/v1/flows/{flow_id}/unpublishExample:
POST: https://api.smsgatewayapi.com/v1/flows/flw_5d41402abc4b2a76b9719d911017c592/unpublish
| 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 |
<?php
//PHP - cURL
$ch = curl_init();
$url = "https://api.smsgatewayapi.com/v1/flows/{flow_id}/unpublish";
$client_id = "XXX"; // Your API client ID (required)
$client_secret = "YYY"; // Your API client secret (required)
$data = [
//No parameters: an empty JSON object is fine
];
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_POST, true);
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 success response:
{
"id": "flw_5d41402abc4b2a76b9719d911017c592",
"uuid": "c0a8012e-4f5b-4d6c-8e9f-1a2b3c4d5e6f",
"name": "STOP = opt-out",
"status": "inactive",
"trigger_type": "inbound_message",
"trigger_config": {
"triggerType": "inbound_message",
"inboxId": 0
},
"published_version_number": 1,
"draft_version_number": null,
"has_draft_changes": false,
"published_at": "2026-09-08T10:20:00+02:00",
"updated_at": "2026-09-08T12:05:30+02:00",
"nodes": [ ... ],
"edges": [ ... ],
"viewport": null,
"meta": null,
"version_number": 1,
"version_status": "published"
}
Example error response:
{
"error": 163,
"errorMsg": "Flow [flw_5d41402abc4b2a76b9719d911017c592] not found"
}