> ## 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.

# Eliminar Etapa

> Elimina una etapa del funnel

<Info>
  **Scope requerido:** `funnels:write`
</Info>

Elimina una etapa del funnel. Solo es posible si no hay contactos en esa etapa.

<Warning>
  No puedes eliminar una etapa que tenga contactos. Primero debes mover los contactos a otra etapa usando [POST /funnel/v1/contacts/:id/move](/api-reference/funnels/contacts-move) o la [API de operaciones masivas](/api-reference/contacts/bulk).
</Warning>

***

## Path Parameters

<ParamField path="id" type="string" required>
  UUID de la etapa a eliminar
</ParamField>

***

## Ejemplos

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE https://api.whaapy.com/funnel/v1/stages/550e8400-e29b-41d4-a716-446655440000 \
    -H "Authorization: Bearer wha_TU_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const stageId = '550e8400-e29b-41d4-a716-446655440000';
  const response = await fetch(
    `https://api.whaapy.com/funnel/v1/stages/${stageId}`,
    {
      method: 'DELETE',
      headers: { 'Authorization': 'Bearer wha_TU_API_KEY' }
    }
  );
  ```

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

  stage_id = '550e8400-e29b-41d4-a716-446655440000'
  response = requests.delete(
      f'https://api.whaapy.com/funnel/v1/stages/{stage_id}',
      headers={'Authorization': 'Bearer wha_TU_API_KEY'}
  )
  ```

  ```php PHP theme={null}
  $stageId = '550e8400-e29b-41d4-a716-446655440000';
  $ch = curl_init("https://api.whaapy.com/funnel/v1/stages/{$stageId}");
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      'Authorization: Bearer wha_TU_API_KEY'
  ]);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($ch);
  ```
</RequestExample>

***

## Respuesta Exitosa

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Etapa eliminada",
    "stage_id": "550e8400-e29b-41d4-a716-446655440000"
  }
  ```
</ResponseExample>

***

## Errores

### Etapa no encontrada

<ResponseExample>
  ```json 404 Not Found theme={null}
  {
    "error": "not_found",
    "message": "Etapa no encontrada"
  }
  ```
</ResponseExample>

### Etapa tiene contactos

<ResponseExample>
  ```json 409 Conflict theme={null}
  {
    "error": "has_contacts",
    "message": "No se puede eliminar la etapa porque tiene 45 contacto(s). Mueve los contactos primero.",
    "contact_count": 45
  }
  ```
</ResponseExample>

<Tip>
  Para mover contactos masivamente antes de eliminar, usa:

  ```json theme={null}
  POST /contacts/v1/bulk
  {
    "operation": "set_funnel_stage",
    "contact_ids": ["uuid-1", "uuid-2", ...],
    "funnel_stage_id": "otra-etapa-uuid"
  }
  ```
</Tip>

***

## Webhooks

Cuando eliminas una etapa, se dispara el webhook `funnel_stage.deleted`:

```json theme={null}
{
  "event": "funnel_stage.deleted",
  "data": {
    "stage_id": "550e8400-e29b-41d4-a716-446655440000",
    "deleted_at": "2026-01-28T12:00:00Z"
  }
}
```

***

## Próximos Pasos

<CardGroup cols={2}>
  <Card title="Listar Etapas" icon="list" href="/api-reference/funnels/stages-list">
    Ver etapas restantes
  </Card>

  <Card title="Crear Etapa" icon="plus" href="/api-reference/funnels/stages-create">
    Agregar nueva etapa
  </Card>
</CardGroup>
