> ## Documentation Index
> Fetch the complete documentation index at: https://developers.leadwaycrm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Followup Settings

> Update the followup settings for an action

Update the followup settings for an action

```http theme={null}
PATCH https://services.leadconnectorhq.com/conversation-ai/agents/{agentId}/followup-settings
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="agentId" type="string" required />

## Body

<ParamField body="actionIds" type="string[]" required />

<ParamField body="followupSettings" type="object" required>
  <Expandable title="propiedades">
    <ParamField body="dynamicChannelSwitching" type="boolean" required default="True">
      Whether to dynamically switch channels for followups
    </ParamField>

    <ParamField body="followUpHours" type="boolean" default="True">
      Whether to respect working hours for followups
    </ParamField>

    <ParamField body="workingHours" type="object[]">
      Working hours configuration for followups

      <Expandable title="cada item">
        <ParamField body="dayOfTheWeek" type="number" required default="1">
          Day of the week (0=Sunday, 1=Monday, etc.)
        </ParamField>

        <ParamField body="intervals" type="object[]">
          Time intervals for this day

          <Expandable title="cada item">
            <ParamField body="startHour" type="number" required default="9">
              Start hour (24-hour format)
            </ParamField>

            <ParamField body="startMinute" type="number" required default="0">
              Start minute
            </ParamField>

            <ParamField body="endHour" type="number" required default="17">
              End hour (24-hour format)
            </ParamField>

            <ParamField body="endMinute" type="number" required default="30">
              End minute
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="timezoneToUse" type="string">
      Timezone to use for followups, contact or account Posibles valores: 'contact', 'business'
    </ParamField>
  </Expandable>
</ParamField>

## Respuestas

<Accordion title="200 - Success">
  <ResponseField name="data" type="object" required>
    Updated action details
  </ResponseField>

  <ResponseField name="success" type="boolean" required default="True">
    Success status of the request
  </ResponseField>

  ```json theme={null}
  {
    "success": true
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH 'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/followup-settings' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "actionIds": [
      "edxcfghbnjkimd"
    ],
    "followupSettings": {
      "dynamicChannelSwitching": true,
      "followUpHours": true,
      "workingHours": [
        {
          "dayOfTheWeek": 1,
          "intervals": []
        }
      ],
      "timezoneToUse": "contact"
    }
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/followup-settings', {
    method: 'PATCH',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"actionIds": ["edxcfghbnjkimd"], "followupSettings": {"dynamicChannelSwitching": true, "followUpHours": true, "workingHours": [{"dayOfTheWeek": 1, "intervals": []}], "timezoneToUse": "contact"}}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'PATCH',
      'https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/followup-settings',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"actionIds": ["edxcfghbnjkimd"], "followupSettings": {"dynamicChannelSwitching": true, "followUpHours": true, "workingHours": [{"dayOfTheWeek": 1, "intervals": []}], "timezoneToUse": "contact"}},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/conversation-ai/agents/YOUR_agentId/followup-settings');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'PATCH',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'actionIds': ['edxcfghbnjkimd'], 'followupSettings': {'dynamicChannelSwitching': true, 'followUpHours': true, 'workingHours': [{'dayOfTheWeek': 1, 'intervals': []}], 'timezoneToUse': 'contact'}}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
