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

# Restablecer enlace de invitación

> Revoca el enlace de invitación actual y genera un nuevo código / enlace para el grupo

**Auth:** `TokenAccount` o `TokenInstance` • **Rate-limit:** `Global` (100/min) • **Idempotente:** no (cada llamada genera un código diferente)

## Descripción

Revoca el enlace de invitación actual del grupo y genera uno nuevo. **Solo los administradores** pueden llamar. Úsalo cada vez que sospeches que el enlace se filtró o después de eliminar a un miembro al que no quieres de vuelta.

## Ejemplos

### Restablecer enlace

Revoca el enlace de invitación actual del grupo `120363406289005073@g.us` y genera un nuevo código. El enlace antiguo deja de funcionar inmediatamente.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://ryzeapi.cloud/api/group/resetLink/$Instance_Name" \
    -H "token: $Token_Instance" \
    -H "Content-Type: application/json" \
    -d '{
      "identifier": "120363406289005073@g.us"
    }'
  ```

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

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

  requests.post(
      f"https://ryzeapi.cloud/api/group/resetLink/{os.environ['Instance_Name']}",
      headers={
          "token":        os.environ["Token_Instance"],
          "Content-Type": "application/json"
      },
      json={
          "identifier": "120363406289005073@g.us"
      }
  )
  ```

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

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

  func main() {
      body := strings.NewReader(`{
          "identifier": "120363406289005073@g.us"
      }`)
      req, _ := http.NewRequest("POST", "https://ryzeapi.cloud/api/group/resetLink/"+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

Devuelve el nuevo `inviteCode` y `inviteLink`, ambos ya activos. El enlace antiguo deja de funcionar inmediatamente, reemplaza cualquier copia en flujos de onboarding, materiales de marketing o códigos QR impresos.

```json 200 OK theme={null}
{
  "success": true,
  "message": "Group invite link reset successfully",
  "groupJid": "120363406289005073@g.us",
  "inviteCode": "NEW123XYZ",
  "inviteLink": "https://chat.whatsapp.com/NEW123XYZ"
}
```

## Parámetros de ruta

<ParamField path="instance" type="string" required>
  Nombre de la instancia.
</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="identifier" type="string" required>
  JID, código de invitación o enlace del grupo.
</ParamField>

## Notas

<Note>
  * El enlace antiguo deja de funcionar inmediatamente, quien aún no se haya unido recibe `Invite link has been revoked or expired`.
  * Para solamente **consultar** el enlace actual sin revocarlo, usa [`GET /info`](/es/api/groups/info) y lee `group.inviteLink`.
  * Para escenarios de compromiso más severos (administrador comprometido), también revoca el rol de admin a quien no debería tenerlo mediante [`/participants`](/es/api/groups/participants) con `action=demote`.
</Note>

## Errores

| HTTP | Mensaje                                                     |
| ---- | ----------------------------------------------------------- |
| 400  | `Identifier is required`                                    |
| 403  | `Not authorized to reset group invite link (must be admin)` |
| 404  | `Group not found or you are not a member of this group`     |

Envoltorio:

```json theme={null}
{
  "success": false,
  "error": { "message": "Not authorized to reset group invite link (must be admin)" }
}
```
