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

# Iniciar flujo

> Inicia manualmente un flujo de Typebot para un número, disparando el startChat

**Auth:** `TokenAccount` o `TokenInstance` • **Rate limit:** `Global` (100/min) • **Idempotente:** no

## Descripción

Inicia manualmente un flujo de Typebot para un número, sin esperar por un mensaje de trigger. RyzeAPI dispara el `startChat` del bot indicado y persiste la sesión. Útil para campañas de salida (outbound) y para retomar una conversación desde tu backend.

<Note>
  La instancia debe tener ya al menos un bot registrado (una integración activa).
</Note>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/typebot/start/suporte" \
    -H "token: $Token_Account" \
    -H "Content-Type: application/json" \
    -d '{
      "number":  "5511999999999",
      "botId":   "8f3a1c2e-...-b7d9",
      "variables": { "nome": "João", "plano": "premium" }
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch("https://ryzeapi.cloud/api/typebot/start/suporte", {
    method: "POST",
    headers: {
      "token":        process.env.Token_Account,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      number:  "5511999999999",
      botId:   "8f3a1c2e-...-b7d9",
      variables: { nome: "João", plano: "premium" }
    })
  });
  ```

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

  requests.post(
      "https://ryzeapi.cloud/api/typebot/start/suporte",
      headers={
          "token":        os.environ["Token_Account"],
          "Content-Type": "application/json"
      },
      json={
          "number":  "5511999999999",
          "botId":   "8f3a1c2e-...-b7d9",
          "variables": { "nome": "João", "plano": "premium" }
      }
  )
  ```

  ```go Go theme={null}
  package main

  import (
      "net/http"
      "os"
      "strings"
  )

  func main() {
      body := strings.NewReader(`{
          "number":  "5511999999999",
          "botId":   "8f3a1c2e-...-b7d9",
          "variables": { "nome": "João", "plano": "premium" }
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/typebot/start/suporte", body)
      req.Header.Set("token", os.Getenv("Token_Account"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Respuesta exitosa

```json 200 OK theme={null}
{
  "success": true,
  "message": "typebot flow started"
}
```

| Campo     | Descripción                                           |
| --------- | ----------------------------------------------------- |
| `success` | `true` cuando el flujo se disparó correctamente.      |
| `message` | Mensaje fijo de confirmación: `typebot flow started`. |

## Parámetros de ruta

<ParamField path="instance" type="string" required>
  Nombre de la instancia (p. ej., `suporte`).
</ParamField>

## Cabeceras

<ParamField header="token" type="string" required>
  `TokenAccount` o `TokenInstance`.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Cuerpo de la solicitud

<ParamField body="number" type="string" required>
  Número de destino en formato E.164 sin el `+` (p. ej., `5511999999999`).
</ParamField>

<ParamField body="botId" type="string" required>
  UUID del bot a iniciar, obtenido en [`GET /api/typebot/list/:instance`](/es/api/typebot/list).
</ParamField>

<ParamField body="variables" type="object">
  Variables prefilled pasadas a Typebot (mapa `string → string`). Ej.: `{ "nome": "João", "plano": "premium" }`.
</ParamField>

## Errores

| HTTP | `error.message`                                                | Causa                                                  |
| :--: | -------------------------------------------------------------- | ------------------------------------------------------ |
|  400 | `invalid body: ...`                                            | Body malformado o `number` / `botId` ausentes.         |
|  404 | `instance not found`                                           | La instancia no existe en RyzeAPI.                     |
|  404 | `no typebot integration for this instance, create a bot first` | La instancia todavía no tiene ningún bot/integración.  |
|  404 | `bot not found for this instance`                              | El `botId` indicado no existe en esta instancia.       |
|  500 | `start flow: ...`                                              | Fallo del servicio de integración al iniciar el flujo. |
|  503 | `integration gateway not configured`                           | Servicio de integración no disponible en el servidor.  |

## Siguiente

<CardGroup cols={2}>
  <Card title="Listar bots" icon="list" href="/es/api/typebot/list">
    Descubre el `botId` a usar con `GET /api/typebot/list/:instance`.
  </Card>

  <Card title="Registrar bot" icon="robot" href="/es/api/typebot/set">
    Configura un bot antes de iniciar flujos manualmente.
  </Card>
</CardGroup>
