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

# Configurar Stage Gate

<span class="badge--patch">PATCH</span> <code class="endpoint-url">/workflows/:id/tools/:toolId/stage-gate</code>

Gatea una tool personalizada a stages específicos del funnel, para que el agente solo la ofrezca cuando un lead llegue al status correcto.

## Parámetros de Ruta

| Parámetro | Tipo          | Requerido | Descripción   |
| --------- | ------------- | --------- | ------------- |
| `id`      | string (uuid) | **Sí**    | ID del agente |
| `toolId`  | string (uuid) | **Sí**    | ID de la tool |

## Cuerpo de la Solicitud

| Campo                   | Tipo              | Requerido | Descripción                                                                                                          |
| ----------------------- | ----------------- | --------- | -------------------------------------------------------------------------------------------------------------------- |
| `available_in_statuses` | string\[] \| null | **Sí**    | Keys de status del funnel donde se ofrece la tool. `null` limpia el gate, dejándola disponible en todos los statuses |

## Respuestas

### `200` — Actualizado

```json theme={null}
{
  "success": true,
  "tool": {
    "id": "9a1b2c3d-0000-4000-8000-000000000001",
    "name": "check_availability",
    "available_in_statuses": ["qualified", "negotiating"]
  }
}
```

### `400` — Error de validación

```json theme={null}
{
  "error": "Invalid input",
  "message": "available_in_statuses must be an array of status keys, or null to clear"
}
```

### `401` — Error de autenticación

Ver [Autenticación](/docs/es/api/authentication).

### `404` — No encontrado

```json theme={null}
{
  "error": "Not found",
  "message": "Tool not found"
}
```

### `500` — Error interno del servidor
