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

# Pausar IA

> Pausa el agente de IA globalmente por un tiempo determinado

Pausa la IA por un número de minutos. La IA se **reactiva automáticamente** cuando el tiempo expira.

<Note>
  Este es un control global. Para pausar la IA en conversaciones individuales, usa [Control por Conversación](/api-reference/conversations/ai-control).
</Note>

## Parámetros

<ParamField body="duration" type="number" required>
  Duración de la pausa en minutos. Mínimo: 1, Máximo: 1440 (24 horas)
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.whaapy.com/agent/v1/pause \
    -H "Authorization: Bearer wha_TU_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "duration": 30 }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.whaapy.com/agent/v1/pause', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer wha_TU_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ duration: 30 })
  });

  const data = await response.json();
  console.log(data.pausedUntil); // "2026-01-29T15:30:00.000Z"
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.whaapy.com/agent/v1/pause',
      headers={
          'Authorization': 'Bearer wha_TU_API_KEY',
          'Content-Type': 'application/json'
      },
      json={'duration': 30}
  )

  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "pausedUntil": "2026-01-29T15:30:00.000Z",
    "message": "Agente IA pausado por 30 minutos"
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "error": "Invalid duration",
    "message": "La duración debe ser entre 1 y 1440 minutos"
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": "Unauthorized",
    "message": "API Key inválida o expirada"
  }
  ```
</ResponseExample>

## Response

| Campo         | Tipo              | Descripción                        |
| ------------- | ----------------- | ---------------------------------- |
| `success`     | boolean           | `true` si la operación fue exitosa |
| `pausedUntil` | string (ISO 8601) | Fecha/hora cuando la pausa expira  |
| `message`     | string            | Mensaje descriptivo                |

## Scope Requerido

Este endpoint requiere el scope `agent:write` en tu API Key.

## Casos de Uso

<AccordionGroup>
  <Accordion title="Pausar durante horario de oficina">
    Cuando tu equipo está disponible para atender manualmente:

    ```javascript theme={null}
    // Pausar por 2 horas (horario de almuerzo)
    await fetch('https://api.whaapy.com/agent/v1/pause', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer wha_TU_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({ duration: 120 })
    });
    ```
  </Accordion>

  <Accordion title="Integración con n8n/Zapier">
    Pausa la IA mientras tu automatización procesa mensajes:

    ```javascript theme={null}
    // Nodo HTTP Request en n8n
    // URL: https://api.whaapy.com/agent/v1/pause
    // Method: POST
    // Body: { "duration": 60 }
    ```
  </Accordion>
</AccordionGroup>

<Tip>
  La IA se reactiva automáticamente al expirar el tiempo. Si necesitas desactivarla permanentemente, usa [Activar/Desactivar IA](/api-reference/agent/toggle).
</Tip>
