---
title: "Update Message Flow"
api: "PUT /v1/api/message-flows/{id}"
description: "Update an existing message flow with partial or full settings."
---

### Headers  

<ParamField header="x-workspace-id" type="string" required>
  Workspace identifier for the API.
</ParamField>

### Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the message flow to update.
</ParamField>

### Request Body

<ParamField body="description" type="string">
  Update the description for this message flow.
</ParamField>

<ParamField body="toggleAutopilot" type="boolean">
  If present and set to true, this toggles the autopilot setting.
</ParamField>

<ParamField body="settings" type="object">
  Configuration settings for the message flow.

  <Expandable title="settings">
    <ParamField body="responseSettings" type="object">
      <Expandable title="responseSettings">
        <ParamField body="delay" type="number">
          Delay (in seconds) before responding.
        </ParamField>
        <ParamField body="workingHours" type="object">
          <Expandable title="workingHours">
            <ParamField body="enabled" type="boolean">
              Whether working hours logic is enabled.
            </ParamField>
            <ParamField body="start" type="string">
              Start time for working hours, e.g., "09:00".
            </ParamField>
            <ParamField body="end" type="string">
              End time for working hours, e.g., "17:00".
            </ParamField>
            <ParamField body="timezone" type="string">
              Timezone for working hours, e.g., "UTC".
            </ParamField>
            <ParamField body="outOfHoursMessage" type="string">
              Automated reply for out-of-hours messages.
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>
    <ParamField body="security" type="object">
      <Expandable title="security">
        <ParamField body="hipaaCompliance" type="boolean">
          Whether HIPAA compliance is required.
        </ParamField>
      </Expandable>
    </ParamField>
    <ParamField body="emailSettings" type="object">
      <Expandable title="emailSettings">
        <ParamField body="subjectLine" type="string">
          Default subject line for emails sent in this flow, e.g., "Follow Up on Your Inquiry".
        </ParamField>
        <ParamField body="signature" type="string">
          Signature appended to email messages, e.g., "Regards".
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

### Response Fields

<ResponseField name="_id" type="string">
  The unique identifier for the message flow that was updated.
</ResponseField>

<ResponseField name="workspaceId" type="string">
  The identifier of the workspace where the message flow is configured.
</ResponseField>

<ResponseField name="name" type="string">
  The name of the message flow. While not specified as updated in the request body, it remains a critical part of the response for context.
</ResponseField>

<ResponseField name="direction" type="string">
  Indicates the direction of the message flow, such as "bidirectional".
</ResponseField>

<ResponseField name="description" type="string">
  The updated description of what the message flow is designed to handle.
</ResponseField>

<ResponseField name="agent" type="string">
  The identifier of the agent associated with this message flow.
</ResponseField>

<ResponseField name="settings" type="object">
  The configuration settings for the message flow, detailing updated and existing settings.
  <ResponseField name="responseSettings" type="object">
    Settings related to the timing and conditions under which responses are issued within the message flow.
    <ResponseField name="delay" type="number">
      The delay in seconds before a response is issued.
    </ResponseField>
    <ResponseField name="workingHours" type="object">
      Configuration for working hours during which the message flow is active.
      <ResponseField name="enabled" type="boolean">
        Whether working hours are enabled.
      </ResponseField>
      <ResponseField name="start" type="string">
        Start time of the working hours.
      </ResponseField>
      <ResponseField name="end" type="string">
        End time of the working hours.
      </ResponseField>
      <ResponseField name="timezone" type="string">
        Timezone applicable to the working hours.
      </ResponseField>
      <ResponseField name="outOfHoursMessage" type="string">
        Message to be delivered outside of working hours.
      </ResponseField>
    </ResponseField>
  </ResponseField>
  <ResponseField name="security" type="object">
    Security settings for the message flow, including HIPAA compliance status.
    <ResponseField name="hipaaCompliance" type="boolean">
      Indicates if HIPAA compliance is enforced.
    </ResponseField>
  </ResponseField>
  <ResponseField name="emailSettings" type="object">
    Email settings for managing email-based message flows.
    <ResponseField name="subjectLine" type="string">
      The subject line used for emails sent in this flow.
    </ResponseField>
    <ResponseField name="signature" type="string">
      The email signature appended to messages.
    </ResponseField>
  </ResponseField>
</ResponseField>

<ResponseField name="prompt" type="string">
  The system or initial prompt set for the AI agent in the message flow.
</ResponseField>

<ResponseField name="isActive" type="boolean">
  Indicates whether the message flow is currently active.
</ResponseField>

<ResponseField name="autopilot" type="boolean">
  Specifies whether autopilot is enabled or disabled after the update.
</ResponseField>

<ResponseField name="messageChannel" type="string">
  The type of communication channel used by the message flow, such as "SMS".
</ResponseField>

<ResponseField name="createdAt" type="string">
  The timestamp when the message flow was created.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  The timestamp when the message flow was last updated.
</ResponseField>


<ResponseExample>
```json
{
  "_id": "exampleId1",
  "workspaceId": "exampleWorkspaceId1",
  "name": "New Years Sale",
  "direction": "bidirectional",
  "description": "Handles customer support inquiries via SMS",
  "agent": "exampleAgentId1",
  "settings": {
    "responseSettings": {
      "delay": 0,
      "workingHours": {
        "enabled": false,
        "start": "09:00",
        "end": "17:00",
        "timezone": "UTC",
        "outOfHoursMessage": ""
      }
    },
    "security": {
      "hipaaCompliance": false
    },
    "emailSettings": {
      "subjectLine": "Follow Up on Your Inquiry",
      "signature": "Regards"
    }
  },
  "prompt": "You are a helpful AI that responds to user inquiries.",
  "isActive": true,
  "autopilot": true,
  "messageChannel": "SMS",
  "createdAt": "2025-01-02T10:15:00Z",
  "updatedAt": "2025-01-02T10:15:00Z"
}

```
</ResponseExample>
