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

# Crear Enlace de Llamada

> Crea un enlace de llamada reutilizable (audio o video) que cualquiera puede abrir para unirse

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

## Descripción

Crea un **enlace de llamada** reutilizable, de audio o video, que se puede compartir con cualquier persona. Quien abra el enlace puede unirse a la llamada, sin necesidad de recibir una llamada primero. Usa el campo `video` para elegir entre un enlace de audio (por defecto) o de video. La respuesta incluye el `token` del enlace y la `url` completa, lista para compartir.

## Ejemplos

### Enlace de audio (por defecto)

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/call/link/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{}'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/call/link/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({})
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/call/link/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={}
  )
  ```

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

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

  func main() {
      body := strings.NewReader(`{}`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/call/link/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

### Enlace de video

`video: true` genera un enlace de llamada de video en lugar de audio.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/call/link/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "video": true
    }'
  ```

  ```javascript JavaScript theme={null}
  await fetch(`https://ryzeapi.cloud/api/call/link/${process.env.Instance_Name}`, {
    method: "POST",
    headers: {
      "token":        process.env.Token_Instance,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      video: true
    })
  });
  ```

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

  requests.post(
      f"https://ryzeapi.cloud/api/call/link/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "video": True
      }
  )
  ```

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

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

  func main() {
      body := strings.NewReader(`{
          "video": true
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/call/link/"+os.Getenv("Instance_Name"), body)
      req.Header.Set("token", os.Getenv("Token_Instance"))
      req.Header.Set("Content-Type", "application/json")
      http.DefaultClient.Do(req)
  }
  ```
</CodeGroup>

## Respuesta exitosa

```json 200 OK theme={null}
{
  "success": true,
  "token":   "AbCdEfGhIjKlMnOp",
  "url":     "https://call.whatsapp.com/audio/AbCdEfGhIjKlMnOp",
  "video":   false
}
```

<Note>
  Para `video: true`, el segmento de la URL cambia a `/video/` (ej.: `https://call.whatsapp.com/video/<token>`). El enlace es reutilizable, puede abrirlo varias personas, en momentos distintos, hasta que sea revocado.
</Note>

## Parámetros de ruta

<ParamField path="instance" type="string" required>
  Nombre de la instancia (p. ej., `$Instance_Name`).
</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="video" type="boolean" default="false">
  Cuando es `true`, genera un enlace de llamada de **video** en lugar de audio.
</ParamField>

## Errores

| HTTP | Mensaje                          |
| ---- | -------------------------------- |
| 400  | `Instance name is required`      |
| 400  | `Invalid request body: <detail>` |
| 404  | `instance not found`             |
| 500  | `<motivo del fallo>`             |

Envoltorio de error:

```json theme={null}
{
  "success": false,
  "error": { "message": "instance not found" }
}
```
