# Update workflow

> Rename it, or change stop on reply, re-entry or the sending hours.

Source: https://docs.mycrmsim.com/docs/automations/update-workflow

```http
PATCH https://backend.mysmsgateway.app/api/v1/ext/workflows/{id}
```

- Category: myCRMSIM Automations / Automations
- Auth: Bearer access token
- Scope: `automations.write`

Settings only: the steps are kept exactly as they are, so contacts already in the workflow carry on. Steps are edited in Automations on the dashboard, and `status` is changed with Activate / Deactivate workflow.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | number | yes | Workflow id. Example: `1201` |
| `workspace_id` | body | number | yes | A workspace of the installer. Example: `7` |
| `name` | body | string | no | Workflow name, 1–255 characters. |
| `stop_on_reply` | body | boolean | no | A contact who replies leaves the workflow. |
| `allow_re_entry` | body | boolean | no | A contact who finished can start it again. |
| `execution_window` | body | object \| null | no | Only send between these hours: `{ "enabled": true, "timezone": "Australia/Sydney", "start_time": "09:00", "end_time": "18:00", "skip_weekends": true }`. `null` (or `enabled: false`) turns it off. |

## Request body

```json
{
  "workspace_id": 7,
  "name": "Welcome — new contacts",
  "stop_on_reply": false,
  "execution_window": {
    "enabled": true,
    "timezone": "Australia/Sydney",
    "start_time": "09:00",
    "end_time": "18:00",
    "skip_weekends": true
  }
}
```

## Response fields (workflow)

| Field | Type | Description |
| --- | --- | --- |
| `id` | number | Workflow id. |
| `name` | string | Workflow name. |
| `status` | string | `draft` (not running) or `active` (running). |
| `workspace_id` | number | The workspace it runs in. |
| `stop_on_reply` | boolean | A contact who replies leaves the workflow. |
| `allow_re_entry` | boolean | A contact who finished can start it again. |
| `execution_window` | object | The hours it may send in: `enabled`, `timezone`, `start_time`, `end_time`, `skip_weekends`. |
| `step_count` | number | How many steps (canvas nodes) it has, the trigger included. |
| `created_at` | string (ISO 8601) | Created. |
| `updated_at` | string (ISO 8601) | Last saved. |

## Response 200

OK

```json
{
  "success": true,
  "message": "Workflow updated",
  "data": {
    "id": 1201,
    "name": "Welcome — new contacts",
    "status": "draft",
    "workspace_id": 7,
    "stop_on_reply": false,
    "allow_re_entry": true,
    "execution_window": {
      "enabled": true,
      "timezone": "Australia/Sydney",
      "start_time": "09:00",
      "end_time": "18:00",
      "skip_weekends": true
    },
    "step_count": 4,
    "created_at": "2026-10-28T09:00:00.000Z",
    "updated_at": "2026-10-28T09:00:00.000Z"
  }
}
```

## Response 400

Nothing to update, a bad value, or steps / status sent

```json
{
  "success": false,
  "message": "Steps cannot be changed through the API; edit them on the dashboard"
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope(s): automations.write. This integration was granted: …"
}
```

## Response 404

workspace_id does not exist or is not the installer's (same response for both)

```json
{
  "success": false,
  "message": "Workspace not found or not accessible to this token"
}
```

## Response 404

The workflow does not exist, is not the installer's, or is in another workspace

```json
{
  "success": false,
  "message": "Workflow not found or not accessible to this token"
}
```
